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
Sets the action command for this target
final public void setActionCommand(String command) { this.command = command; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setActionCommand(String command) {\n this.command = command;\n }", "public Builder setActionCommand(int value) {\n bitField0_ |= 0x00000010;\n actionCommand_ = value;\n onChanged();\n return this;\n }", "public void setAction(String action);", "public void setAction(Action action) {\n this.action = action;\n }", "public void setAction (String action) {\n this.action = action;\n }", "public void setAction(String action) { this.action = action; }", "public void setAction(String action) {\n\t\tthis.action.set(action);\n\t}", "public void setAction(String action) {\n this.action = action;\n }", "public void setAction(String action) {\n this.action = action;\n }", "private void setAction(String action)\r\n/* 46: */ {\r\n/* 47: 48 */ this.action = action;\r\n/* 48: */ }", "public void setAction(String action) {\n\t\tthis.action = action;\n\t}", "public void setAction(String str) {\n\t\taction = str;\n\t}", "public void setAction(int value) {\n this.action = value;\n }", "public void setAction(A action) {\r\n\t\tthis.action = action;\r\n\t}", "public void setAction(@NotNull Action action) {\n this.action = action;\n }", "public void setAction(String action) {\n this.action = action == null ? null : action.trim();\n }", "public void setAction(MethodExpression action) {\n this.action = action;\n }", "public void setExecuteAction(Action action) {\n this.data.setExecuteAction(action);\n }", "@Override\n\tpublic void setAction() {\n\t}", "public Builder setAction(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n action_ = value;\n onChanged();\n return this;\n }", "public void setAction(SliceItem action) {\n mAction = action;\n }", "final public String getActionCommand() {\n return command;\n }", "public void setAction(com.vmware.converter.AlarmAction action) {\r\n this.action = action;\r\n }", "public Builder setAction(int value) {\n bitField0_ |= 0x00000001;\n action_ = value;\n onChanged();\n return this;\n }", "public int getActionCommand() {\n return actionCommand_;\n }", "public int getActionCommand() {\n return actionCommand_;\n }", "public Builder clearActionCommand() {\n bitField0_ = (bitField0_ & ~0x00000010);\n actionCommand_ = 0;\n onChanged();\n return this;\n }", "public Target setActionClass(Class<?> action) {\n this.action = action;\n return this;\n }", "public void setAction(String action)\n {\n // Check property\n if (action == null) \n { \n action = \"\"; \n }\n \n // If the specified context path already contains\n // a query string, append an ampersand character\n // for further parameter concatenation\n if (action.indexOf(\"=\") != -1)\n {\n action = action + \"&\";\n }\n else\n {\n action = action + \"?\";\n }\n \n // Set property\n this.action = action;\n }", "public void setCommand(Command c) {\r\n\t\tcommand = c;\r\n\t}", "public ExitCommand(Action action) {\n super(action, true);\n }", "public void setJoinAction(IAction value) \n\t{\t\n\t\tjoinAction = value;\n\t}", "private final void setAction(Action a){\n\t\tthis.a = a;\n\t}", "public Builder withAction(final String action) {\n this.action = action;\n return this;\n }", "public void setCommand(int command)\n\t{\n\t\tthis.command = command;\n\t}", "public void setCommand(String command) {\n _command = command;\n }", "public RvSnoopAction getAction(String command);", "public void setCommand(String command)\r\n\t{\r\n\t\tthis.command = command;\r\n\t}", "@Property(\"triggerAction\")\n void setTriggerAction(String triggerAction);", "public void command (int action, Unit target) throws PPException{\n\t\tif (PPNative.Unit_ActionOnUnit (id, action, target.getId()) == -1)\n\t\t\tthrow new PPException (\"command -> \"+PPNative.GetError());\n\t}", "public void setCommand(String command) {\n this.command = command;\n }", "protected void setCommand(String command)\n {\n Command = command;\n }", "public void setCommand(String command)\n {\n this.command = command;\n }", "public setAcl_args setAction(TSetAclAction action) {\n this.action = action;\n return this;\n }", "@Override\n\tpublic String getAction() {\n\t\treturn action;\n\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic void chooseAction(String actionSet, String action) {\n\t\topen();\n\n\t\tnew DefaultCombo().setSelection(actionSet);\n\t\tnew DefaultTreeItem(new TreeItemRegexMatcher(action + \".*\")).doubleClick();\n\t}", "public void setAction(int row, int col, String action){\n environmentUtilities[row][col].setAction(action);\n }", "public void setCommand(String command) {\n this.command = command;\n }", "public void setProcessAction(String processAction) {\n\t\tthis.processAction = processAction;\n\t}", "@Override\n\tpublic void setButtonAction() {\n\t}", "public void setActionInfo(String actionInfo);", "public abstract void setCommand(String cmd);", "@Override\n\tpublic void setCommand(String cmd) {\n\t\t\n\t}", "@Override\n\tpublic void setCommand(String command) {\n\t\tmodel.setCommand(command);\n\t}", "public void setCmd(String cmd) {\r\n this.cmd = cmd;\r\n }", "public void setButtonSelection(String action);", "@Override\n\tpublic void doAction(String action) {\n\t\tthis.action = action;\n\t\t\n\t\tthis.gameController.pause();\n\t}", "public Builder setCommand(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n command_ = value;\n onChanged();\n return this;\n }", "public void setAction(Action a) {\n\tAction oldValue = getAction();\n\tif (action==null || !action.equals(a)) {\n\t action = a;\n\t if (oldValue!=null) {\n\t\tremoveActionListener(oldValue);\n\t\toldValue.removePropertyChangeListener(actionPropertyChangeListener);\n\t\tactionPropertyChangeListener = null;\n\t }\n\t configurePropertiesFromAction(action);\n\t if (action!=null) {\t\t\n\t\t// Don't add if it is already a listener\n\t\tif (!isListener(ActionListener.class, action)) {\n\t\t addActionListener(action);\n\t\t}\n\t\t// Reverse linkage:\n\t\tactionPropertyChangeListener = createActionPropertyChangeListener(action);\n\t\taction.addPropertyChangeListener(actionPropertyChangeListener);\n\t }\n\t firePropertyChange(\"action\", oldValue, action);\n\t revalidate();\n\t repaint();\n\t}\n }", "public String getAction() {\n return action;\n }", "public void setAction(ActionListener actionListener){\n this.actionListener = actionListener;\n }", "public Target setActionMethod(Method method) {\n this.method = method;\n return this;\n }", "public void setSelectedAction(Action action) { \n // Make sure the selected action is in the list\n if (actions.contains(action)) {\n selectedAction = action;\n repaint();\n } \n }", "public Builder setMinigameAction(POGOProtos.Rpc.CombatActionProto value) {\n if (minigameActionBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n minigameAction_ = value;\n onChanged();\n } else {\n minigameActionBuilder_.setMessage(value);\n }\n\n return this;\n }", "public String getAction() {\n return action;\n }", "public String getAction() {\n return action;\n }", "public String getAction() {\n return action;\n }", "public String getAction () {\n return action;\n }", "public void setAction(GrouperActivemqPermissionAction action1) {\r\n this.action = action1;\r\n }", "public void setAction(NameIdAction action) {\n\t\tif (nameidRequest != null) {nameidRequest.execute(action);}\n\t}", "public String getAction() {\r\n\t\treturn action;\r\n\t}", "public void setActionIndex(int actionIndex) {\n this.actionIndex = actionIndex;\n }", "public Builder setCurrentAction(POGOProtos.Rpc.CombatActionProto value) {\n if (currentActionBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n currentAction_ = value;\n onChanged();\n } else {\n currentActionBuilder_.setMessage(value);\n }\n\n return this;\n }", "@Override\n public void setNewAction(Mossa.Action action) {\n jumpMove.setDisable(false);\n Platform.runLater(() -> {\n submitAction.setDisable(true);\n\n });\n switch (action) {\n case BUILD:\n lightBuild();\n if (!inTurno) {\n lightMyPawns();\n inTurno = true;\n firstAction = true;\n } else {\n c = table.getTableCell(table.getXYPawn(getID(), currentPawn, true),\n table.getXYPawn(getID(), currentPawn, false));\n firstAction = false;\n lightAvailable(c, bt[table.getXYPawn(getID(), currentPawn, true)][table.getXYPawn(getID(), currentPawn, false)]);\n\n }\n currentMove = new Mossa();\n currentMove.setAction(action);\n\n break;\n case MOVE:\n lightMove();\n currentMove = new Mossa();\n currentMove.setAction(action);\n if (!inTurno) {\n effetto = true;\n lightMyPawns();\n inTurno = true;\n firstAction = true;\n } else {\n firstAction = false;\n c = table.getTableCell(table.getXYPawn(getID(), currentPawn, true),\n table.getXYPawn(getID(), currentPawn, false));\n lightAvailable(c, bt[table.getXYPawn(getID(), currentPawn, true)][table.getXYPawn(getID(), currentPawn, false)]);//prima era true\n\n }\n }\n }", "public String getAction() {\n return this.action;\n }", "public void select(int action) {\n\t\tselected = true;\n\t\tthis.action = action;\n\t}", "public void setInAction(String value) {\n setValue(IN_ACTION, value);\n }", "public String getAction() {\n\t\treturn action.get();\n\t}", "public void setCommand(@NonNull Command<Boolean, String> command) {\n this.command = command;\n }", "public String getAction() {\n\t\treturn action;\n\t}", "public String getAction() {\n\t\treturn action;\n\t}", "public String getAction() {\n\t\treturn action;\n\t}", "public String getAction() {\n\t\treturn action;\n\t}", "public MapReduceToCollectionOperation action(final String action) {\n notNull(\"action\", action);\n isTrue(\"action must be one of: \\\"replace\\\", \\\"merge\\\", \\\"reduce\\\"\", VALID_ACTIONS.contains(action));\n this.action = action;\n return this;\n }", "public Volume action(ActionEnum action) {\n this.action = action;\n return this;\n }", "public void commandAction(Command cmd, Displayable displayable) {\r\n\t\t\tAbstractCommand myCommand = (AbstractCommand) cmd;\r\n\t\t\tmyCommand.execute();\r\n\t\t}", "protected void setCommand(CommandManager command) {\n\tthis.command = command;\n }", "public CommandListModel(String action, String format) {\n this.action = new SimpleStringProperty(action);\n this.format = new SimpleStringProperty(format);\n }", "public void command (int action, Point2D.Float target) throws PPException{\n\t\tif (PPNative.Unit_ActionOnPosition (id, action, target.x, target.y) == -1)\n\t\t\tthrow new PPException (\"command -> \"+PPNative.GetError());\n\t}", "public Builder setCommand(int value) {\n bitField0_ |= 0x00000004;\n command_ = value;\n onChanged();\n return this;\n }", "public boolean setToolCommand(String command);", "@Override\n public void initDefaultCommand() {\n setDefaultCommand(new ValidTarget());\n }", "public Builder setActionBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n action_ = value;\n onChanged();\n return this;\n }", "public void setUserAction(String newUserAction) {\n userAction = newUserAction;\n }", "public void setAction(RateLimiterAction action) {\n this.action = action;\n }", "Action(String desc){\n this.desc = desc;\n this.append = \"\";\n }", "private void setGoCommand() {\n myCanvas.removeCommand(myPauseCommand);\n myCanvas.removeCommand(myNewCommand);\n myCanvas.addCommand(myGoCommand);\n }", "public void setActionMoveCursor(GralUserAction action){ actionMoveCursor = action; }", "public void setAction(State s, Action a) {\r\n\t\tif(s.isTerminated())\r\n\t\t\treturn ;\r\n\t\t\r\n\t\ts.action = a;\r\n\t}", "public Action putAction(Action action) throws IllegalArgumentException {\n\t\tif (action == null)\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"You cannot put null Actions in an ActionManager!\");\n\t\tString key = (String) action.getValue(Action.ACTION_COMMAND_KEY);\n\t\tif (key == null)\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"This Action has a null command String!\");\n\t\treturn putAction(key, action);\n\t}" ]
[ "0.81476945", "0.76457214", "0.74146974", "0.7285632", "0.72297835", "0.7198548", "0.71240646", "0.7115998", "0.7115998", "0.7002313", "0.6980836", "0.6920686", "0.69130546", "0.6866748", "0.6845269", "0.68295145", "0.6762667", "0.6663449", "0.6618504", "0.660885", "0.6595991", "0.6451806", "0.64157885", "0.63218737", "0.6314627", "0.6300438", "0.6275726", "0.6190009", "0.6143777", "0.6129734", "0.61022073", "0.60850877", "0.6065902", "0.6064969", "0.60514", "0.6046059", "0.6032828", "0.6016347", "0.60057026", "0.5984933", "0.5984317", "0.5979283", "0.5972588", "0.59662443", "0.5963737", "0.5937431", "0.5936212", "0.5917702", "0.5888639", "0.5878546", "0.5869013", "0.5868615", "0.57971466", "0.5789061", "0.57886463", "0.57690865", "0.57674426", "0.57615227", "0.5755707", "0.57529616", "0.5744554", "0.57422173", "0.5738916", "0.5738449", "0.57336164", "0.57336164", "0.57336164", "0.5723794", "0.5717269", "0.57050514", "0.5704548", "0.56997836", "0.5685114", "0.5681703", "0.56747407", "0.5640175", "0.56204855", "0.5611541", "0.56030506", "0.5599121", "0.5599121", "0.5599121", "0.5599121", "0.5576974", "0.5561125", "0.555967", "0.55491036", "0.5528718", "0.5523327", "0.55199635", "0.5517439", "0.5498303", "0.5493663", "0.5488283", "0.5483825", "0.5483549", "0.547964", "0.5479136", "0.54664785", "0.54566354" ]
0.82626945
0
Whether the interaction with the target affects the toplevel group of the element that contains it (instead of only affecting the element). Default is false.
final public void setAffectsGroup(boolean value) { affectsGroup = value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "final public boolean getAffectsGroup() {\n return affectsGroup;\n }", "@Override\n public boolean isChildSelectable(int groupPosition, int childPosition) {\n return false;\n }", "boolean isChildSelectable(int groupPosition, int childPosition);", "@Override\r\n public boolean isChildSelectable(int groupPosition, int childPosition) {\n return true;\r\n }", "@Override\n public boolean isChildSelectable(int groupPosition, int childPosition) {\n return true;\n }", "@Override\n public boolean isChildSelectable(int groupPosition, int childPosition) {\n return true;\n }", "@Override\n public boolean isChildSelectable(int groupPosition, int childPosition) {\n return true;\n }", "@Override\n public boolean isChildSelectable(int groupPosition, int childPosition) {\n return true;\n }", "@Override\n public boolean isChildSelectable(int groupPosition, int childPosition)\n {\n return true;\n }", "@Override\r\n\tpublic boolean isChildSelectable(int groupPosition, int childPosition) {\n\t\treturn false;\r\n\t}", "@Override\n public boolean isChildSelectable(int groupPosition, int childPosition) {\n\n return true;\n }", "@Override\n public boolean isGroup() {\n return false;\n }", "@Override\n\t\tpublic boolean isChildSelectable(int groupPosition, int childPosition) {\n\t\t\treturn false;\n\t\t}", "@Override\n\t\tpublic boolean isChildSelectable(int groupPosition, int childPosition) {\n\t\t\treturn false;\n\t\t}", "@Override\r\n\tpublic boolean isChildSelectable(int groupPosition, int childPosition) {\n\t\treturn true;\r\n\t}", "@Override\n\tpublic boolean isInside() {\n\t\treturn false;\n\t}", "boolean hasGroupPlacementView();", "@Override\n\t\t\tpublic boolean isChildSelectable(int groupPosition,\n\t\t\t\t\tint childPosition) {\n\t\t\t\treturn false;\n\t\t\t}", "@JsonIgnore\n public boolean isFixedTargetGroupsSet() { return isSet.contains(\"fixedTargetGroups\"); }", "@Override\n\tpublic boolean isChildSelectable(int groupPosition, int childPosition) {\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean isChildSelectable(int groupPosition, int childPosition) {\n\t\treturn true;\n\t}", "public boolean isTargetSelected() {\n return targetSelected;\n }", "public boolean isInMultiPane();", "Boolean groupingEnabled();", "public boolean isTargetVisible() {\n return getDouble(\"tv\") == 1;\n }", "public boolean isInteractionRoot()\n\t{\n\t\treturn this == model.getInteractionRoot();\n\t}", "public abstract boolean isTarget();", "private boolean isRelevant(final Group group, final RunnerContext pContext) {\n\n\t\tfor (Renderable r : group.getItems()) {\n\n\t\t\tif (r instanceof Control) {\n\t\t\t\tControl control = (Control) r;\n\t\t\t\tString bind = control.getBind();\n\t\t\t\tModel model = pContext.getModel();\n\t\t\t\tInstance inst = pContext.getInstance();\n\t\t\t\tItemProperties props = model.getItemProperties(bind);\n\n\t\t\t\tif (props == null) {\n\t\t\t\t\tprops = new ItemPropertiesImpl(bind);\n\t\t\t\t}\n\n\t\t\t\tif (NodeValidator.isRelevant(props, inst, model)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} else if (r instanceof TextBlock) {\n\t\t\t\treturn true;\n\t\t\t} else if (r instanceof Group && isRelevant((Group) r, pContext)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "boolean isSetTarget();", "@Override\r\n\tpublic boolean isHovered() {\n\t\tint hovered = this.group.hovered;\r\n\t\tif(hovered >= 0 && hovered < this.group.items.size())\r\n\t\t{\r\n\t\t\tif(this == this.group.items.get(hovered))\r\n\t\t\t{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public void setIsMultiPane(boolean isMultiPane);", "@Override\r\n public boolean onGroupClick(ExpandableListView parent, View v,\r\n int groupPosition, long id) {\n return false;\r\n }", "private boolean componentEnabled(MJIEnv env, int tgtRef){\n \n int listRef = env.getStaticReferenceField(\"java.awt.Window\", \"modalDialogs\");\n int arrayRef = env.getReferenceField(listRef, \"elementData\"); \n \n int arrayLength = env.getStaticIntField(\"java.awt.Window\", \"numModalDialogs\");\n \n if(arrayLength >0){\n int topModalDialogRef = env.getReferenceArrayElement(arrayRef, arrayLength-1);\n //follow references upwards until no parent, get top-level window for current component\n int parentRef = env.getReferenceField(tgtRef, \"parent\");\n \n ElementInfo ei = env.getElementInfo(parentRef);\n log.fine(\"Parent :\"+ei);\n \n while(parentRef != MJIEnv.NULL){\n parentRef = env.getReferenceField(parentRef, \"parent\");\n \n ei = env.getElementInfo(parentRef);\n log.fine(\"Parent :\"+ei);\n //found a match\n if(parentRef == topModalDialogRef){\n return true;\n }\n }\n log.warning(\"action does not belong to top modal dialog\");\n return false; \n }\n //no modal dialogs, no restrictions\n return true;\n }", "public void setIncludeSubGroups(java.lang.Boolean value);", "@Override\n public boolean onGroupClick(ExpandableListView parent, View v,\n int groupPosition, long id) {\n return false;\n }", "public default boolean hasScannableGroup() {\n\t\treturn false;\n\t}", "public boolean isSelectingAttackTarget() {\n return false;\n }", "public boolean dragFromSubComponents();", "@Override\n public boolean onGroupClick(ExpandableListView parent, View v,\n int groupPosition, long id) {\n return false;\n }", "@Override\n public boolean onGroupClick(ExpandableListView parent, View v,\n int groupPosition, long id) {\n return false;\n }", "@Override\n public boolean onGroupClick(ExpandableListView parent, View v,\n int groupPosition, long id) {\n return false;\n }", "@Override\n public boolean onGroupClick(ExpandableListView parent, View v,\n int groupPosition, long id) {\n return false;\n }", "public boolean isTopLevel() {\n return this.topLevel;\n }", "public boolean isTopLevel() {\n return this.topLevel;\n }", "boolean hasTargetPos();", "@Override\n public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long id) {\n return false;\n }", "public boolean isEditing() { RMShape p = getParent(); return p!=null && p.isEditing(); }", "protected boolean isOnSameScreenAsChildren() {\n return true;\n }", "boolean isTopLevel();", "public void setTopLevel(boolean topLevel) {\n }", "public boolean isShowLinksToUi() {\r\n return this.getDefaultGroup() != null;\r\n }", "public boolean inGroup(Person p){\n\t return false;\n }", "public boolean canBeSeen()\n {\n if (!this.hasParent() || !this.isVisible())\n {\n return false;\n }\n\n GuiElement element = this;\n\n while (true)\n {\n if (!element.isVisible())\n {\n return false;\n }\n\n GuiElement parent = element.getParent();\n\n if (parent instanceof GuiDelegateElement && ((GuiDelegateElement) parent).delegate != element)\n {\n return false;\n }\n\n if (parent == null)\n {\n break;\n }\n\n element = parent;\n }\n\n return element instanceof GuiBase.GuiRootElement;\n }", "public void setTargetSelected(boolean targetSelected) {\n this.targetSelected = targetSelected;\n }", "@JsonIgnore\n public boolean isTargetGroupConfigSet() { return isSet.contains(\"targetGroupConfig\"); }", "public boolean groupSpecified() {\n return group != null && !group.isEmpty();\n }", "public boolean onGroupClick(ExpandableListView parent, View v,int groupPosition, long id) {\n\t\t\t return false;\r\n\t\t\t}", "public static boolean corectTargetResponse() {\n\t\tif (blockContext.targetCircles[blockContext.exitFlag] == blockContext.clickedCircle) {\n\t\t\treturn (true);\n\t\t} else {\n\t\t\treturn (false);\n\t\t}\n\t}", "public boolean isGroup() {\n if (overrideGroupKey != null || isAppGroup()) {\n return true;\n }\n return false;\n }", "public boolean hasTarget(){\n\t\treturn this.targetComponent != null;\n\t}", "@Override\n\tpublic boolean isChildSelectable(int sectionPosition, int childPosition) {\n\t\treturn true;\n\t}", "public abstract boolean isInWidgetTree();", "@Override\n public boolean onGroupClick(ExpandableListView parent, View v,\n int groupPosition, long id) {\n Log.v(\"popwindow\",\"show the window111\");\n expandlistView.expandGroup(groupPosition);\n return true;\n }", "public boolean keepCombating(Figure target) {\n return true;\n }", "@Override\n\tpublic boolean onTarget() {\n\t\treturn super.onTarget(mAngleTolerance);\n\t}", "public boolean superSelectable() { return getClass()==RMParentShape.class; }", "public boolean isChild(){\n return false;\n }", "public boolean isRoot() { return getAncestorCount()<2; }", "public boolean isInGroup() {\n return multiply(CURVE_ORDER).isInfinity();\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.lang.Boolean isIncludeSubGroups();", "public boolean isFilterByGroup()\r\n {\r\n return getSemanticObject().getBooleanProperty(swpres_filterByGroup);\r\n }", "public boolean isViewing() { RMShape p = getParent(); return p!=null && p.isViewing(); }", "public void setKeepInsideWindow(boolean keepInWindow) {\n keepInsideWindow = keepInWindow;\n }", "public void setTopLevel(boolean topLevel) {\n this.topLevel = topLevel;\n }", "private boolean parentKiller() {\n RadioGroup radioGroupCity = (RadioGroup) findViewById(R.id.parent_killer);\n RadioButton parentCheckRadioButton = (RadioButton) radioGroupCity.findViewById(radioGroupCity.getCheckedRadioButtonId());\n boolean checked = (parentCheckRadioButton.isChecked());\n\n switch (parentCheckRadioButton.getId()) {\n case R.id.marconi_button:\n if (checked) {\n return false;\n }\n case R.id.falcone_button:\n if (checked) {\n return false;\n }\n case R.id.chill_button:\n if (checked) {\n return true;\n }\n case R.id.zucco_button:\n if (checked) {\n return false;\n }\n }\n return false;\n }", "@Override\n public boolean onNestedPreFling(View target, float velocityX, float velocityY) {\n return mCaptured;\n }", "public boolean setLightForGroupingUnassigned() {\n Log.i(tag, \"setLightForGroupingUnassigned\");\n if (this.groups.isEmpty()) {\n this.groups.add(new LinkedList());\n }\n if (this.lightForGrouping.getGroupNumber() == 0) {\n Log.i(tag, \"already unassigned, dont do anything\");\n } else {\n LinkedList<Light> groupToRemove = null;\n boolean afterFirstGroup = false;\n Iterator it = this.groups.iterator();\n while (it.hasNext()) {\n LinkedList<Light> group = (LinkedList) it.next();\n group.remove(this.lightForGrouping);\n if (afterFirstGroup && group.isEmpty()) {\n groupToRemove = group;\n }\n afterFirstGroup = true;\n }\n if (groupToRemove != null) {\n Log.i(tag, \"removed group \");\n this.groups.remove(groupToRemove);\n }\n this.lightForGrouping.setGroupName(\"unassigned\", false);\n this.lightForGrouping.setGroupNumber(0, false);\n if (!((LinkedList) this.groups.get(0)).isEmpty() && ((Light) ((LinkedList) this.groups.get(0)).get(0)).getGroupNumber() != 0) {\n this.groups.addFirst(new LinkedList());\n }\n if (this.lightForGrouping instanceof DreamScreen) {\n ((LinkedList) this.groups.getFirst()).addFirst(this.lightForGrouping);\n } else {\n ((LinkedList) this.groups.getFirst()).add(this.lightForGrouping);\n }\n if (this.currentLight == this.lightForGrouping && this.broadcastingToGroup) {\n this.broadcastingToGroup = false;\n setToolbarTitle();\n }\n redrawDrawerLinearLayout();\n highlightDrawerSelection();\n if ((this.currentLight instanceof SideKick) || (this.currentLight instanceof Connect)) {\n Fragment currentFragment = getSupportFragmentManager().findFragmentById(R.id.frameLayout);\n if (currentFragment instanceof DreamScreenFragment) {\n ((DreamScreenFragment) currentFragment).redrawFragment();\n }\n }\n }\n return true;\n }", "public void toggleGroup(DefaultMutableTreeNode node) {\n SortedTreeModel model = (SortedTreeModel)main.tree.getModel();\n SortedTreeModel othermodel =\n (model == main.skilltree ? main.otherskilltree : main.skilltree);\n model.removeNodeFromParent(node);\n setDirty(true);\n othermodel.insertNodeSorted\n (node, (DefaultMutableTreeNode) othermodel.getRoot());\n main.getState().toggleGroup(node.toString());\n }", "private boolean getCollapse() {\n return false;\n }", "public boolean isChild() {\n\t\treturn false;\n\t}", "@Override\r\n public boolean doIsModified() {\r\n return this.updatedGroups.isEmpty();\r\n }", "public boolean hasParent() {\n return internalGroup.hasParent();\n }", "@Override\r\n\tpublic boolean isSameGroup(EyeTrackerItem element) {\n\t\treturn this.group.items.contains(element);\r\n\t}", "@Override\r\n public boolean onGroupClick(ExpandableListView parent, View v,\r\n int groupPosition, long id) {\n if (sign == -1) {\r\n // 展开被选的group\r\n data_list.expandGroup(groupPosition);\r\n // 设置被选中的group置于顶端\r\n data_list.setSelectedGroup(groupPosition);\r\n sign = groupPosition;\r\n } else if (sign == groupPosition) {\r\n data_list.collapseGroup(sign);\r\n sign = -1;\r\n } else {\r\n data_list.collapseGroup(sign);\r\n // 展开被选的group\r\n data_list.expandGroup(groupPosition);\r\n // 设置被选中的group置于顶端\r\n data_list.setSelectedGroup(groupPosition);\r\n sign = groupPosition;\r\n }\r\n return true;\r\n }", "@Override\n public void onGroupExpand(int groupPosition) {\n }", "boolean hasMainUtteranceTargetLevel();", "private boolean isPrivate( Target target ) {\n if ( target == null )\n return true;\n String target_name = target.getName();\n if ( target_name.indexOf( '.' ) > 0 ) {\n return true;\n }\n if ( target_name.startsWith( \"-\" ) ) {\n return true;\n }\n String description = target.getDescription();\n if ( description == null || description.equals( \"\" ) ) {\n return true;\n }\n return false;\n }", "public boolean setToExtend(AccessGroup group)\n {\n if (!isParent(group))\n {\n this.extendGroup = group;\n if (this.extendGroup != null)\n {\n this.extendGroup_name = this.extendGroup.getName();\n }\n return true;\n }\n return false;\n }", "@Override\n public boolean isOnTop()\n {\n return false;\n }", "@Override\n public void acceptHit(boolean hit, Element target) {\n }", "@Override\n public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long id) {\n if ( Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {\n return parent.expandGroup(groupPosition, true);\n }else\n\n return true;\n }", "public boolean isItemGroup() {\n return itemGroup;\n }", "boolean onChildClick(int childPosition) {\n return false;\n }", "public void setParentable(Boolean parentable);", "@Override\n public void onGroupCollapse(int groupPosition) {\n }", "boolean isExpandScopeShadowRoot();", "public boolean isParent(AccessGroup group)\n {\n if (group == this)\n {\n return true;\n }\n if (group != null)\n {\n if (group.getExtendGroup() != null)\n {\n return group.getExtendGroup() == this || isParent(group.getExtendGroup());\n }\n }\n return false;\n }", "public Boolean isParentable();", "public boolean isParent();", "public boolean isExpandable();" ]
[ "0.62751365", "0.6085376", "0.5995002", "0.5983585", "0.59678495", "0.59678495", "0.59678495", "0.59678495", "0.5952647", "0.5872265", "0.58559227", "0.57978535", "0.57274514", "0.57274514", "0.5678988", "0.56674874", "0.5624625", "0.5594616", "0.5592865", "0.5578159", "0.5578159", "0.55646497", "0.55013335", "0.5470238", "0.54043216", "0.53674847", "0.5359104", "0.5357814", "0.5304038", "0.52803844", "0.5278855", "0.52598697", "0.5257847", "0.5231575", "0.52113324", "0.5207887", "0.5196811", "0.5177179", "0.51636815", "0.51636815", "0.51636815", "0.51636815", "0.5162726", "0.5162726", "0.5141207", "0.51266706", "0.5080135", "0.50668734", "0.5058982", "0.5042845", "0.5033551", "0.50315326", "0.50207555", "0.50171995", "0.50085944", "0.5006594", "0.5003463", "0.49827892", "0.4968873", "0.49495384", "0.49381223", "0.49380416", "0.49308586", "0.49215633", "0.49183288", "0.49075818", "0.49042955", "0.49011675", "0.49008903", "0.4895495", "0.48913875", "0.48880377", "0.4878638", "0.4866354", "0.48660696", "0.4862224", "0.48616147", "0.48520836", "0.48517182", "0.4845132", "0.4843291", "0.48260862", "0.482429", "0.48187107", "0.48177263", "0.48159146", "0.4811605", "0.4801301", "0.47981924", "0.47977424", "0.47970682", "0.47900563", "0.4786899", "0.4783102", "0.4781191", "0.47799504", "0.47788954", "0.47775096", "0.47567835", "0.47562677" ]
0.65040815
0
Whether the target affects the toplevel group
final public boolean getAffectsGroup() { return affectsGroup; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean isTopLevel();", "boolean isChildSelectable(int groupPosition, int childPosition);", "public abstract boolean isTarget();", "boolean hasGroupPlacementView();", "boolean hasMainUtteranceTargetLevel();", "boolean isSetTarget();", "public boolean isTopLevel() {\n return this.topLevel;\n }", "public boolean isTopLevel() {\n return this.topLevel;\n }", "public boolean isTargetVisible() {\n return getDouble(\"tv\") == 1;\n }", "@Override\n public boolean isGroup() {\n return false;\n }", "final public void setAffectsGroup(boolean value) {\n affectsGroup = value;\n }", "@Override\r\n public boolean isChildSelectable(int groupPosition, int childPosition) {\n return true;\r\n }", "boolean hasTargetPos();", "public boolean isInMultiPane();", "@Override\n public boolean isChildSelectable(int groupPosition, int childPosition) {\n return true;\n }", "@Override\n public boolean isChildSelectable(int groupPosition, int childPosition) {\n return true;\n }", "@Override\n public boolean isChildSelectable(int groupPosition, int childPosition) {\n return true;\n }", "@Override\n public boolean isChildSelectable(int groupPosition, int childPosition) {\n return true;\n }", "@Override\n public boolean isChildSelectable(int groupPosition, int childPosition)\n {\n return true;\n }", "@Override\n public boolean isChildSelectable(int groupPosition, int childPosition) {\n return false;\n }", "public abstract boolean isInWidgetTree();", "private boolean isRelevant(final Group group, final RunnerContext pContext) {\n\n\t\tfor (Renderable r : group.getItems()) {\n\n\t\t\tif (r instanceof Control) {\n\t\t\t\tControl control = (Control) r;\n\t\t\t\tString bind = control.getBind();\n\t\t\t\tModel model = pContext.getModel();\n\t\t\t\tInstance inst = pContext.getInstance();\n\t\t\t\tItemProperties props = model.getItemProperties(bind);\n\n\t\t\t\tif (props == null) {\n\t\t\t\t\tprops = new ItemPropertiesImpl(bind);\n\t\t\t\t}\n\n\t\t\t\tif (NodeValidator.isRelevant(props, inst, model)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} else if (r instanceof TextBlock) {\n\t\t\t\treturn true;\n\t\t\t} else if (r instanceof Group && isRelevant((Group) r, pContext)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "Boolean groupingEnabled();", "@JsonIgnore\n public boolean isFixedTargetGroupsSet() { return isSet.contains(\"fixedTargetGroups\"); }", "@Override\n public boolean isChildSelectable(int groupPosition, int childPosition) {\n\n return true;\n }", "public void setTopLevel(boolean topLevel) {\n }", "@Override\r\n\tpublic boolean isChildSelectable(int groupPosition, int childPosition) {\n\t\treturn false;\r\n\t}", "public boolean isTargetSelected() {\n return targetSelected;\n }", "public boolean isChild();", "public boolean isUseParent()\n {\n return (isPragma() && getModule().toKeyword().isParentKeyword());\n }", "@Override\r\n\tpublic boolean isChildSelectable(int groupPosition, int childPosition) {\n\t\treturn true;\r\n\t}", "@Override\n public boolean test() {\n return parentName.equals(themesComboBox.target().getSelectedItem().toString());\n }", "private boolean isPrivate( Target target ) {\n if ( target == null )\n return true;\n String target_name = target.getName();\n if ( target_name.indexOf( '.' ) > 0 ) {\n return true;\n }\n if ( target_name.startsWith( \"-\" ) ) {\n return true;\n }\n String description = target.getDescription();\n if ( description == null || description.equals( \"\" ) ) {\n return true;\n }\n return false;\n }", "public boolean isExpandable();", "@Override\n\t\tpublic boolean isChildSelectable(int groupPosition, int childPosition) {\n\t\t\treturn false;\n\t\t}", "@Override\n\t\tpublic boolean isChildSelectable(int groupPosition, int childPosition) {\n\t\t\treturn false;\n\t\t}", "@Override\r\n\tpublic boolean isHovered() {\n\t\tint hovered = this.group.hovered;\r\n\t\tif(hovered >= 0 && hovered < this.group.items.size())\r\n\t\t{\r\n\t\t\tif(this == this.group.items.get(hovered))\r\n\t\t\t{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public boolean isShowLinksToUi() {\r\n return this.getDefaultGroup() != null;\r\n }", "public boolean isRoot() { return getAncestorCount()<2; }", "public abstract boolean levelUp();", "@Override\n\tpublic boolean isChildSelectable(int groupPosition, int childPosition) {\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean isChildSelectable(int groupPosition, int childPosition) {\n\t\treturn true;\n\t}", "public boolean hasTarget(){\n\t\treturn this.targetComponent != null;\n\t}", "public boolean isParent();", "boolean hasParent();", "boolean hasParent();", "boolean hasLevel();", "boolean hasLevel();", "boolean hasLevel();", "boolean hasLevel();", "public default boolean hasScannableGroup() {\n\t\treturn false;\n\t}", "public boolean inGroup(Person p){\n\t return false;\n }", "public Boolean isParentable();", "public boolean hasParent() {\n return internalGroup.hasParent();\n }", "@Override\n\t\t\tpublic boolean isChildSelectable(int groupPosition,\n\t\t\t\t\tint childPosition) {\n\t\t\t\treturn false;\n\t\t\t}", "@Override\n\tpublic boolean isInside() {\n\t\treturn false;\n\t}", "public boolean hasTarget() {\n return target != null;\n }", "@Override public boolean selectAutomaticallyInTreeMenu() {\n return infoPanel == null;\n }", "public boolean isViewing() { RMShape p = getParent(); return p!=null && p.isViewing(); }", "private boolean componentEnabled(MJIEnv env, int tgtRef){\n \n int listRef = env.getStaticReferenceField(\"java.awt.Window\", \"modalDialogs\");\n int arrayRef = env.getReferenceField(listRef, \"elementData\"); \n \n int arrayLength = env.getStaticIntField(\"java.awt.Window\", \"numModalDialogs\");\n \n if(arrayLength >0){\n int topModalDialogRef = env.getReferenceArrayElement(arrayRef, arrayLength-1);\n //follow references upwards until no parent, get top-level window for current component\n int parentRef = env.getReferenceField(tgtRef, \"parent\");\n \n ElementInfo ei = env.getElementInfo(parentRef);\n log.fine(\"Parent :\"+ei);\n \n while(parentRef != MJIEnv.NULL){\n parentRef = env.getReferenceField(parentRef, \"parent\");\n \n ei = env.getElementInfo(parentRef);\n log.fine(\"Parent :\"+ei);\n //found a match\n if(parentRef == topModalDialogRef){\n return true;\n }\n }\n log.warning(\"action does not belong to top modal dialog\");\n return false; \n }\n //no modal dialogs, no restrictions\n return true;\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.lang.Boolean isIncludeSubGroups();", "protected boolean atGlobalScope() {\n return !currentScope.hasParent();\n }", "public static boolean corectTargetResponse() {\n\t\tif (blockContext.targetCircles[blockContext.exitFlag] == blockContext.clickedCircle) {\n\t\t\treturn (true);\n\t\t} else {\n\t\t\treturn (false);\n\t\t}\n\t}", "public void setTopLevel(boolean topLevel) {\n this.topLevel = topLevel;\n }", "public boolean getCanSpawnHere()\n {\n return this.isValidLightLevel() && super.getCanSpawnHere();\n }", "public boolean isGroup() {\n if (overrideGroupKey != null || isAppGroup()) {\n return true;\n }\n return false;\n }", "boolean isExpandScopeShadowRoot();", "boolean hasHotelGroupView();", "boolean coreHasParent();", "@Override\n public boolean isOnTop()\n {\n return false;\n }", "boolean hasRootFrame();", "public void setIsMultiPane(boolean isMultiPane);", "boolean hasIsMainFrame();", "boolean hasParentalStatusView();", "public boolean isMasterDetailFlow();", "public boolean isMainline();", "public boolean hasContainingParentLevel() {\n return fieldSetFlags()[3];\n }", "public boolean isEditing() { RMShape p = getParent(); return p!=null && p.isEditing(); }", "public abstract boolean isTrigger();", "public boolean isChild(){\n return false;\n }", "boolean isTargetStatistic();", "public boolean hasTarget() { \n if (isReal) {\n return get(\"tv\") == 1; // cleaned return statement up\n } else {\n return hasTargetSim.getBoolean(false);\n }\n }", "public boolean isParent(AccessGroup group)\n {\n if (group == this)\n {\n return true;\n }\n if (group != null)\n {\n if (group.getExtendGroup() != null)\n {\n return group.getExtendGroup() == this || isParent(group.getExtendGroup());\n }\n }\n return false;\n }", "private static boolean allowClose(MutableGroup currentGroup) {\n \t\tif (currentGroup instanceof Instance) {\n \t\t\treturn false; // instances may never be closed, they have no parent in the group stack\n \t\t}\n \t\t\n \t\tif (currentGroup.getDefinition() instanceof GroupPropertyDefinition && \n \t\t\t\t((GroupPropertyDefinition) currentGroup.getDefinition()).getConstraint(ChoiceFlag.class).isEnabled()) {\n \t\t\t// group is a choice\n \t\t\tIterator<QName> it = currentGroup.getPropertyNames().iterator();\n \t\t\tif (it.hasNext()) {\n \t\t\t\t// choice has at least on value set -> check cardinality for the corresponding property\n \t\t\t\tQName name = it.next();\n \t\t\t\treturn isValidCardinality(currentGroup, currentGroup.getDefinition().getChild(name));\n \t\t\t}\n \t\t\t// else check all children like below\n \t\t}\n \t\t\n \t\t// determine all children\n \t\tCollection<? extends ChildDefinition<?>> children = DefinitionUtil.getAllChildren(currentGroup.getDefinition());\n \t\n \t\t// check cardinality of children\n \t\tfor (ChildDefinition<?> childDef : children) {\n \t\t\tif (isValidCardinality(currentGroup, childDef)) { //XXX is this correct?! should it be !isValid... instead?\n \t\t\t\treturn false;\n \t\t\t}\n \t\t}\n \t\t\n \t\treturn true;\n \t}", "public boolean groupSpecified() {\n return group != null && !group.isEmpty();\n }", "private boolean canSelectCurWorldType() {\n WorldType worldtype = WorldType.WORLD_TYPES[this.selectedIndex];\n if (worldtype != null && worldtype.canBeCreated()) {\n return worldtype == WorldType.DEBUG_ALL_BLOCK_STATES ? hasShiftDown() : true;\n } else {\n return false;\n }\n }", "public boolean isExpand(){\n return this == EXPAND;\n }", "public void setIncludeSubGroups(java.lang.Boolean value);", "public boolean isFilterByGroup()\r\n {\r\n return getSemanticObject().getBooleanProperty(swpres_filterByGroup);\r\n }", "boolean isCollapsed();", "boolean getIsMainFrame();", "public boolean isMaster();", "public boolean isMenor() {\r\n\t\treturn edad < LIMITE_EDAD;\r\n\t}", "public boolean setLightForGroupingUnassigned() {\n Log.i(tag, \"setLightForGroupingUnassigned\");\n if (this.groups.isEmpty()) {\n this.groups.add(new LinkedList());\n }\n if (this.lightForGrouping.getGroupNumber() == 0) {\n Log.i(tag, \"already unassigned, dont do anything\");\n } else {\n LinkedList<Light> groupToRemove = null;\n boolean afterFirstGroup = false;\n Iterator it = this.groups.iterator();\n while (it.hasNext()) {\n LinkedList<Light> group = (LinkedList) it.next();\n group.remove(this.lightForGrouping);\n if (afterFirstGroup && group.isEmpty()) {\n groupToRemove = group;\n }\n afterFirstGroup = true;\n }\n if (groupToRemove != null) {\n Log.i(tag, \"removed group \");\n this.groups.remove(groupToRemove);\n }\n this.lightForGrouping.setGroupName(\"unassigned\", false);\n this.lightForGrouping.setGroupNumber(0, false);\n if (!((LinkedList) this.groups.get(0)).isEmpty() && ((Light) ((LinkedList) this.groups.get(0)).get(0)).getGroupNumber() != 0) {\n this.groups.addFirst(new LinkedList());\n }\n if (this.lightForGrouping instanceof DreamScreen) {\n ((LinkedList) this.groups.getFirst()).addFirst(this.lightForGrouping);\n } else {\n ((LinkedList) this.groups.getFirst()).add(this.lightForGrouping);\n }\n if (this.currentLight == this.lightForGrouping && this.broadcastingToGroup) {\n this.broadcastingToGroup = false;\n setToolbarTitle();\n }\n redrawDrawerLinearLayout();\n highlightDrawerSelection();\n if ((this.currentLight instanceof SideKick) || (this.currentLight instanceof Connect)) {\n Fragment currentFragment = getSupportFragmentManager().findFragmentById(R.id.frameLayout);\n if (currentFragment instanceof DreamScreenFragment) {\n ((DreamScreenFragment) currentFragment).redrawFragment();\n }\n }\n }\n return true;\n }", "@JsonIgnore\n public boolean isTargetGroupConfigSet() { return isSet.contains(\"targetGroupConfig\"); }", "public boolean winState() {\n\t\treturn this.numTargets == this.onTargets;\n\t}", "boolean hasParentalStatus();", "boolean beforeMasterSelectionChange();", "public boolean isRootVisible()\n {\n return rootVisible;\n }", "public boolean isRootVisible()\n {\n return rootVisible;\n }" ]
[ "0.66541064", "0.63936234", "0.62259835", "0.61937904", "0.61193955", "0.60991925", "0.6021284", "0.6021284", "0.5978155", "0.59466136", "0.59396887", "0.5923716", "0.5922976", "0.59166807", "0.5895382", "0.5895382", "0.5895382", "0.5895382", "0.5892066", "0.5854717", "0.5819128", "0.5795104", "0.579289", "0.5774185", "0.5764856", "0.57354397", "0.57172", "0.5699104", "0.568338", "0.56544966", "0.56496", "0.5648527", "0.5644789", "0.56406844", "0.56160986", "0.56160986", "0.56001264", "0.5594785", "0.5584762", "0.5580397", "0.55541396", "0.55541396", "0.55250186", "0.5519934", "0.550973", "0.550973", "0.55087346", "0.55087346", "0.55087346", "0.55087346", "0.550532", "0.5494333", "0.54586446", "0.5449587", "0.5443602", "0.54245424", "0.5422969", "0.5417448", "0.5413192", "0.54041374", "0.53965133", "0.53960043", "0.53940076", "0.53920937", "0.5375812", "0.53751457", "0.5368218", "0.53532255", "0.5349431", "0.532955", "0.53291595", "0.53250355", "0.5314259", "0.53087044", "0.5304293", "0.5302392", "0.530053", "0.5293483", "0.52609026", "0.5258436", "0.5257162", "0.5255414", "0.52517", "0.5238569", "0.5236993", "0.5234986", "0.522827", "0.5228115", "0.52267194", "0.52264404", "0.52263993", "0.5214368", "0.5213204", "0.5212259", "0.5207123", "0.51951504", "0.51943564", "0.519083", "0.5175009", "0.5175009" ]
0.5793344
22
A place holder for data objects
final public void setDataObject(Object _object) { this.dataObject = _object; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Data() {}", "Object getData();", "Object getData();", "@Override\r\n\tprotected Object getData() {\n\t\treturn null;\r\n\t}", "public abstract Object getData();", "protected abstract D createData();", "public Data() {\n this.customers = new HashMap<>();\n this.orders = new HashMap<>();\n this.siteVisits = new HashMap<>();\n this.imageUploads = new HashMap<>();\n }", "public Data() {\n }", "public Data() {\n }", "@Override\n protected void initData() {\n }", "@Override\n protected void initData() {\n }", "@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}", "public Data() {\n \n }", "@Override\r\n\tpublic void initData() {\n\t}", "@Override\n\tpublic void initData() {\n\n\n\n\t}", "private void initData() {\n }", "@Override\n\tpublic void initData() {\n\n\t}", "@Override\n\tpublic void initData() {\n\n\t}", "@Override\n\tpublic void initData() {\n\n\t}", "private void initData() {\n\t}", "public Object getData();", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "public interface Data {\n\t/* nothing special at the moment */\n}", "private Noder(E data) {\n this.data = data;\n }", "@Override\n\tpublic void initData() {\n\t\t\n\t}", "private void initData() {\n\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "public void initData() {\n }", "public void initData() {\n }", "void setData(Object data);", "protected @Override\r\n abstract void initData();", "private void InitData() {\n\t}", "public interface Data extends Bookmarkable, Closeable {\n\n /**\n * Returns custom metadata that will be available to processor with prefix 'c_'.\n */\n Map<String, String> getCustomMetadata();\n\n /**\n * Identifies type of data in {@link Data#getInputStream()}. Typically it will be a string including provider type and\n * data type - i.e 'ALM/tests'. A result processor will be selected based on the data type.\n */\n @NotNull\n String getDataType();\n\n /**\n * MIME type value (i.e application/xml, text/plain).\n */\n @NotNull\n String getMimeType();\n\n /**\n * Returns charset of the content. If the content is binary then returns null.\n */\n String getCharset();\n\n /**\n * Returns input stream for reading data. The data may be binary, textual etc. Its content type is identified by\n * {@link Data#getMimeType()}.\n */\n @NotNull\n InputStream getInputStream() throws IOException;\n}", "void setData (Object data);", "PersistentDataHolder getDataHolder();", "private ProcessedDynamicData( ) {\r\n super();\r\n }", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "interface Data {\n}", "public PollData() {\n\n\n super(TYPE_NAME);\n }", "public mainData() {\n }", "@Override\n\tpublic void getData() {\n\t\t\n\t}", "Object getData() { /* package access */\n\t\treturn data;\n\t}", "public Object getDataObject() {\n return dataObject;\n }", "public void setData(Object o){}", "abstract public Object getUserData();", "@Override\n\tprotected void initdata() {\n\n\t}", "public Object getData() \n {\n return data;\n }", "protected UserWordData() {\n\n\t}", "@Override\r\n\tprotected void setData(Object data) {\n\t\t\r\n\t}", "protected DataHolder() {\n\t\tthis.contests = new TreeMap<>();\n\t}", "private void initData(){\n\n }", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "@Override\n\tprotected void initData(){\n\t\tsuper.initData();\n\t}", "public void InitData() {\n }", "public interface Data {\n\n int DATA_TYPE_HEADER = 1;\n int DATA_TYPE_ITEM = 2;\n\n String getData();\n void setData(String data);\n int getDataType();\n long getTime();\n}", "public void setData(Object oData) { m_oData = oData; }", "protected abstract Object[] getData();", "CreationData creationData();", "public interface DataView {\n\n /**\n * The name of the data store.\n * \n * @return\n */\n String getName();\n\n /**\n * Returns the value mapped to the given key.\n * \n * @param key\n * @return\n */\n <T> T getValue(DataKey<T> key);\n\n Object getValueRaw(String id);\n\n Collection<DataKey<?>> getDataKeysWithValues();\n\n Collection<String> getKeysWithValues();\n\n default Object getValueRaw(DataKey<?> key) {\n return getValueRaw(key.getName());\n }\n\n /**\n * \n * @param key\n * @return true if the store contains a value for the given key\n */\n <T> boolean hasValue(DataKey<T> key);\n\n /**\n * \n * @return the objects mapped to the key ids\n */\n // Map<String, Object> getValuesMap();\n\n public static DataView newInstance(DataStore dataStore) {\n return new DefaultCleanSetup(dataStore);\n }\n\n public static DataView empty() {\n return new DataView() {\n\n @Override\n public <T> T getValue(DataKey<T> key) {\n return null;\n }\n\n @Override\n public String getName() {\n return \"<empty>\";\n }\n\n // @Override\n // public Map<String, Object> getValuesMap() {\n // return Collections.emptyMap();\n // }\n\n @Override\n public <T> boolean hasValue(DataKey<T> key) {\n return false;\n }\n\n @Override\n public Object getValueRaw(String id) {\n return null;\n }\n\n @Override\n public Collection<DataKey<?>> getDataKeysWithValues() {\n return Collections.emptyList();\n }\n\n @Override\n public Collection<String> getKeysWithValues() {\n return Collections.emptyList();\n }\n };\n }\n\n default DataStore toDataStore() {\n return DataStore.newInstance(this);\n }\n}", "private TigerData() {\n initFields();\n }", "DataList createDataList();", "public DesastreData() { //\r\n\t}", "public boolean isData() {return true; }", "@Override\n protected Object[] getData() {\n return new Object[] { creator };\n }", "public CreateData() {\n\t\t\n\t\t// TODO Auto-generated constructor stub\n\t}", "public InitialData(){}", "@Override\n public String getData()\n {\n return null;\n }", "DataHRecordData() {}", "T getData();", "void initData() {\r\n\t\tthis.daVinci = new Artist(\"da Vinci\");\r\n\t\tthis.mona = new Painting(daVinci, \"Mona Lisa\");\r\n\t\t//this.lastSupper = new Painting(this.daVinci, \"Last Supper\");\r\n\t}", "public abstract Object getCustomData();", "public Object create( DataWrapper data) {\n return LoadManager.getItem(data.getString(\"type\"),data.getName());\n }", "public void Data(){\n\t\t\t\t\t\t\n\t\t\t\t\t}", "@Override\n\tpublic Data getDataModelVariables() {\n\t\treturn new Data();\n\t}", "DataElement createDataElement();", "public T caseData(Data object)\n {\n return null;\n }", "public ArticleData() {\r\n\t\tid = Constants.EMPTY_STRING;\r\n\t\tname = Constants.EMPTY_STRING;\r\n\t\turl = Constants.EMPTY_STRING;\r\n\t\tdesc = Constants.EMPTY_STRING;\r\n\t\tlevels = Constants.EMPTY_STRING;\r\n\t\twebSiteId = Constants.EMPTY_STRING;\r\n\t\tmatched = Constants.EMPTY_STRING;\r\n\t\tcreateBy = Constants.EMPTY_STRING;\r\n\t\tcreateDate = Constants.EMPTY_STRING;\r\n\t\tlastUpdateBy = Constants.EMPTY_STRING;\r\n\t\tlastUpdateDate = Constants.EMPTY_STRING;\r\n\t\tenabled = Constants.EMPTY_STRING;\r\n\t\tpostTableName = Constants.EMPTY_STRING;\r\n\t\treturnPage = Constants.EMPTY_STRING;\r\n\t\twebSiteShowName = Constants.EMPTY_STRING;\r\n\t\treturnDirect = Constants.EMPTY_STRING;\r\n\t\tkeyWordTableName = Constants.EMPTY_STRING;\r\n\t\ttitle = Constants.EMPTY_STRING;\r\n\t\ttitleCounter = Constants.EMPTY_STRING;\r\n\t\tbufferStartCounter = Constants.EMPTY_STRING;\r\n\t\tbufferEndCounter = Constants.EMPTY_STRING;\r\n\t\tcatId = Constants.EMPTY_STRING;\r\n\t\tpostUrl = Constants.EMPTY_STRING;\r\n\t}", "public ListingData() {\r\n\t\tsuper();\r\n\t}", "void initData(){\n }", "abstract void initializeNeededData();", "private DataCache() {\n this.people = new HashMap<>();\n this.events = new HashMap<>();\n this.personEvents = new HashMap<>();\n this.currentPersonEvents = new HashMap<>();\n this.eventTypes = new ArrayList<>();\n this.childrenMap = new HashMap<>();\n this.maleSpouse = new HashSet<>();\n this.femaleSpouse = new HashSet<>();\n this.paternalAncestorsMales = new HashSet<>();\n this.paternalAncestorsFemales = new HashSet<>();\n this.maternalAncestorsMales = new HashSet<>();\n this.maternalAncestorsFemales = new HashSet<>();\n }", "Collection getData();", "public ChartData() {\n this.labels = new ArrayList<>();\n this.labelsDataMap = new HashMap<>();\n this.legend = new ArrayList<>();\n }", "@SuppressWarnings(\"static-access\")\n\tprivate void initData() {\n\t\tstartDate = startDate.now();\n\t\tendDate = endDate.now();\n\t}", "DataObject(int datasetid, YailList fields, YailList data) {\n this.name = \"\";\n this.fields = fields;\n this.data = data;\n this.path = \"\";\n this.datasetid = datasetid;\n }", "T getData() {\n\t\treturn data;\n\t}", "public DesignADataStructure() {\n arr = new ArrayList<>();\n map = new HashMap<>();\n }", "public void initData(){\r\n \r\n }", "public Object getUserData();", "public T getData() {\n return null;\n }", "public void setData(Object data) {\r\n this.data = data;\r\n }", "private DataObject(Builder builder) {\n super(builder);\n }", "public FlexData() {\n entryCollectionList = null;\n entryCollectionMap = null;\n type = Type.UNKNOWN;\n standardDateFormat = \"yyyy-MM-dd\"; // DB2-Datum\n\t}", "DataTypeInstance getDataInstance();" ]
[ "0.69223017", "0.6782099", "0.6782099", "0.6771676", "0.67384326", "0.66431606", "0.66364455", "0.6535918", "0.6535918", "0.6504916", "0.6504916", "0.64896834", "0.64896834", "0.64896834", "0.64896834", "0.64896834", "0.64896834", "0.6486317", "0.64582384", "0.64388525", "0.64094174", "0.6407829", "0.6407829", "0.6407829", "0.64039963", "0.6400415", "0.6391021", "0.6391021", "0.6379767", "0.63780695", "0.63762623", "0.63614154", "0.6357124", "0.6353802", "0.634273", "0.634273", "0.6332877", "0.63157874", "0.6315379", "0.6310859", "0.63006", "0.62970024", "0.62863576", "0.6278208", "0.6258719", "0.6254967", "0.6250645", "0.622922", "0.6228914", "0.6225994", "0.6211966", "0.6211269", "0.6199419", "0.6179849", "0.6167941", "0.61627537", "0.6159508", "0.6157582", "0.6150411", "0.614852", "0.61381555", "0.61294246", "0.6126559", "0.6123907", "0.6123077", "0.61137104", "0.6109277", "0.61085814", "0.6093493", "0.60906476", "0.6062403", "0.60522383", "0.6048763", "0.6046285", "0.60404223", "0.60392433", "0.60311395", "0.6030538", "0.6017055", "0.60118294", "0.60106933", "0.600366", "0.6001872", "0.6001482", "0.5986097", "0.5979805", "0.59776556", "0.5971986", "0.5969271", "0.5960593", "0.59567684", "0.59530747", "0.5933729", "0.5933158", "0.5931586", "0.5924005", "0.5918653", "0.5918251", "0.59124374", "0.5898737", "0.589295" ]
0.0
-1
Returns the data object
final public Object getDataObject() { return this.dataObject; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Object getData() { /* package access */\n\t\treturn data;\n\t}", "Object getData();", "Object getData();", "public Object getData() \n {\n return data;\n }", "public Object getDataObject() {\n return dataObject;\n }", "public Object getData()\r\n\t\t{\r\n\t\t\treturn data;\r\n\t\t}", "T getData() {\n\t\treturn data;\n\t}", "public Object getData();", "public Object getData(){\n\t\treturn this.data;\n\t}", "public Object getData() {\r\n\t\t\treturn data;\r\n\t\t}", "T getObject() {\n\t\t\treturn data;\n\t\t}", "public Object getData() {\n\t\treturn data;\n\t}", "public Data getData() {\n return data;\n }", "public Data getData() {\n return data;\n }", "public T getData() {\r\n return data;\r\n }", "public D getData(){\n\t\treturn data;\n\t}", "public Object data() {\n return this.data;\n }", "public synchronized Object getData() {\n return data;\n }", "Object getRawData();", "public T getData(){\n return this.data;\n }", "public abstract Object getData();", "public T getData()\n\t{ \treturn this.data; }", "public T getData() {\n return mData;\n }", "public D getData() {\n return data;\n }", "public D getData() {\n return data;\n }", "@Override\r\n\t\tpublic Meta_data getData() {\n\t\t\treturn this.data;\r\n\t\t}", "public IData getData() {\n return data;\n }", "public T getData()\n\t{\n\t\treturn this.data;\n\t}", "public T getData() {\n return this.data;\n }", "public A getData()\n\t{\n\t\treturn data;\n\t}", "T getData();", "public Object getData() {\n return dataArray;\n }", "public Object getDataObject()\r\n {\r\n return stockData;\r\n }", "public DataItem getData() {\n return data;\n }", "Collection getData();", "public E getData(){\n\t\t\treturn data;\n\t\t}", "public String getData()\n {\n return data;\n }", "T getData() {\n return this.data;\n }", "public E getData() { return data; }", "protected abstract Object[] getData();", "public E getData()\n {\n return data;\n }", "public E getData()\n {\n return data;\n }", "public String getData() {\n\treturn data;\n }", "Object getCurrentData();", "public K data()\n {\n\treturn this.data;\n }", "public String getData() {\r\n return Data;\r\n }", "public String getData() {\r\n return Data;\r\n }", "public String getData() {\n return data;\n }", "public String getData() {\n return data;\n }", "public String getData() {\n return data;\n }", "public String getData() {\n return data;\n }", "public String getData()\n\t{\n\t\treturn data;\n\t}", "public T getData() {\r\n\t\t\treturn t;\r\n\t\t}", "public List<Data> getData() {\n return data;\n }", "public E getData() {\r\n\t\treturn data;\r\n\t}", "public E getData() {\n return data;\n }", "java.lang.String getData();", "public String getData() {\r\n return this.data;\r\n }", "@Override\n public FlotillaData getData() {\n FlotillaData data = new FlotillaData();\n data.setName(name);\n data.setLocation(reference);\n data.setBoats(getBoatNames(boats));\n\n return data;\n }", "public Map<String, Object> getData() {\n\t\treturn this.data;\n\t}", "String getData();", "@Override\n public Object getData() {\n return outputData;\n }", "public T getData() {\n return null;\n }", "public java.util.List getData() {\r\n return data;\r\n }", "public String getData() {\r\n\t\treturn data;\r\n\t}", "public abstract Object getCustomData();", "public Object getData() { return funcData; }", "public java.lang.String getData() {\r\n return data;\r\n }", "public String getData() {\n\t\treturn data;\n\t}", "public String getData() {\n\t\treturn data;\n\t}", "public String getData() {\n\t\treturn data;\n\t}", "public String getData() {\n\t\treturn data;\n\t}", "@ApiStatus.Internal\n @NotNull\n public Map<String, Object> getData() {\n return data;\n }", "public String getData() {\r\n\t\t\treturn data;\r\n\t\t}", "@Override\r\n\tpublic E getData() {\n\t\treturn data;\r\n\t}", "@Override\r\n\tprotected Object getData() {\n\t\treturn null;\r\n\t}", "public PData getData() {\n\t\treturn data;\n\t}", "Object firstData() {\n\t\t// por defecto enviamos null\n\t\treturn null;\n\t}", "@java.lang.Override\n public com.clarifai.grpc.api.Data getData() {\n return data_ == null ? com.clarifai.grpc.api.Data.getDefaultInstance() : data_;\n }", "public G getData (){\n return this._data;\n }", "public LinkedHashMap<Integer, Data> getData(){\r\n\t\treturn data;\r\n\t}", "public byte[] getObjectdata()\n {\n return null;\n }", "public BaseData[] getData()\n {\n return Cdata;\n }", "public LiveData<DataEntry> getData() {\n return data;\n }", "public String getData() {\n\t\treturn this.data;\n\t}", "public String data() {\n return this.data;\n }", "public static Instances getData()\n {\n return data;\n }", "public IData getStoreddata();", "public Object getUserData();", "public Object getUserData() {\n return userData;\n }", "public JavaScriptObject getData() {\n\t return getDataImpl(getUrl(), getRealHeight(), getRealWidth());\n }", "public GenericItemType getData() {\n return this.data;\n }", "byte[] getData() {\n return data;\n }", "public final HashMap<Integer, T> getData() {\n\t\treturn this.data;\n\t}", "public T value()\r\n {\r\n return data;\r\n }", "private Data readFromFileData() {//Context context) {\n try {\n FileInputStream fileInputStream = openFileInput(fileNameData);\n ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream);\n Data.userData = (Data) objectInputStream.readObject();\n objectInputStream.close();\n fileInputStream.close();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n }\n return Data.userData;\n }", "@java.lang.Override\n public godot.wire.Wire.Value getData() {\n return data_ == null ? godot.wire.Wire.Value.getDefaultInstance() : data_;\n }", "@Override\n\tpublic HashMap<String, String> getData() {\n\t\treturn dataSourceApi.getData();\n\t}", "public HashMap<Long, String> getData() {\n\t\treturn data;\n\t}", "public DataModel getData() {\r\n state = PersistentFacesState.getInstance();\r\n if (onePageDataModel == null) {\r\n onePageDataModel = new LocalDataModel(pageSize);\r\n }\r\n return onePageDataModel;\r\n }" ]
[ "0.82981426", "0.80925435", "0.80925435", "0.8059419", "0.79974276", "0.79907876", "0.7931871", "0.7922888", "0.79104793", "0.78477436", "0.7825252", "0.78097343", "0.7697951", "0.7697951", "0.76928955", "0.7661681", "0.76461476", "0.76000273", "0.7562558", "0.7529465", "0.75275874", "0.7511443", "0.7494203", "0.74884504", "0.74884504", "0.74864936", "0.74781317", "0.74594986", "0.74286747", "0.7361361", "0.73514277", "0.73430467", "0.7339612", "0.73313344", "0.7303664", "0.7299947", "0.72862804", "0.7284959", "0.72516793", "0.72503364", "0.7199483", "0.7199483", "0.7178707", "0.71604145", "0.71315193", "0.7116138", "0.7116138", "0.71022797", "0.71022797", "0.71022797", "0.71022797", "0.7098644", "0.7089251", "0.7087192", "0.7059223", "0.70336515", "0.70320046", "0.70272064", "0.70191383", "0.7016401", "0.70152086", "0.7014443", "0.70097655", "0.69939995", "0.6972491", "0.6969112", "0.6968506", "0.6956681", "0.69507617", "0.69507617", "0.69507617", "0.69507617", "0.6949315", "0.694406", "0.6941325", "0.6929459", "0.6913289", "0.6907624", "0.6878732", "0.6863656", "0.68502164", "0.68474287", "0.6840987", "0.68330264", "0.68281597", "0.68277764", "0.68182164", "0.6797841", "0.6797263", "0.6792721", "0.6791145", "0.67868316", "0.6784996", "0.6774165", "0.6746597", "0.67442244", "0.6740009", "0.6729104", "0.67239153", "0.67172337" ]
0.76839316
15
Can't instantiate this class. D O N O T C H A N G E T H I S C O N S T R U C T O R
private Selector() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Instantiation(){}", "Reproducible newInstance();", "protected abstract void construct();", "private ATCres() {\r\n // prevent to instantiate this class\r\n }", "private Rekenhulp()\n\t{\n\t}", "public OOP_207(){\n\n }", "public _355() {\n\n }", "public ClassTemplate() {\n\t}", "private TMCourse() {\n\t}", "private MApi() {}", "private LOCFacade() {\r\n\r\n\t}", "@Override\r\n public void instantiate() {\r\n }", "Constructor() {\r\n\t\t \r\n\t }", "private ObjectFactory() { }", "public Pitonyak_09_02() {\r\n }", "public IncorrectType58119e() {\n }", "private Ex() {\n }", "private StickFactory() {\n\t}", "public AbstractT602()\n {\n }", "private SupplierLoaderUtil() {\n\t}", "private ClassUtil() {}", "private SingleObject()\r\n {\r\n }", "private MetallicityUtils() {\n\t\t\n\t}", "private Example() {\n\t\tthrow new Error(\"no instantiation is permitted\");\n\t}", "private InstanceUtil() {\n }", "private PerksFactory() {\n\n\t}", "public Constructor(){\n\t\t\n\t}", "private Topography()\n\t{\n\t\tthrow new IllegalStateException(\"This is an utility class, it can not be instantiated\");\n\t}", "private DiagnosticMessageUtilities()\n {\n }", "protected IPCGCallDetailCreator()\r\n {\r\n // empty\r\n }", "private ClassProxy() {\n }", "private ErrorFactory() {\r\n\t}", "private FlowExecutorUtils()\r\n {\r\n // Private constructor to prevent instantiation\r\n }", "public Clade() {}", "public DetArqueoRunt () {\r\n\r\n }", "private ResourceFactory() {\r\n\t}", "private Utils()\n {\n // Private constructor to prevent instantiation\n }", "private Singleton()\n\t\t{\n\t\t}", "public ParameterizedInstantiateFactory() {\r\n super();\r\n }", "private void __sep__Constructors__() {}", "private SIModule(){}", "private HYCOM() {\n }", "private UnitFactory() {\n\t}", "private PropertiesLoader() {\r\n\t\t// not instantiable\r\n\t}", "private OMUtil() { }", "public ObjectFactory() {\n\t}", "public CyanSus() {\n\n }", "private Template() {\r\n\r\n }", "private ClientLoader() {\r\n }", "defaultConstructor(){}", "public Instance() {\n }", "private SpTreeMan() {\n }", "private SingleTon() {\n\t}", "private Driver() {\n\n }", "public ObjectFactory() {\r\n\t}", "private XMLUtils()\r\n\t{\r\n\t}", "private UtilityKlasse() {\n\n }", "private Infer() {\n\n }", "private Object createInstance() throws InstantiationException, IllegalAccessException {\n\t\treturn classType.newInstance();\n\t}", "public Libro() {\r\n }", "private ClinicFileLoader() {\n\t}", "public Activator() {\r\n\t}", "private MigrationInstantiationUtil() {\n\t\tthrow new IllegalAccessError();\n\t}", "private TemplateFactory(){\n //AssertionError不是必须的. 但它可以避免不小心在类的内部调用构造器. 保证该类在任何情况下都不会被实例化.\n //see 《Effective Java》 2nd\n throw new AssertionError(\"No \" + getClass().getName() + \" instances for you!\");\n }", "private NativeSupport() {\n\t}", "private Engine() {\n\n }", "private Utils() {}", "private Utils() {}", "private Utils() {}", "private Utils() {}", "private TAPosition()\n {\n\n }", "private TweetRiver() { }", "protected Doodler() {\n\t}", "private Marinator() {\n }", "private Marinator() {\n }", "public Pleasure() {\r\n\t\t}", "private Utils() {\n\t}", "private Utils() {\n\t}", "public AbstractClass() { //Sobrecarga del constructor AbstractClass ya que se puede inicializar de 2 maneras\n }", "public Implementor(){}", "private JadTool() { }", "private EagerlySinleton()\n\t{\n\t}", "private AcceleoLibrariesEclipseUtil() {\n \t\t// hides constructor\n \t}", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }" ]
[ "0.7391005", "0.7227207", "0.6920283", "0.6918742", "0.69048846", "0.6843297", "0.6736005", "0.6732639", "0.66924715", "0.6676213", "0.6658539", "0.6643021", "0.66346836", "0.6633064", "0.6622393", "0.66106945", "0.659209", "0.65846056", "0.65680736", "0.6532218", "0.6513464", "0.6507548", "0.6506175", "0.6503394", "0.6501031", "0.6497588", "0.6491041", "0.64785624", "0.64739275", "0.6450785", "0.64442366", "0.6440177", "0.64338106", "0.6426387", "0.64191204", "0.6418846", "0.6417647", "0.6417089", "0.6415717", "0.64083296", "0.6398239", "0.6385615", "0.637962", "0.63715994", "0.63673747", "0.63590175", "0.63566315", "0.63325167", "0.63267237", "0.63263124", "0.6323601", "0.63224643", "0.63198113", "0.6318464", "0.63170695", "0.63120663", "0.63113385", "0.63103056", "0.63063896", "0.63041866", "0.6302144", "0.6296783", "0.6292296", "0.6291152", "0.6289275", "0.62882876", "0.62829125", "0.62829125", "0.62829125", "0.62829125", "0.6282103", "0.6281112", "0.62699956", "0.6269367", "0.6269367", "0.626656", "0.62647915", "0.62647915", "0.62644005", "0.6260676", "0.62516236", "0.62502104", "0.6241373", "0.6232172", "0.6232172", "0.6232172", "0.6232172", "0.6232172", "0.6232172", "0.6232172", "0.6232172", "0.6232172", "0.6232172", "0.6232172", "0.6232172", "0.6232172", "0.6232172", "0.6232172", "0.6232172", "0.6232172", "0.6232172" ]
0.0
-1
Selects the minimum value from the array a. This method throws IllegalArgumentException if a is null or has zero length. The array a is not changed by this method.
public static <T> T min(Collection<T> c, Comparator<T> comp) { // Check input for null. if (c == null || comp == null) { throw new IllegalArgumentException(); } // Check if input is empty. if (c.isEmpty()) { throw new NoSuchElementException(); } // Generalize the min method. Iterator<T> itr = c.iterator(); T min = itr.next(); while (itr.hasNext()) { // Hold the value for the time being. T hold = itr.next(); if (comp.compare(hold, min) < 0) { min = hold; } } return min; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int min(int[] a) throws IllegalArgumentException {\n if (a == null || a.length == 0) {\n throw new IllegalArgumentException();\n }\n int min = a[0];\n \n if (a.length > 1) {\n for (int i = 1; i < a.length; i++) {\n if (a[i] < min) {\n min = a[i];\n }\n }\n }\n return min;\n }", "public static int min(int[] a){\r\n\t\tint m = a[0];\r\n\t\tfor( int i=1; i<a.length; i++ )\r\n if( m > a[i] ) m = a[i];\r\n\t\treturn m;\r\n\t}", "private static void min(int[] a) {\n int min = a[0];\n for(int i=1; i<a.length; i++){\n if(min > a[i]){\n min = a[i];\n }\n }\n System.out.println(\"Min\" + min);\n\n }", "public static int min(int a, int... vals) {\n\t\tint minVal = a;\n\t\tfor (int v : vals) {\n\t\t\tif (v < minVal) {\n\t\t\t\tminVal = v;\n\t\t\t}\n\t\t}\n\t\treturn minVal;\n\t}", "public static float min(float a, float... vals) {\n\t\tfloat minVal = a;\n\t\tfor (float v : vals) {\n\t\t\tif (v < minVal) {\n\t\t\t\tminVal = v;\n\t\t\t}\n\t\t}\n\t\treturn minVal;\n\t}", "private static int indexOfSmallest(int[] a, int start) {\n int minNum = a[start];\n int minIndex = start;\n for(int i=start; i<a.length; i++){\n if(a[i]<minNum){\n minNum = a[i];\n minIndex = i;\n }\n\n }\n return minIndex;\n }", "public long min() {\n\t\tif (!this.isEmpty()) {\n\t\t\tlong result = theElements[0];\n\t\t\tfor (int i=1; i<numElements; i++) {\n\t\t\t\tif (theElements[i] < result) {\n\t\t\t\t\tresult = theElements[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\telse {\n\t\t\tthrow new RuntimeException(\"Attempted to find min of empty array\");\n\t\t}\n\t}", "public static double min(double a, double... vals) {\n\t\tdouble minVal = a;\n\t\tfor (double v : vals) {\n\t\t\tif (v < minVal) {\n\t\t\t\tminVal = v;\n\t\t\t}\n\t\t}\n\t\treturn minVal;\n\t}", "public int min()\n\t{\n\t\tif (arraySize > 0)\n\t\t{\n\t\t\tint minNumber = array[0];\n\t\t\tfor (int index = 0; index < arraySize; index++) \n\t\t\t{\n\t\t\t\tif (array[index] < minNumber)\n\t\t\t\t{\n\t\t\t\t\tminNumber = array[index];\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\treturn minNumber;\n\t\t}\n\t\tSystem.out.println(\"Syntax error, array is empty.\");\n\t\treturn -1;\n\n\t}", "public static void selectionSort(int[] a) \n {\n for (int i = 0; i < a.length; i++) \n {\n int minPos = minimumPosition(a, i);\n swap(a, minPos, i);\n }\n }", "public static void selectionSort(Comparable[] a) {\n int n = a.length;\n int im;\n for (int i = 0; i < n; i++) {\n im = i;\n for (int j = im; j < n; j++) {\n // Find the min\n if (less(a[j], a[im])) im = j;\n if (i != im) exch(a, i, im);\n }\n }\n }", "public static void selectionSort(int[] a) {\r\n int temp; // catalyst variable for Integer swapping\r\n int spot; //location in array where minimum will be inserted\r\n int minimum; //location of minimum value in remainder\r\n\r\n for (spot = 0; spot < a.length - 1; spot++) {\r\n minimum = spot; //\r\n for (int i = spot + 1; i < a.length; i++) {\r\n if (a[i] < a[minimum]) {\r\n minimum = i; //if i is less than minimum, i is new minimum\r\n }\r\n }//end for i\r\n\r\n //swap a[spot] and a[minimum]\r\n temp = a[minimum];\r\n a[minimum] = a[spot];\r\n a[spot] = temp;\r\n }//end for spot\r\n }", "public static int getMin(int[] inputArray){\n int minValue = inputArray[0];\n for(int i=1; i<inputArray.length;i++){\n if(inputArray[i] < minValue){\n minValue=inputArray[i];\n }\n }\n return minValue;\n }", "public T findLowest(){\n T lowest = array[0]; \n for (int i=0;i<array.length; i++)\n {\n if (array[i].doubleValue()<lowest.doubleValue())\n {\n lowest = array[i]; \n } \n }\n return lowest;\n }", "private static int minimumPosition(int[] a, int from)\n {\n int minPos = from;\n for (int i = from + 1; i < a.length; i++) \n {\n if (a[i] < a[minPos]) { minPos = i; }\n }\n return minPos;\n }", "public static int kmin(int[] a, int k) throws IllegalArgumentException {\n if (ktest(a, k)) {\n throw new IllegalArgumentException();\n }\n int[] array = Arrays.copyOf(a, a.length);\n int increment = 1;\n int element;\n \n Arrays.sort(array);\n element = array[0];\n \n for (int i = 0; i < array.length; i++) {\n if (element < array[i]) {\n element = array[i];\n increment ++;\n }\n if (k == increment) {\n return element;\n }\n }\n throw new IllegalArgumentException();\n }", "public static double findMin(double[] da) {\n\n\t\t// fjern = \"0.0\" når metoden implementeres for ikke få forkert minimum\n\t\tdouble min = da[0];\n\t\t\n\t\t// TODO\n\t\t// OPPGAVE - START\n\t\tfor(double d : da) {\n\t\t\tif(d < min) {\n\t\t\t\tmin = d;\n\t\t\t}\n\t\t}\n\t\t// OPPGAVE - SLUT\n\t\treturn min;\n\t}", "public static int findMin (int [] A, int startIndex) {\n if (startIndex == A.length - 1) {\n return A[startIndex];\n } else {\n return Math.min(A[startIndex],\n findMin(A, startIndex + 1));\n }\n }", "public static int Min(int[] array) {\r\n\t\tint minValue = array[0];\r\n\t\tfor (int i = 1; i < array.length; i++) {\r\n\t\t\tif (array[i] < minValue) {\r\n\t\t\t\tminValue = array[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn minValue;\r\n\t}", "private static int getMin(int[] original) {\n int min =original[0];\n for(int i = 1; i < original.length; i++) {\n if(original[i] < min) min = original[i];\n }\n return min;\n }", "public double min(){\r\n\t\t//variable for min val\r\n\t\tdouble min = this.data[0];\r\n\t\t\r\n\t\tfor (int i = 1; i < this.data.length; i++){\r\n\t\t\t//if the minimum is more than the current index, change min to that value\r\n\t\t\tif (min > this.data[i]){\r\n\t\t\t\tmin = this.data[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\t//return the minimum val\r\n\t\treturn min;\r\n\t}", "public int minSelSort(int[] A) {\n int n = A.length;\n for(int i = 0; i < n - 1; i++) {\n int min = i;\n for(int j = i + 1; j < n; j++) {\n if (A[j] < A[min]) {\n min = j;\n minimum = min;\n }\n }\n }\n return minimum;\n }", "public int min(int[] array) {\n if (array == null || array.length == 0){\n return 0;\n }\n int min = array[0];\n for(int i = 0; i < array.length; i++){\n if (array[i] < min){\n min = array[i];\n }\n }\n return min;\n }", "public static int min(int[] array){\n \n if(array == null){\n \n throw new IllegalArgumentException(\"Array cannot be null\");\n }\n else if(array.length==0){\n throw new IllegalArgumentException(\"Array cannot be empty\");\n }\n \n int min = array[0];\n \n for(int i = 1; i < array.length; i++){\n \n \n if(array[i] < min){\n min = array[i];\n }\n }\n return min;\n }", "static double [] selectionSort (double a[]){\r\n \tif(a==null){\r\n \t\tSystem.out.print(\"Array empty\");\r\n \t\treturn null;\r\n \t}\r\n \tfor (int i =0; i<a.length-1;i++) {\r\n \t\tint minIndex = i;\r\n \t\tfor(int j =i+1; j<a.length ;j++) { //Find min element in unsorted array\r\n \t\t\tif(a[j]<a[minIndex]) {\r\n \t\t\t\tminIndex =j;\r\n \t\t\t}\r\n \t\t}\r\n \t\tdouble temp = a[minIndex]; //Swap min with first element \r\n \t\ta[minIndex]=a[i];\r\n \t\ta[i]=temp;\r\n \t}\r\n \treturn a;\r\n }", "@Override\n\tpublic T findMin(T[] ob) {\n\t\treturn null;\n\t}", "public static int findMin(int[] A) {\n\t\tint ans = 0;\n\t\tfor(int i=1; i<A.length; i++) {\n\t\t\tif(ans > A[i]) {\n\t\t\t\tans = A[i];\n\t\t\t}\n\t\t}\n\t\treturn ans;\n\t}", "public static int getMin(int[] array) {\n //TODO: write code here\n int min = array[0];\n for(int a : array) {\n min = a < min ? a : min;\n }\n return min;\n }", "public T getMin()\n\t{\n\t\tif(size == 0)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\treturn array[0];\n\t}", "public static float min(float [] array)\r\n\t{\r\n\t\tfloat minValue = array[0];\r\n\t\tfor (int i = 1; i < array.length; i++)\r\n\t\t{\r\n\t\t\tif (array[i] < minValue)\r\n\t\t\t{\r\n\t\t\t\tminValue = array[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn minValue;\r\n\t}", "public static float min(float[] array){\n \n if(array == null){\n \n throw new IllegalArgumentException(\"Array cannot be null\");\n }\n else if(array.length==0){\n throw new IllegalArgumentException(\"Array cannot be empty\");\n }\n \n float min = array[0];\n \n for(int i = 1; i < array.length; i++){\n \n if(Float.isNaN(array[i])){\n return Float.NaN;\n }\n if(array[i] < min){\n min = array[i];\n }\n }\n return min;\n }", "public int findMinimum(int[] numbers, int length)\n {\n }", "public static int findMinimum(int[] array) {\n if (array == null || array.length == 0) {\n return Integer.MIN_VALUE;\n }\n int left = 0;\n int right = array.length -1;\n int element = findPivot(array, left, right);\n return element;\n }", "private void regularMinDemo() {\n int min = numbers[0];\n for(int i = 1; i < numbers.length; i++) {\n if (numbers[i] < min) min = numbers[i];\n }\n System.out.println(min);\n }", "public static int findMin(){\n int min = array[0];\n for(int x = 1; x<array.length; x++ ){\n if(array[x]<min){\n min=array[x];\n }\n }\n return min;\n}", "public void minimum(int[] arr){\n int min = arr[0];\n for(int i = 1; i< arr.length-1; i++){ //why i = 1 means because we have already taken the arr[0] as minimum\n if(arr[i] < min){\n min = arr[i];\n }\n } \n System.out.println(\"The minimum Element in the array is : \"+min);\n }", "public static int min(int[] theArray) {\n\n //sets a starting value is used if use the alternative code.\n int smallest = theArray[0];\n\n //Converts the array to a list\n List<Integer> values = Arrays.stream(theArray).boxed().collect(Collectors.toList());\n\n Collections.min(values);\n\n //get the smallest by streaming the list and using min which gets the min value by using the Integer Comparator.comparing().\n //which means it will loop through the array and compare all the values for the smallest values\n smallest = values.stream().min(Integer::compare).get();\n\n ////Alternative code does the same thing.\n// for (int number : theArray) {\n//\n// if (smallest > number) {\n// smallest = number;\n// }\n// }\n\n return smallest;\n\n }", "public static int minIndex(int a, int b)\n {\n return (a < 0) ? b\n : (b < 0) ? a\n : Math.min(a, b);\n }", "private static void insertionSortSentinel(Comparable[] a) {\n Comparable min = Double.MAX_VALUE;\n int ind = 0;\n for (int i = 0; i < a.length; i++) {\n if (a[i].compareTo(min) < 0) {\n min = a[i];\n ind = i;\n }\n }\n\n Comparable temp = a[0];\n a[0] = a[ind];\n a[ind] = temp;\n\n for (int i = 1; i < a.length; i++) {\n for (int j = i; a[j].compareTo(a[j - 1]) < 0; j--) {\n temp = a[j - 1];\n a[j - 1] = a[j];\n a[j] = temp;\n }\n }\n }", "public static float min(final float[] data) {\r\n float min = Float.MAX_VALUE;\r\n for (final float element : data) {\r\n if (min > element) {\r\n min = element;\r\n }\r\n }\r\n return min;\r\n }", "public static int min(int[] values) throws MathsException {\r\n\t\tif(values.length < Integer.MIN_VALUE || values.length > Integer.MAX_VALUE)\r\n\t\t\tthrow new MathsException(\"Not ok\");\r\n\t\tint minimum = values[0];\r\n\t\tfor(int i=1;i<values.length;i++)\r\n\t\t\tif(minimum > values[i])\r\n\t\t\t\tminimum = values[i];\r\n\t\treturn minimum;\r\n\t}", "public static double min(double... values) {\n/* 86 */ Objects.requireNonNull(values, \"The specified value array must not be null.\");\n/* 87 */ if (values.length == 0) {\n/* 88 */ throw new IllegalArgumentException(\"The specified value array must contain at least one element.\");\n/* */ }\n/* 90 */ double min = Double.MAX_VALUE;\n/* 91 */ for (double value : values)\n/* 92 */ min = Math.min(value, min); \n/* 93 */ return min;\n/* */ }", "public static double min(double[] array) {\n\t\tif (array.length==0) return Double.POSITIVE_INFINITY;\n\t\tdouble re = array[0];\n\t\tfor (int i=1; i<array.length; i++)\n\t\t\tre = Math.min(re, array[i]);\n\t\treturn re;\n\t}", "private Double getMin(Double[] values) {\n Double ret = null;\n for (Double d: values) {\n if (d != null) ret = (ret == null) ? d : Math.min(d, ret);\n }\n return ret;\n }", "public static Point minmax (int[] a) {\n int n = a.length;\n Point mm = new Point (a[0], a[0]);\n\n for (int i=1; i<n; i++) {\n if (a[i] > mm.x) mm.x = a[i];\n if (a[i] < mm.y) mm.y = a[i];\n }\n return mm;\n }", "int min() {\n\t\t// added my sort method in the beginning to sort our array\n\t\tint n = array.length;\n\t\tint temp = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 1; j < (n - i); j++) {\n\t\t\t\tif (array[j - 1] > array[j]) {\n\t\t\t\t\ttemp = array[j - 1];\n\t\t\t\t\tarray[j - 1] = array[j];\n\t\t\t\t\tarray[j] = temp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// finds the first term in the array --> first term should be min if\n\t\t// sorted\n\t\tint x = array[0];\n\t\treturn x;\n\t}", "private int min(int a, int b) {\n\t\treturn a<b?a:b;\n\t}", "public static int[] minmax(int[] a)\n {\n \tint[] b= {0,0};\n \tint min=(int)1e9;\n \tint max=(int)-1e9;\n \tfor(int i=0;i<a.length;i++)\n \t{\n \t\tmin=Math.min(min, a[i]);\n \t\tmax=Math.max(max, a[i]);\n \t}\n \tb[0]=min;\n \tb[1]=max;\n \treturn b;\n }", "public static <T extends Comparable<? super T>> BST<T> minHeight(T[] a) {\n Check.nullCheck(a, \"item array\");\n for (T item : a) {\n Check.nullCheck(item, \"item\");\n }\n \n BST<T> bst = new BST<T>();\n minHeightHelper(bst, a, 0, a.length - 1);\n return bst;\n }", "int min(int... args) {\n\n if (args.length == 0) {\n throw new IllegalArgumentException(\"too few arguments\");\n }\n\n int min = args[0];\n\n for (int arg : args) {\n if (arg < min) {\n min = arg;\n }\n }\n return min;\n }", "private double min(double[] vector){\n if (vector.length == 0)\n throw new IllegalStateException();\n double min = Double.MAX_VALUE;\n for(double e : vector){\n if(!Double.isNaN(e) && e < min)\n min = e;\n }\n return min;\n }", "public static int min(int a, int b) {\t\n\t\treturn ((a<b)?a:b);\n\t}", "public static int minValue(int[] numArr) {\r\n\t\tint temp = numArr[0] < numArr[1] ? numArr[0] : numArr[1];\r\n\t\tfor (int i = 2; i < numArr.length; i++) {\r\n\t\t\ttemp = temp < numArr[i] ? temp : numArr[i];\r\n\t\t}\r\n\t\treturn temp;\r\n\t}", "private static int findMin(int startPos,int[] x){\n\t\tint result = startPos;\n\t\tfor(int i= startPos;i<x.length;i++){\n\t\t\tif(x[i]<x[result]){\n\t\t\t\tresult = i;\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "public static int min(int[] values) {\n return min(values, 0, values.length);\n }", "public static int argmin(double[] array) {\n\t\tdouble min = array[0];\n\t\tint re = 0;\n\t\tfor (int i=1; i<array.length; i++) {\n\t\t\tif (array[i]<min) {\n\t\t\t\tmin = array[i];\n\t\t\t\tre = i;\n\t\t\t}\n\t\t}\n\t\treturn re;\n\t}", "public T findMin();", "public E returnMinElement(){\r\n if (theData.size() <= 0) return null;\r\n\r\n E min = theData.get(0).getData();\r\n\r\n for (int i = 0; i< theData.size() ; i++){\r\n if (min.compareTo(theData.get(i).getData()) > 0 ){\r\n min = theData.get(i).getData();\r\n }\r\n }\r\n return min;\r\n }", "private static Key min(Key... ks) {\n\t\tif (ks == null || ks.length == 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tKey min = ks[0];\n\t\tfor (int i = 1; i < ks.length; i++) {\n\t\t\tif (ks[i].compareTo(min) < 0) {\n\t\t\t\tmin = ks[i];\n\t\t\t}\n\t\t}\n\t\treturn min;\n\t}", "private double getLowest()\n {\n if (currentSize == 0)\n {\n return 0;\n }\n else\n {\n double lowest = scores[0];\n for (int i = 1; i < currentSize; i++)\n {\n if (scores[i] < lowest)\n {\n scores[i] = lowest;\n }\n }\n return lowest;\n }\n }", "public AnyType findMin() {\n if (isEmpty())\n throw new UnderflowException();\n return root.element;\n }", "public int cariMinimum(int[] min) {\n\t\tint minimum = min[0];\n\t\tint jumlah = min.length;\n\t\tfor (int i = 0; i < jumlah; i++) {\n\t\t\tif (min[i] < minimum) {\n\t\t\t\tminimum = min[i];\n\t\t\t}\n\t\t}\n\t\treturn minimum;\n\t}", "static int min(int a, int b) { return a < b ? a : b; }", "private int getMin(int[] times) {\n\n\t\t//Initially set min to the first value\n\t\tint min = times[0];\n\n\t\t//Loop through all times in the array\n\t\tfor (int i = 0; i < times.length; i++) {\n\n\t\t\t//Set the minimum\n\t\t\tif (times[i]<min) {\n\n\t\t\t\tmin = times[i];\n\t\t\t}\n\t\t}\n\n\t\treturn min;\n\t}", "public static double min(double[]array){\n \n if(array == null){\n \n throw new IllegalArgumentException(\"Array cannot be null\");\n }\n else if(array.length==0){\n throw new IllegalArgumentException(\"Array cannot be empty\");\n }\n \n double min = array[0];\n \n for(int i = 1; i < array.length; i++){\n \n if(Double.isNaN(array[i])){\n return Double.NaN;\n }\n if(array[i] < min){\n min = array[i];\n }\n }\n return min;\n }", "public AnyType findMin() {\r\n\t\tif (isEmpty())\r\n\t\t\tthrow new UnderflowException();\r\n\t\treturn findMin(root).element;\r\n\t}", "public static int findMinimum(int[] array) {\n\n int min;\n\n if (array == null || array.length == 0) {\n return Integer.MIN_VALUE;\n } else {\n min = array[0];\n for (int i= 0; i<array.length; i++) {\n if (min > array[i]) {\n min = array[i];\n }\n }\n return min;\n }\n \n }", "E minVal();", "public static java.lang.Object min(java.util.Collection arg0)\n { return null; }", "public static double min(double[] array) { \r\n \r\n double minNum = array[0];\r\n for(int i = 0; i < array.length; i++) {\r\n if(minNum > array[i]) {\r\n minNum = array[i];\r\n }\r\n }\r\n return minNum;\r\n }", "public static int smin(int a, int b) {\n return (a < b) ? a : b;\n }", "public int njjMin(double a[]) {\n\t\tint min = 0;\n\t\tint k = 0;\n\t\tint njjlen = a.length;\n\t\tint x = 0;\n\t\twhile (k < njjlen - 1) {\n\t\t\tif (a[x] < a[x + 1])\n\t\t\t\tmin = x;\n\t\t\telse\n\t\t\t\tmin = x + 1;\n\t\t\tk++;\n\t\t}\n\t\treturn min;\n\t}", "public static void main(String[] args) {\n int a[]=new int[5];\r\n int j=1;\r\n a[0]=(int)(Math.random()*100);\r\n a[1]=(int)(Math.random()*100);\r\n a[2]=(int)(Math.random()*100);\r\n a[3]=(int)(Math.random()*100);\r\n a[4]=(int)(Math.random()*100);\r\n int minValue=a[0];\r\n for(int i=1;i<a.length;i++) {\t\r\n \tif(minValue>a[i]) {\r\n \t\tminValue=a[i];}\r\n }\r\n System.out.println(\"第一个数是\"+a[0]);\r\n System.out.println(\"第二个数是\"+a[1]);\r\n System.out.println(\"第三个数是\"+a[2]);\r\n System.out.println(\"第四个数是\"+a[3]);\r\n System.out.println(\"第五个数是\"+a[4]);\r\n System.out.println(\"最小的数是\"+minValue); \r\n\t}", "public AnyType findMin() {\n\t\treturn elementAt(findMin(root));\n\t}", "@Test(expected = IllegalArgumentException.class)\n public void test_min_IllegalArgumentException() {\n Selector.min(iNull, new CompareIntegerAscending());\n }", "public Integer findSmallestNumber() {\r\n\t\t// take base index element as smallest number\r\n\t\tInteger smallestNumber = numArray[0];\r\n\t\t// smallest number find logic\r\n\t\tfor (int i = 1; i < numArray.length; i++) {\r\n\t\t\tif (numArray[i] != null && numArray[i] < smallestNumber) {\r\n\t\t\t\tsmallestNumber = numArray[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\t// return smallest number from the given array\r\n\t\treturn smallestNumber;\r\n\t}", "public static double getMin(double[] array)\r\n\t{\r\n\t\tdouble min = Double.POSITIVE_INFINITY;\r\n\t\tfor (int i = 0; i < array.length; i++)\r\n\t\t\tif (min > array[i])\r\n\t\t\t\tmin = array[i];\r\n\t\treturn min;\r\n\t}", "int findMin(int[] arr){\n\t\tint minimum=1000;\n\t\tfor (int i=0; i<arr.length; i++) {\n\t\t\tif (arr[i]<minimum) {\n\t\t\t\tminimum=arr[i];\n\t\t\t}\n\t\t}\n\t\treturn minimum;\n\t}", "ComparableExpression<T> min();", "private static int minimum(int a, int b, int c)\n {\n return Math.min(a, Math.min(b,c));\n }", "private double min(double a, double b) {\n if (a > b) {\n return b;\n }\n return a;\n }", "public int findMin() {\n\t\tint min = (int)data.get(0);\n\t\tfor (int count = 1; count < data.size(); count++)\n\t\t\tif ((int)data.get(count) < min)\n\t\t\t\tmin = (int)data.get(count);\n\t\treturn min;\n\t}", "static int min(int a, int b) {\n return Math.min(a, b);\n }", "public static void sort(Comparable[] a) {\n int minPos = 0;\n for (int i = 1; i < a.length; i++) {\n if (less(a[i], a[minPos])) minPos = i;\n }\n if (minPos != 0) exch(a, 0, minPos);\n\n // Modify i from 0 to 1, this can avoid index out of bound error\n for (int i = 1; i < a.length; i++) {\n for (int j = i; less(a[j], a[j - 1]); j--) {\n exch(a, j, j - 1);\n }\n }\n }", "public static int argmin(double[] array, int from, int to) {\n\t\tif (from>=to) return -1;\n\t\tdouble max = array[from];\n\t\tint re = from;\n\t\tfor (int i=from+1; i<to; i++) {\n\t\t\tif (array[i]<max) {\n\t\t\t\tmax = array[i];\n\t\t\t\tre = i;\n\t\t\t}\n\t\t}\n\t\treturn re;\n\t}", "public static double min(double a, double b) {\t\n\t\treturn ((a<b)?a:b);\n\t}", "public static <T extends Vector> T Min(T a, T b, T result){\n for(int i = 0; i < result.axis.length; i++){\n result.axis[i] = Math.min(a.axis[i],b.axis[i]);\n }\n return result;\n }", "private static final int min(int a, int b, int c) {\n int t = (a < b) ? a : b;\n return (t < c) ? t : c;\n }", "public static int min(int[] mainArray) {\r\n\t\tint min1 = 0;\r\n\t\tfor(int lessThan = 1; lessThan < mainArray.length; lessThan ++) {\r\n\r\n\t\t\tif(mainArray[lessThan]<mainArray[min1]) {\r\n\t\t\t\tmin1 = lessThan;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn min1;\r\n\t}", "int minPriority(){\n if (priorities.length == 0)\n return -1;\n\n int index = 0;\n int min = priorities[index];\n\n for (int i = 1; i < priorities.length; i++){\n if ((priorities[i]!=(-1))&&(priorities[i]<min)){\n min = priorities[i];\n index = i;\n }\n }\n return values[index];\n }", "private static double min(Double[] darray){\n\t\tdouble min = darray[0];\n\t\tfor ( double dd : darray){\n\t\t\tmin = Math.min(min,dd);\n\t\t}\n\t\treturn min;\n\t}", "public E findMin() throws NoSuchElementException {\n\t\treturn minimums.peek();\n\t}", "void updateMin(StockNode a){\n\t\tif(minNode==null){\r\n\t\t\tminNode=a;\r\n\t\t} else {\r\n\t\t\tif(a.stockValue<minNode.stockValue){\r\n\t\t\t\tminNode=a;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected ValuePosition getMinimum() {\n\t\t// Calcule la position et la durée d'exécution de la requête la plus courte dans le tableau des requêtes\n\t\tValuePosition minimum = new ValuePosition();\n\t\tminimum.position = 0;\n\t\tfor(int pos=0; pos<requests.length; pos++) {\n\t\t\tRequest request = requests[pos];\n\t\t\tif(request == null) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(minimum.value == null || request.getElapsedTime() < minimum.value) {\n\t\t\t\tminimum.position = pos;\n\t\t\t\tminimum.value = request.getElapsedTime();\n\t\t\t}\n\t\t}\n\t\treturn minimum;\n\t}", "public float min(Collection<Float> data){\r\n return Collections.min(data);\r\n }", "private static int min(int[] arr, int i, int length, int r) {\n\n\t\tint mid = (i + length) / 2;\n\t\t\t\t\n\t\tif (i > length || i < 0)\n\t\t\treturn -1;\n\t\t\n\t\tif ((arr[mid] == r && mid == 0) || (arr[mid] == r && arr[mid - 1] < r))\n\t\t\treturn mid;\n\t\tif (arr[mid] >= r)\n\t\t\treturn min(arr, i, mid - 1, r);\n\t\telse\n\t\t\treturn min(arr, mid + 1, length, r);\n\t}", "@SuppressWarnings(\"boxing\")\n public double min(final double alternative) {\n double value = reduce(new F2ReduceObjects<Number>() {\n @Override\n public Number f(Number left, Number right) {\n return Math.min(left.doubleValue(), right.doubleValue());\n }\n }).get(Double.valueOf(alternative)).doubleValue();\n\n return Double.isNaN(value) ? alternative : value;\n }", "public E findMin() {\n // TODO: YOUR CODE HERE\n return getElement(1);\n }", "private static final EvaluationAccessor min(EvaluationAccessor operand, EvaluationAccessor[] arguments) {\r\n EvaluationAccessor result = null;\r\n Value oVal = operand.getValue();\r\n if (oVal instanceof ContainerValue) {\r\n ContainerValue cont = (ContainerValue) oVal;\r\n IDatatype contType = ((Container) cont.getType()).getContainedType();\r\n int contSize = cont.getElementSize();\r\n \r\n if (contSize > 0) {\r\n Value rValue = null;\r\n \r\n // Determine min for number containers \r\n if (contType.isAssignableFrom(RealType.TYPE)) {\r\n // Handle min for Reals\r\n double min = (Double) cont.getElement(0).getValue();\r\n for (int i = 1; i < contSize; i++) {\r\n double tmp = (Double) cont.getElement(i).getValue();\r\n if (tmp < min) {\r\n min = tmp;\r\n }\r\n }\r\n \r\n try {\r\n rValue = ValueFactory.createValue(contType, min);\r\n } catch (ValueDoesNotMatchTypeException e) {\r\n EASyLoggerFactory.INSTANCE.getLogger(GenericNumberOperations.class, Bundle.ID)\r\n .debug(e.getMessage());\r\n }\r\n } else if (contType.isAssignableFrom(IntegerType.TYPE)) {\r\n // Handle min for Reals\r\n int min = (Integer) cont.getElement(0).getValue();\r\n for (int i = 1; i < contSize; i++) {\r\n int tmp = (Integer) cont.getElement(i).getValue();\r\n if (tmp < min) {\r\n min = tmp;\r\n }\r\n }\r\n \r\n // Create min value\r\n try {\r\n rValue = ValueFactory.createValue(contType, min);\r\n } catch (ValueDoesNotMatchTypeException e) {\r\n EASyLoggerFactory.INSTANCE.getLogger(GenericNumberOperations.class, Bundle.ID)\r\n .debug(e.getMessage());\r\n }\r\n }\r\n \r\n if (null != rValue) {\r\n result = ConstantAccessor.POOL.getInstance().bind(rValue, operand.getContext());\r\n }\r\n }\r\n }\r\n return result;\r\n }", "private static int findKthSmallestElementUsingQuickSelect(int[] a, int low, int high, int k) {\n\n //CHECKS\n //In your original method check if array is null or empty\n //k is from 1 to n\n\n //If k is smaller than number of elements in array\n if (k > 0 && k <= a.length) {\n\n int pi = partition(a, low, high);\n\n if (pi == k - 1) {\n return a[pi];\n }\n if (pi > k - 1) {\n return findKthSmallestElementUsingQuickSelect(a, low, pi - 1, k);\n } else {\n return findKthSmallestElementUsingQuickSelect(a, pi + 1, high, k);\n }\n }\n return Integer.MAX_VALUE;\n }", "public static double min(double[] array, double min) {\n for (int i = 1; i < array.length; i++) {\n if (array[i] <= min) {\n min = array[i];\n }\n }\n return min;\n }" ]
[ "0.77618605", "0.75719637", "0.70086706", "0.6560083", "0.6544194", "0.6535837", "0.64521956", "0.64416564", "0.64118457", "0.6339111", "0.6333147", "0.6277457", "0.62694436", "0.6228551", "0.62263024", "0.6198467", "0.6188851", "0.61825037", "0.61816835", "0.6167087", "0.61505824", "0.61344856", "0.6124384", "0.6119875", "0.61093694", "0.6104323", "0.61038613", "0.61037135", "0.6080049", "0.60519594", "0.60491985", "0.6042177", "0.6022821", "0.60183007", "0.5966846", "0.59371823", "0.5931153", "0.5929176", "0.59244424", "0.59237933", "0.592097", "0.5916605", "0.5914895", "0.5892768", "0.5865253", "0.58625484", "0.58574337", "0.5850504", "0.58212453", "0.5818434", "0.58168703", "0.5799846", "0.579567", "0.57851404", "0.5784056", "0.57787085", "0.5766738", "0.57624924", "0.5761093", "0.5755892", "0.575422", "0.5746023", "0.57455504", "0.5738607", "0.5735801", "0.5730957", "0.57221675", "0.57034343", "0.5694977", "0.56899834", "0.5679537", "0.567363", "0.56706125", "0.5668774", "0.5664091", "0.56507224", "0.5638012", "0.5635979", "0.56325257", "0.5610576", "0.56082886", "0.56040204", "0.5596502", "0.55962497", "0.5596059", "0.5592483", "0.5588546", "0.55845183", "0.5573811", "0.5569972", "0.55599225", "0.5553999", "0.555309", "0.5550716", "0.5549674", "0.55468494", "0.5541077", "0.5533482", "0.55301285", "0.5511738", "0.55026716" ]
0.0
-1
Selects the maximum value from the array a. This method throws IllegalArgumentException if a is null or has zero length. The array a is not changed by this method.
public static <T> T max(Collection<T> c, Comparator<T> comp) { // Check input for null. if (c == null || comp == null) { throw new IllegalArgumentException(); } // Check input for empty. if (c.isEmpty()) { throw new NoSuchElementException(); } Iterator<T> itr = c.iterator(); T max = itr.next(); while (itr.hasNext()) { T hold = itr.next(); if (comp.compare(hold, max) > 0) { max = hold; } } return max; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int max(int[] a) {\n\t\tint b=a[0];\r\n\t\tfor(int i=0;i<a.length;i++) {\r\n\t\t\tif(a[i]>b) {\r\n\t\t\t\tb=a[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn b;\r\n\t}", "public static int max(int[] a) throws IllegalArgumentException {\n if (a == null || a.length == 0) {\n throw new IllegalArgumentException();\n }\n int max = a[0];\n \n if (a.length > 1) {\n for (int i = 1; i < a.length; i++) {\n if (a[i] > max) {\n max = a[i];\n }\n }\n }\n return max;\n }", "public static int max(int[] a){\r\n\t\tint m = a[0];\r\n\t\tfor( int i=1; i<a.length; i++ )\r\n\t\t\tif( m < a[i] ) m = a[i];\r\n\t\treturn m;\r\n\t}", "public static int get_max(Integer[] a){\n int max = Integer.MIN_VALUE;\n\n for (int i = 0; i < a.length; i++){\n if (a[i] > max);\n max = a[i];\n }\n return max;\n }", "public static int findMax(int[] a) {\r\n int max = a[0];\r\n\r\n //10th error , n = 1\r\n for (int n = 1; n < a.length; n++) {\r\n if (a[n] > max) {\r\n max = a[n];\r\n }\r\n }\r\n return max;\r\n\r\n }", "private static int maxValue(int[] a) {\n\t\tint max_value =0;\r\n\t\tint current_max=0;\r\n\t\t\r\n\t\tfor(int i=0;i<a.length;i++)\r\n\t\t{\r\n\t\t\tcurrent_max += a[i];\r\n\t\t\tmax_value= Math.max(max_value, current_max);\r\n\t\t\tif(a[i]<0)\r\n\t\t\t\tcurrent_max=0;\r\n\t\t}\r\n\t\t\r\n\t\treturn max_value;\r\n\t}", "public static double max(double a, double... vals) {\n\t\tdouble maxVal = a;\n\t\tfor (double v : vals) {\n\t\t\tif (v > maxVal) {\n\t\t\t\tmaxVal = v;\n\t\t\t}\n\t\t}\n\t\treturn maxVal;\n\t}", "public static int max(int a, int... vals) {\n\t\tint maxVal = a;\n\t\tfor (int v : vals) {\n\t\t\tif (v > maxVal) {\n\t\t\t\tmaxVal = v;\n\t\t\t}\n\t\t}\n\t\treturn maxVal;\n\t}", "public static float max(float a, float... vals) {\n\t\tfloat maxVal = a;\n\t\tfor (float v : vals) {\n\t\t\tif (v > maxVal) {\n\t\t\t\tmaxVal = v;\n\t\t\t}\n\t\t}\n\t\treturn maxVal;\n\t}", "public T getMax()\n\t{\n\t\tif(size == 0)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\telse if(size == 1)\n\t\t{\n\t\t\treturn array[0];\n\t\t}\n\t\telse if(size == 2)\n\t\t{\n\t\t\treturn array[1];\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\tif(object.compare(array[1], array[2]) < 0)\n\t\t\t{\n\t\t\t\treturn array[2];\n\t\t\t}\n\t\t\telse if(object.compare(array[1], array[2]) > 0)\n\t\t\t{\n\t\t\t\treturn array[1];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn array[1];\n\t\t\t}\n\n\t\t}\n\t}", "public static int secondaryArgmax(double[] a) {\n\t\tint mi = argmax(a);\n\t\t// scan left until increasing\n\t\tint i;\n\t\tfor (i=mi-1; i>=0 && a[i]<=a[i+1]; i--);\n\t\tint l = argmax(a,0,i+1);\n\t\tfor (i=mi+1; i<a.length && a[i]<=a[i-1]; i++);\n\t\tint r = argmax(a,i,a.length);\n\t\tif (l==-1) return r;\n\t\tif (r==-1) return l;\n\t\treturn a[l]>=a[r]?l:r;\n\t}", "public static String maxWeather(int[] array, String[]a) {\n String day=\" \";\n int max = array[0];//set int to array[0] because could be more or less than 0 but the first number in array is largest for now\n //finding max value in the array that will be plugged in when we use this method\n for (int i = 1; i < array.length; i++) {//start loop at 0 because array also start at 0, not super necessary here because already at 0 so here we'll do = to 1\n if (array[i] > max) { // when put i in loop, linking it to loop, this will check every index 1st to end\n max = array[i]; //can't just do return max here because haven't checked the rest so return outside the loop\n day = a[i];\n }\n }return day+ \" at \"+max+\".\"; //returns a string\n }", "double largestNumber(double[] a) {\n\t\tdouble max = a[0];\n\t\tdouble no = 0;\n\t\tfor (int index = 1; index < a.length; index++) {\n\t\t\tif (max > a[index] && max > a[index + 1]) {\n\t\t\t\tno = max;\n\t\t\t\tbreak;\n\t\t\t} else if (a[index] > max && a[index] > a[index + 1]) {\n\t\t\t\tno = a[index];\n\t\t\t\tbreak;\n\t\t\t} else if (a[index + 1] > max && a[index + 1] > a[index]) {\n\t\t\t\tno = a[index + 1];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn no;\n\t}", "public double max(){\r\n\t\t//variable for max val\r\n\t\tdouble max = this.data[0];\r\n\t\t\r\n\t\tfor (int i = 1; i < this.data.length; i++){\r\n\t\t\t//if the maximum is less than the current index, change max to that value\r\n\t\t\tif (max < this.data[i]){\r\n\t\t\t\tmax = this.data[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\t//return the maximum val\r\n\t\treturn max;\r\n\t}", "public long max() {\n\t\tif (!this.isEmpty()) {\n\t\t\tlong result = theElements[0];\n\t\t\tfor (int i=1; i<numElements; i++) {\n\t\t\t\tif (theElements[i] > result) {\n\t\t\t\t\tresult = theElements[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\telse {\n\t\t\tthrow new RuntimeException(\"Attempted to find max of empty array\");\n\t\t}\n\t}", "public static Object max(Object[] object) {\n // Find max of array object\n Object maxOfA = object[0];\n for(int i = 1; i < object.length; i++) {\n if ((((Comparable) maxOfA).compareTo(object[i])) == -1) {\n maxOfA = object[i];\n }\n }\n\n // Return results.\n return maxOfA;\n }", "public int solution(int[] a) {\n int max = 0;\n int min = Integer.MIN_VALUE;\n for (int i=0;i<a.length;i++) {\n if (i == 0) {\n min = a[i];\n } else if (a[i] > min) {\n max = Math.max(a[i] - min, max);\n } else if (a[i] < min) {\n min = a[i];\n }\n }\n return max;\n }", "int max(){\r\n int auxMax = array[0];\r\n for (int i=1;i<array.length;i++){\r\n if(array[i] > auxMax){\r\n auxMax = array[i];\r\n }\r\n }\r\n return auxMax;\r\n }", "public static double[] maxrow(double[][] a){\n\n \tdouble[] res = new double[a.length];\n \tdouble max = -1;\n \tfor(int i = 0; i < a.length; i++){\n \t\tmax = max(a[i]);\n \t\tres[i] = max;\n \t}\n\n \treturn res;\n\n }", "public static int maxSubArray(final List<Integer> a) {\n\t\tint size = a.size();\n\t\tint max_so_far = Integer.MIN_VALUE, max_ending_here = 0;\n\t\tint position = 0;\n\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tmax_ending_here = max_ending_here + a.get(i);\n\t\t\tif (max_so_far < max_ending_here)\n\t\t\t\tmax_so_far = max_ending_here;\n\t\t\tif (max_ending_here < 0)\n\t\t\t\tmax_ending_here = 0;\n\t\t}\n\t\treturn max_so_far;\n\t}", "public static int ArrayMax(int[] A, int n){\r\n int temp,max;\r\n // Se guarda el ultimo valor del arreglo\r\n max = A[n];\r\n \r\n if (n != 0){\r\n // Se almacena la siguiente posicion en temp\r\n temp = ArrayMax(A,n-1);\r\n // Si temp es mayopr entonces es el actual maximo\r\n if (temp > max){\r\n max = temp;\r\n }\r\n }\r\n return max;\r\n }", "public static int getMax(int[] inputArray){ \n int maxValue = inputArray[0]; \n for(int i=1;i < inputArray.length;i++){ \n if(inputArray[i] > maxValue){ \n maxValue = inputArray[i]; \n } \n } \n return maxValue; \n }", "public static double maxSubsequenceSum(double[] a) {\r\n\t\tdouble[] s = new double[a.length];\r\n\t\tdouble max = s[0] = a[0];\r\n\t\tfor (int i = 1; i < a.length; i++) {\r\n\t\t\ts[i] = s[i - 1] < 0 ? a[i] : s[i - 1] + a[i];\r\n\t\t\tmax = Math.max(max, s[i]);\r\n\t\t}\r\n\t\treturn max;\r\n\t}", "E maxVal();", "private static int max(int[] array) {\n int result = array[0];\n for (int x : array)\n result = Math.max(x, result);\n return result;\n }", "@Override\n\tpublic T findMax(T[] ob) {\n\t\treturn null;\n\t}", "private Double getMax(Double[] values) {\n Double ret = null;\n for (Double d: values) {\n if (d != null) ret = (ret == null) ? d : Math.max(d, ret);\n }\n return ret;\n }", "@In Integer max();", "@In Integer max();", "public T findHighest(){\n T highest = array[0];\n for (int i=0;i<array.length; i++)\n {\n if (array[i].doubleValue()>highest.doubleValue())\n {\n highest = array[i];\n } \n }\n return highest;\n }", "public static int[] argmaxrow(double[][] a){\n\n \tint[] res = new int[a.length];\n \tint max = -1;\n \tfor(int i = 0; i < a.length; i++){\n \t\tmax = argmax(a[i]);\n \t\tres[i] = max;\n \t}\n\n \treturn res;\n\n }", "Expression getMax();", "@Test\n void testMaxIntegerFullRange() {\n Integer[] array = {3,8,2,9,6,5,1};\n assertEquals(new Integer(9), Max.max(array,0,7));\n }", "public static int maxProfit(int[] a) {\n int minSofar = a[0];\n int maxProfit = 0;\n int profit = 0;\n\n for (int i = 0; i < a.length - 1; i++) {\n minSofar = Math.min(minSofar, a[i]);\n profit = a[i] - minSofar;\n maxProfit = Math.max(maxProfit, profit);\n\n }\n return maxProfit;\n\n\n }", "public int maxValue( int[ ] n ) {\n int max = Integer.MIN_VALUE;\n for(int each: n){\n if(each > max){\n max = each;\n }\n }\n return max;\n }", "public static int getMax(int[] array) {\n //TODO: write code here\n int max = array[0];\n for(int a : array) {\n max = a > max ? a : max;\n }\n return max;\n }", "public String findMax(String[] vals)\r\n\t{\r\n\t\treturn \"nothing yet\";\r\n\t}", "public AnyType findMax() {\n\t\treturn elementAt(findMax(root));\n\t}", "private int max(int a, int b) {\n\t\treturn a>b?a:b;\n\t}", "public static void main(String[] args) {\n int[] nums = {24, 32, 1, 0, -57, 982, 446, 11, 177, 390, 2923, 7648, 242, 234, 1123, 875};\n int maxValue = nums[0];\n\n for(int i = 0; i < nums.length; i++) {\n if (nums[i] > maxValue) {\n maxValue = nums[i];\n }\n }\n System.out.println(\"Max Value in Array: \" + maxValue);\n }", "public AnyType findMax() {\r\n\t\tif (isEmpty())\r\n\t\t\tthrow new UnderflowException();\r\n\t\treturn findMax(root).element;\r\n\t}", "protected IExpressionValue max()throws TableFunctionMalformedException,\r\n\t\t\t\t\t\t\t\t\t\t InvalidProbabilityRangeException,\r\n\t\t\t\t\t\t\t\t\t\t SomeStateUndeclaredException{\r\n\t\t// Debug.println(\"ANALISING MAX FUNCTION\");\r\n\t\t\r\n\t\tIExpressionValue ret1 = null;\r\n\t\tIExpressionValue ret2 = null;\r\n\t\tmatch('(');\r\n\t\tret1 = this.expression();\r\n//\t\tmatch(';');\r\n\t\tif (look != ';' && look != ',') {\r\n\t\t\texpected(\";\");\r\n\t\t}\r\n\t\tnextChar();\r\n\t\tskipWhite();\r\n\t\tret2 = this.expression();\r\n\t\tmatch(')');\r\n\t\t/*\r\n\t\t// old code: tests which ret1/ret2 to return and test consistency. ComparisionProbabilityValue replaces it.\r\n\t\tif (!Float.isNaN(ret1)) {\r\n\t\t\tif (!Float.isNaN(ret2)) {\r\n\t\t\t\tret1 = ((ret2>ret1)?ret2:ret1);\r\n\t\t\t}\r\n\t\t} else if (!Float.isNaN(ret2)) {\r\n\t\t\treturn ret2;\r\n\t\t}\r\n\t\t*/\r\n\t\treturn new ComparisionProbabilityValue(ret1,ret2,true);\r\n\t\t\r\n\t}", "public static void main(String[] args) throws Exception {\n Scanner scn = new Scanner(System.in);\n \n int n = scn.nextInt();\n int[] arr = new int[n];\n \n for(int i=0; i<n;i++){\n arr[i] = scn.nextInt();\n }\n \n \n int ans = maxOfArray(arr,0,0);\n System.out.println(ans);\n }", "public static <E extends Comparable<? super E>> E max(E... args) throws IllegalArgumentException {\n\n\t\tE max = args[0];\n\t\tfor (int i = 0; i < args.length; i++) {\n\t\t\tif (args[i].compareTo(max) > 0)\n\t\t\t\tmax = args[i];\n\t\t}\n\n\t\treturn max;\n\t}", "public static int max(int[] arr){\n return maxInRange(arr, 0, arr.length-1);\n }", "int max(int a, int b);", "private int max(int a, int b) {\n return (a > b) ? a : b;\n }", "public static int maxValue(int [] array){\n int hold = array[0];\n for(int i = 1; i < array.length; i++){\n if(array[i] > hold){\n hold = array[i];\n }\n }\n return hold;\n }", "public static int max(int a, int b) {\t\n\t\treturn ((a>b)?a:b);\n\t}", "public T max();", "public int findMax(int[] arr) {\n return 0;\n }", "public abstract int getMaximumValue();", "private static int getMax(int[] original) {\n int max = original[0];\n for(int i = 1; i < original.length; i++) {\n if(original[i] > max) max = original[i];\n }\n return max;\n }", "public static <T extends Comparable<T>> T findMax(T[] arr) {\n if (arr.length == 0 || arr == null) {\n throw new IllegalArgumentException(\"Array null or empty.\");\n }\n\n T max = arr[0];\n for (int i = 1; i < arr.length; i++) {\n max = MathUtils.max(arr[i], max);\n }\n return max;\n }", "public static Location locateLargest(double[][] a){\n Location answer = new Location(a);\n return answer;\n }", "Location(double[][] a){\n\n //Sets default location for largest element\n maxVal = a[0][0];\n\n //Nested for loops are used to go through every index and check which is\n // the largest\n for(int i = 0; i < a.length; i++){\n for(int j = 0; j < a[i].length; j++){\n //Checks if the first input is greater than the next and checks every\n // index. If it is greater it will assign it to the maxVal.\n if(a[i][j] > maxVal){\n rows = i;\n cols = j;\n maxVal = a[i][j];\n }\n }\n }\n }", "public static int argmax(float[] array) {\n\t\tfloat max = array[0];\n\t\tint re = 0;\n\t\tfor (int i=1; i<array.length; i++) {\n\t\t\tif (array[i]>max) {\n\t\t\t\tmax = array[i];\n\t\t\t\tre = i;\n\t\t\t}\n\t\t}\n\t\treturn re;\n\t}", "public static void main(String[] args) {\n int[] input = {-1};\n ArrayMaxSub arrayMaxSub = new ArrayMaxSub();\n int ret = arrayMaxSub.maxSubArray(input);\n System.out.println(\"ret : \" + ret);\n }", "public static int max(int[] values) {\n return max(values, 0, values.length);\n }", "public static int getHighestInRow(int[][] numbers, int a) {\n int highest = numbers [a][0];\n for (int i = 0; i < numbers[a].length-1; i++){\n if (numbers[a][i] > highest){\n highest = numbers [a][i];\n }\n }\n return highest;\n }", "public static int maximo (int[] array) {\n\t\tint max = array[0], i;\n\t\t\n\t\tfor (i = 1; i < array.length; i++) {\n\t\t\tif (array[i] > max) {\n\t\t\t\tmax = array[i];\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn max;\n\t}", "public static int max(int a, int b){\r\n return (a>b) ? a:b;\r\n }", "public static double max(double[] array) {\n\t\tif (array.length==0) return Double.NEGATIVE_INFINITY;\n\t\tdouble re = array[0];\n\t\tfor (int i=1; i<array.length; i++)\n\t\t\tre = Math.max(re, array[i]);\n\t\treturn re;\n\t}", "public void findMax(int[] arr){\n int max = arr[0];\n for(int val : arr){\n if(max < val){\n max = val;\n }\n }\n System.out.println( \"Maximum values: \" + max );\n }", "public static double max(double a, double b) {\t\n\t\treturn ((a>b)?a:b);\n\t}", "private static final EvaluationAccessor max(EvaluationAccessor operand, EvaluationAccessor[] arguments) {\r\n EvaluationAccessor result = null;\r\n Value oVal = operand.getValue();\r\n if (oVal instanceof ContainerValue) {\r\n ContainerValue cont = (ContainerValue) oVal;\r\n IDatatype contType = ((Container) cont.getType()).getContainedType();\r\n int contSize = cont.getElementSize();\r\n \r\n if (contSize > 0) {\r\n Value rValue = null;\r\n \r\n // Determine max for number containers \r\n if (contType.isAssignableFrom(RealType.TYPE)) {\r\n // Handle max for Reals\r\n double max = (Double) cont.getElement(0).getValue();\r\n for (int i = 1; i < contSize; i++) {\r\n double tmp = (Double) cont.getElement(i).getValue();\r\n if (tmp > max) {\r\n max = tmp;\r\n }\r\n }\r\n \r\n try {\r\n rValue = ValueFactory.createValue(contType, max);\r\n } catch (ValueDoesNotMatchTypeException e) {\r\n EASyLoggerFactory.INSTANCE.getLogger(GenericNumberOperations.class, Bundle.ID)\r\n .debug(e.getMessage());\r\n }\r\n } else if (contType.isAssignableFrom(IntegerType.TYPE)) {\r\n // Handle max for Reals\r\n int max = (Integer) cont.getElement(0).getValue();\r\n for (int i = 1; i < contSize; i++) {\r\n int tmp = (Integer) cont.getElement(i).getValue();\r\n if (tmp > max) {\r\n max = tmp;\r\n }\r\n }\r\n \r\n // Create max value\r\n try {\r\n rValue = ValueFactory.createValue(contType, max);\r\n } catch (ValueDoesNotMatchTypeException e) {\r\n EASyLoggerFactory.INSTANCE.getLogger(GenericNumberOperations.class, Bundle.ID)\r\n .debug(e.getMessage());\r\n }\r\n }\r\n \r\n if (null != rValue) {\r\n result = ConstantAccessor.POOL.getInstance().bind(rValue, operand.getContext());\r\n }\r\n }\r\n }\r\n return result;\r\n }", "public static int maxSub(int[] A) {\n int maxNow = A[0];\n int maxAll = A[0];\n int size = A.length;\n for (int i = 1; i < size; i++) {\n maxNow = Math.max(A[i], maxNow + A[i]);\n// System.out.println(\"i = \" + i + \": max now:\" + maxNow);\n maxAll = Math.max(maxAll, maxNow);\n// System.out.println(\"i = \" + i + \": max all:\" + maxAll);\n }\n return maxAll;\n }", "static int getMax(int[] array) {\n\n\t\tif (array.length > 6 && array.length < 0) {\n\t\t\tthrow new IndexOutOfBoundsException(\"There is no that index in this array.\");\n\t\t}\n\t\tint max = 0;\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tif (max < array[i]) {\n\t\t\t\tmax = array[i];\n\t\t\t}\n\t\t}\n\t\treturn max;\n\n\t}", "public static int argmax(double[] array, int from, int to) {\n\t\tif (from>=to) return -1;\n\t\tdouble max = array[from];\n\t\tint re = from;\n\t\tfor (int i=from+1; i<to; i++) {\n\t\t\tif (array[i]>max) {\n\t\t\t\tmax = array[i];\n\t\t\t\tre = i;\n\t\t\t}\n\t\t}\n\t\treturn re;\n\t}", "public static java.lang.Object max(java.util.Collection arg0)\n { return null; }", "static public long max(long[] valarray) {\r\n long max = 0;\r\n for (long i : valarray) {\r\n if (i > max)\r\n max = i;\r\n }\r\n return max;\r\n }", "int max(int a,int b)\n {\n \t\n \tif(a>b)\n \t\treturn a;\n \telse\n \t\treturn b;\n \t\n }", "public static void arrayMax(){\n int [] array={12,3,4,5,6,1,0,3};\n //using the for loop to iterate through the numbers in the array\n int max=array[0];\n int size=array.length;\n\n for(int i = 0; i<size; i++){\n if(array[i]>max){\n max=array[i];\n }\n }\n System.out.println(new StringBuilder().append(max).append(\": is the maximum number in the given array.\").toString());\n\n }", "public static int argmax(double[] array) {\n\t\tdouble max = array[0];\n\t\tint re = 0;\n\t\tfor (int i=1; i<array.length; i++) {\n\t\t\tif (array[i]>max) {\n\t\t\t\tmax = array[i];\n\t\t\t\tre = i;\n\t\t\t}\n\t\t}\n\t\treturn re;\n\t}", "public int maxSubArray(final List<Integer> A) {\n int n = A.size();\n int ans = A.get(0),curr = A.get(0);\n \n for(int i=1;i<n;i++){\n curr = Math.max(A.get(i),A.get(i)+curr);\n ans = Math.max(curr,ans);\n }\n return ans;\n }", "int max(int a, int b) {\n return (a > b) ? a : b;\n }", "static int max(int a, int b) {\n\t\treturn a > b ? a : b;\n\t}", "public static int getMaxValue(int[] numberArray)\n\t{\n\t\tint maxValue = numberArray[0];\n\t\tfor (int i = 1; i < numberArray.length; i++)\n\t\t{\n\t\t\tif (numberArray[i] > maxValue)\n\t\t\t\tmaxValue = numberArray[i];\n\t\t}\n\t\treturn maxValue;\n\t}", "static int max(int a, int b) {\n return (a > b) ? a : b;\n }", "int getMaximum();", "public static double findMax(double[] da) {\n\n\t\tdouble max = da[0];\n\n\t\tfor (double d : da) {\n\t\t\tif (d > max) {\n\t\t\t\tmax = d;\n\t\t\t}\n\t\t}\n\n\t\treturn max;\n\t}", "@Override\n public int iamax(INDArray x) {\n return NativeBlas.isamax(x.length(), x.data(), x.offset(), x.stride()[0]) - 1;\n }", "int max(int a, int b)\n\t{\n\t\treturn(a>b)?a:b;\n\t}", "ComparableExpression<T> max();", "public static int max(int[] m) {\n int x = 1;\n int ret = m[0];\n while (x < m.length) {\n if (m[x] > ret) {\n ret = m[x];\n }\n x = x + 1;\n }\n return ret;\n }", "public int maxSubArray(int[] A) {\n\t\tint n = A.length;\n\t\tint left = A[0];\n\t\tint max = A[0];\n\t\tfor (int i = 1; i < n; ++i) {\n\t\t\tif (left < 0)\n\t\t\t\tleft = A[i];\n\t\t\telse\n\t\t\t\tleft = left + A[i];\n\t\t\tmax = Math.max(max, left);\n\t\t}\n\t\treturn max;\n\t}", "public static int getMaximum(int[] array) {\n int length = array.length;\n int max = array[0];\n for (int i = 1; i < length; i++) {\n if(max < array[i]) {\n max = array[i];\n }\n }\n\n Arrays.sort(array);\n// return array[length - 1];\n return max;\n }", "int getMax();", "public int max()\n\t{\n\t\tif (arraySize > 0)\n\t\t{\n\t\t\tint maxNumber = array[0];\n\t\t\tfor (int index = 0; index < arraySize; index++) \n\t\t\t{\n\t\t\t\tif (array[index] > maxNumber)\n\t\t\t\t{\n\t\t\t\t\tmaxNumber = array[index];\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\treturn maxNumber;\n\t\t}\n\t\treturn -1;\n\t\t\n\t}", "public int maxArea(ArrayList<Integer> a) {\n\t if(a.size() < 2){\n\t return 0;\n\t }\n\t int left = 0;\n\t int right = a.size()-1;\n\t int val = 0;\n\t\t\n\t\t// Iterate till the left and right lines are not the same\n\t while(left<right){\n\t\t\t\n\t\t\t// Update the maximum value\n\t val = Math.max(val, (right-left)*(Math.min(a.get(left), a.get(right))));\n\t\t\t\n\t\t\t// Left value is smaller than right, move right\n\t if(a.get(left) < a.get(right)){\n\t left++;\n\t }\n\t\t\t// Left value is larger than right, move left\n\t else{\n\t right--;\n\t }\n\t }\n\t return val;\n\t}", "public static <T extends Vector> T Max(T a, T b, T result){\n for(int i = 0; i < result.axis.length; i++){\n result.axis[i] = Math.max(a.axis[i],b.axis[i]);\n }\n return result;\n }", "public static int max(int[] theArray) {\n\n int biggest = theArray[0];\n\n //Converts the array to a list\n List<Integer> values = Arrays.stream(theArray).boxed().collect(Collectors.toList());\n\n //get the biggest by streaming the list and using min which gets the min value by using the Integer Comparator.comparing().\n //which means it will loop through the array and compare all the values for the biggest values\n biggest= values.stream().max(Integer::compare).get();\n\n// //Alternative code does the samething\n// for (int number : theArray) {\n//\n// if (biggest < number) {\n// biggest = number;\n// }\n// }\n\n return biggest;\n\n }", "public int findMax() {\n\t\tint max = (int)data.get(0);\n\t\tfor (int count = 1; count < data.size(); count++)\n\t\t\tif ( (int)data.get(count) > max)\n\t\t\t\tmax = (int)data.get(count);\n\t\treturn max;\n\t}", "public static void main(String[] args) {\n int[] arr={24,34,56,98,2,59};\r\n int val =arr [0];\r\n for(int i=0;i<arr.length;i++){\r\n \t if(arr[i]>val){\r\n \t\t val=arr[i];\r\n \t }\r\n }\r\n System.out.println(\"largest value\"+ val);\r\n\t}", "public int maxSubArray1(int[] A) {\n\t\tif(A == null || A.length == 0)\n\t\t\treturn 0;\n\t\treturn divide_conquer(A, 0, A.length-1);\n\t}", "public static int max(int[] array){\n \n if(array == null){\n \n throw new IllegalArgumentException(\"Array cannot be null\");\n }\n else if(array.length==0){\n throw new IllegalArgumentException(\"Array cannot be empty\");\n }\n \n int max = array[0];\n \n for(int i = 1; i < array.length; i++){\n \n if(array[i] > max){\n max = array[i];\n }\n }\n return max;\n }", "protected int getMaxValue(int a1, int b1)\n\t{\n\t\tint c1=Math.max(a1, b1);\n\t\t\n\t\t//int c1=getMaxValue(a1, b1);\t\n\t\treturn c1;\n\t}", "@SafeVarargs\n\tpublic static <E extends Comparable<E>> E findMaximum(E ...items) {\n\t\tE maximum = items[0];\n\t\tfor (E iter : items) {\n\t\t\tif (maximum.compareTo(iter) < 0)\n\t\t\t\tmaximum = iter;\n\t\t}\n\t\tprintMax(maximum, items);\n\t\treturn maximum;\n\t}", "Double getMaximumValue();", "public static float max(float [] array)\r\n\t{\r\n\t\tfloat maxValue = array[0];\r\n\t\tfor (int i = 1; i < array.length; i++)\r\n\t\t{\r\n\t\t\tif (array[i] > maxValue)\r\n\t\t\t{\r\n\t\t\t\tmaxValue = array[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn maxValue;\r\n\t}", "public static boolean isArray_max() {\n return false;\n }" ]
[ "0.74916196", "0.7369747", "0.73149663", "0.71056587", "0.70335525", "0.6993306", "0.6527202", "0.65266716", "0.6521134", "0.6476667", "0.64328325", "0.6363297", "0.63445896", "0.62892425", "0.6213512", "0.6192399", "0.61882293", "0.6184986", "0.6177891", "0.6174242", "0.6119846", "0.6112342", "0.6090834", "0.6078581", "0.605577", "0.6026359", "0.5967877", "0.5962836", "0.5962836", "0.59509254", "0.59469336", "0.5930422", "0.59284854", "0.5918035", "0.5916804", "0.5909163", "0.59075904", "0.59058094", "0.59051794", "0.58911884", "0.5888795", "0.5884386", "0.5883498", "0.58663696", "0.58659065", "0.5861073", "0.5857512", "0.58442205", "0.58366066", "0.58334583", "0.58318365", "0.58271986", "0.5822088", "0.58180946", "0.58121717", "0.5811035", "0.5805107", "0.58022106", "0.57871044", "0.5786092", "0.57699645", "0.5769845", "0.5766726", "0.575643", "0.57552636", "0.5746713", "0.5745558", "0.57414156", "0.57379335", "0.5729157", "0.5710083", "0.57093936", "0.57065195", "0.57042956", "0.56922585", "0.5686159", "0.5676751", "0.56662357", "0.565268", "0.56520236", "0.56506497", "0.56497097", "0.5643258", "0.56425893", "0.56413287", "0.56404644", "0.5638864", "0.5637425", "0.5635821", "0.5630408", "0.5615296", "0.5614368", "0.5613539", "0.5602157", "0.5600301", "0.5594522", "0.55933684", "0.55920243", "0.558881", "0.5588274", "0.5585485" ]
0.0
-1
Selects the kth minimum value from the array a. This method throws IllegalArgumentException if a is null, has zero length, or if there is no kth minimum value. Note that there is no kth minimum value if k a.length, or if k is larger than the number of distinct values in the array. The array a is not changed by this method.
public static <T> T kmin(Collection<T> c, int k, Comparator<T> comp) { //Check collectionfor null or empty, comp is null. if (c == null || comp == null) { throw new IllegalArgumentException(); } //Check if collection is empty. if (c.isEmpty()) { throw new NoSuchElementException(); } // Create Arraylist of collection and sort. List<T> copyList = new ArrayList(c); java.util.Collections.sort(copyList, comp); // Check if k < 0 or k > array length. if (k > copyList.size() || k <= 0) { throw new NoSuchElementException(); } // Count the number of unique values, remove duplicates. int dupCount = 0; int uniTot = 0; int origTot = copyList.size(); for (int i = 0; i < copyList.size() - 1; i++) { while (copyList.size() > 1 && i < copyList.size() - 1 && copyList.get(i) == copyList.get(i + 1)) { copyList.remove(i); dupCount++; } } uniTot = origTot - dupCount; // k is greater than the number of unique values. if (k > uniTot) { throw new NoSuchElementException(); } return copyList.get(k - 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int kmin(int[] a, int k) throws IllegalArgumentException {\n if (ktest(a, k)) {\n throw new IllegalArgumentException();\n }\n int[] array = Arrays.copyOf(a, a.length);\n int increment = 1;\n int element;\n \n Arrays.sort(array);\n element = array[0];\n \n for (int i = 0; i < array.length; i++) {\n if (element < array[i]) {\n element = array[i];\n increment ++;\n }\n if (k == increment) {\n return element;\n }\n }\n throw new IllegalArgumentException();\n }", "private static int findKthSmallestElementUsingQuickSelect(int[] a, int low, int high, int k) {\n\n //CHECKS\n //In your original method check if array is null or empty\n //k is from 1 to n\n\n //If k is smaller than number of elements in array\n if (k > 0 && k <= a.length) {\n\n int pi = partition(a, low, high);\n\n if (pi == k - 1) {\n return a[pi];\n }\n if (pi > k - 1) {\n return findKthSmallestElementUsingQuickSelect(a, low, pi - 1, k);\n } else {\n return findKthSmallestElementUsingQuickSelect(a, pi + 1, high, k);\n }\n }\n return Integer.MAX_VALUE;\n }", "int findKthSmallest(int[] a, int[] b, int aLength, int bLength, int k) {\n\tif(aLength > bLength)\n\t\treturn findKthSmallest(b,a,bLength,aLength,k);\n\t//Base cases.\n\tif(aLength ==0 && bLength >0)\n\t\treturn b[k-1];\n\tif (k ==1)\n\t\treturn Math.min(a[0],b[0]);\n\t\n\tint i = Math.min(k/2,aLength); // k is always less than length of array.\n\tint j= Math.min(k/2,bLength);\n\t\n\tif(a[i-1] >b[j-1])// slice b, find the k-jth element.\n\t\treturn findKthSmallest(a, Arrays.copyOfRange(b,j,b.length),aLength,bLength-j,k-j);\n\telse \n\t\treturn findKthSmallest(Arrays.copyOfRange(a,i,a.length),b,aLength-i,b,k-i);\n}", "int[] smallestK(int[] array, int k) {\n if (k <= 0 || k > array.length) {\n throw new IllegalArgumentException();\n }\n Arrays.sort(array);\n\n int[] smallest = new int[k];\n for (int i = 0; i < k; i++) {\n smallest[i] = array[i];\n }\n return smallest;\n }", "public int kthSmallest(int[][] matrix, int k) {\n return 0;\n }", "private static int findKthSmallest(Integer[] arr, int kthSmallest) {\n\t\tArrays.sort(arr);\n\t\t\n\t\t// return kth element;\n\t\treturn arr[kthSmallest-1];\n\t\t\n\t}", "public static int kmax(int[] a, int k) throws IllegalArgumentException {\n if (ktest(a, k)) {\n throw new IllegalArgumentException();\n }\n int[] array = Arrays.copyOf(a, a.length);\n int element;\n int increment = 1;\n \n Arrays.sort(array);\n element = array[array.length - 1];\n \n for (int i = array.length - 1; i > -1; i--) {\n if (element > array[i]) {\n element = array[i];\n increment ++;\n }\n if (k == increment) {\n return element;\n }\n }\n throw new IllegalArgumentException();\n }", "private static int getSmallerThanOrEqualToKCount(int[] a, int k){\n int left=0, right=a.length-1;\n while(left<right){\n int mid=left+(right+1-left)/2;\n if(a[mid]>k){\n right=mid-1;\n } else{\n left=mid;\n }\n }\n return left-0+1;\n }", "public int kthSmallest(TreeNode root, int k) {\n if (root == null || k <= 0) return -1;\n List<Integer> res = new ArrayList<>();\n helper(root, k, res);\n return res.get(k - 1);\n }", "public int kthSmallest(TreeNode root, int k) {\n ArrayList<Integer> arr = new ArrayList<>();\n inorder(root, arr);\n return arr.get(k-1);\n }", "public int[] getLeastNumbers(int[] arr, int k) {\n Arrays.sort(arr);\n return Arrays.copyOfRange(arr, 0, k);\n }", "public T k_minimum(int k) {\n CntAVLTreeNode<T> p = k_minimum(mRoot, k);\n return p != null ? (p.key) : null;\n }", "public static ArrayList<Integer> kSmallest(int n, int[] input, int k) {\n PriorityQueue<Integer> pq = new PriorityQueue<>(Collections.reverseOrder());\r\n for (int i = 0; i < k; i++) {\r\n pq.add(input[i]);\r\n }\r\n for (int i = k; i < input.length; i++) {\r\n int temp = pq.peek();\r\n if (temp > input[i]) {\r\n pq.poll();\r\n pq.add(input[i]);\r\n }\r\n }\r\n\r\n ArrayList<Integer> ans = new ArrayList<>();\r\n Iterator iterator = pq.iterator();\r\n\r\n while (iterator.hasNext()) {\r\n ans.add((int) iterator.next());\r\n }\r\n return ans;\r\n\r\n }", "private static <AnyType extends Comparable<? super AnyType>> void quickSelect(AnyType[] a, int left, int right, int k)\n {\n if(left + CUTOFF <= right)\n {\n AnyType pivot = median3(a, left, right);\n\n // Begin partitioning\n int i = left, j = right - 1;\n for( ; ; )\n {\n while(a[++i].compareTo(pivot) < 0);\n while(a[--j].compareTo(pivot) > 0);\n if(i < j)\n CommonFunc.swapReference(a, i, j);\n else \n break;\n }\n\n CommonFunc.swapReference(a, i, right - 1);\n\n // if k = i + 1, the a[i] is the kth smallest item\n if(k <= i)\n quickSelect(a, left, i - 1, k);\n else if(k > i + 1)\n quickSelect(a, i + 1, right, k);\n }\n else // Do an insertion sort on the subarray\n Insertionsort.insertionsort(a, left, right);\n }", "private static List<Integer> findKLargestElement(List<Integer> a, int k) {\n PriorityQueue<Integer> minHeap = new PriorityQueue<Integer>(k);\n int i = 0;\n while (i <= k) {\n minHeap.add(a.get(i)); // O(k)\n i++;\n }\n\n // Not insert rest of the n-k elements .. slowly..\n // We are trying to store all k greatest numbers in heap..\n // with min heap telling us which is the smallest among the k largest.\n for (i = k; i < a.size(); i++) {\n if (a.get(i) > minHeap.peek()) {\n minHeap.remove();\n minHeap.add(a.get(i));\n }\n }\n return Arrays.asList(minHeap.toArray(new Integer[k]));\n }", "public int kthSmallest(TreeNode root, int k) {\n\t\tint[] nums = new int[2];\n\t\tinorder(root, k, nums);\n\t\treturn nums[1];\n\t}", "public static int kSmall(int[] arrA, int start, int end, int k) {\r\n\t\tint left = start;\r\n\t\tint right = end;\r\n\t\tint pivot = start;\r\n\t\t\r\n\t\twhile (left <= right) {\r\n\t\t\twhile (left <= right && arrA[left] <= arrA[pivot])\r\n\t\t\t\tleft++;\r\n\t\t\twhile (left <= right && arrA[right] >= arrA[pivot])\r\n\t\t\t\tright--;\r\n\t\t\tif (left < right) {\r\n\t\t\t\tswap(arrA, left, right);\r\n\t\t\t\tleft++;\r\n\t\t\t\tright--;\r\n\t\t\t}\r\n\t\t}\r\n\t\tswap(arrA, pivot, right);\r\n\t\tif (pivot == k)\r\n\t\t\treturn arrA[pivot];\r\n\t\telse if (pivot < k)\r\n\t\t\r\n\t\t\treturn kSmall(arrA, pivot + 1, end, k);\r\n\t\telse\r\n\r\n\t\t\treturn kSmall(arrA, start, pivot - 1, k);\r\n\t}", "public static int QuickSelect(int[] arr, int k){\n if(k > arr.length || k <= 0){\n\t\t\treturn -1;\n\t\t}\n\t\t\n\t\treturn QuickSelect(arr, 0, arr.length-1 , k);\n }", "public int kthSmallest(int[][] matrix, int k) {\n int rows = matrix.length;\n int columns = matrix[0].length;\n if (rows == 1)\n return matrix[0][k-1];\n else if (columns == 1)\n return matrix[k-1][0];\n List<Integer> list = new LinkedList<>();\n for (int i = 0; i < rows; i++) {\n int index = Math.min(columns, (k - 1) / (i + 1));\n list = merge(list, k, matrix, i, index);\n }\n if (list.size() <= k){\n int result = list.size()< k? Integer.MAX_VALUE : list.get(list.size()-1);\n for (int i = 0; i < rows; i++) {\n int index = Math.min(columns, (k - 1) / (i + 1));\n if (index != columns)\n result = Math.min(result, matrix[i][index]);\n }\n return result;\n }\n return list.get(k-1);\n }", "public static int kthSmallest(HeapIntPriorityQueue pq, int k){\n //Exception clause\n if(k<1 || k>pq.size()){\n throw new IllegalArgumentException();\n }\n //Auxiliary queue\n Queue <Integer> holder = new LinkedList<Integer>();\n int toReturn = 0;\n //Cycling through to get to the kth position\n for (int i=0; i<k; i++){\n toReturn = pq.remove();\n holder.add(toReturn);\n }\n //Refilling the PriorityQueue from the auxiliary queue\n while (!holder.isEmpty()){\n pq.add(holder.remove());\n }\n return toReturn;\n }", "public int findKth (ArrayList<Integer> arr, int k) {\n int start = 0;\n int end = arr.size()-1;\n int pivotIndex = 0;\n \n while (start < end) {\n pivotIndex = partition(arr, start, end);\n if (pivotIndex == k) return arr.get(k);\n else if (pivotIndex < k) {\n start = pivotIndex+1;\n } else {\n end = pivotIndex-1;\n }\n }\n \n //System.out.println(start +\" - \"+ arr.get(k));\n return arr.get(k);\n }", "static int getMinimumCost(int k, Integer[] c) {\n\tArrays.sort(c, Collections.reverseOrder());\n\tint[] num = new int[k];\n\tint total = 0;\n\tfor (int ind = 0; ind < c.length; ind++) {\n\t int v = ind % k;\n\t total += (num[v]++ + 1) * c[ind];\n\t}\n\n\treturn total;\n }", "private static int solution1(int[] arr, int k) {\n\t\tif ( arr == null || arr.length < k ) {\n\t\t\treturn Integer.MIN_VALUE;\n\t\t}\n\t\t\n\t\tint[] a = Arrays.copyOfRange( arr, 0, arr.length );\n\t\tdisplayArray(a);\n\t\tArrays.sort(a);\n\t\tdisplayArray(a);\n\t\t\n\t\treturn a[a.length - k];\n\t}", "public int njjMin(double a[]) {\n\t\tint min = 0;\n\t\tint k = 0;\n\t\tint njjlen = a.length;\n\t\tint x = 0;\n\t\twhile (k < njjlen - 1) {\n\t\t\tif (a[x] < a[x + 1])\n\t\t\t\tmin = x;\n\t\t\telse\n\t\t\t\tmin = x + 1;\n\t\t\tk++;\n\t\t}\n\t\treturn min;\n\t}", "public int kthSmallest(int[][] matrix, int k) {\n int N = matrix.length;\n // Smallest element in the matrix\n int lowest = matrix[0][0];\n // Greatest element in the matrix\n int greatest = matrix[N - 1][N - 1];\n // Binary search in this range\n while (lowest < greatest) {\n // Middle value\n int middle = lowest + (greatest - lowest) / 2;\n // Position of the middle value in the sorted matrix\n int position = getPosition(matrix, middle);\n // if the position is less than the target\n if (position < k) {\n // Move to the right half\n lowest = middle + 1;\n } else {\n greatest = middle;\n }\n }\n return greatest;\n }", "public K min();", "private static Key min(Key... ks) {\n\t\tif (ks == null || ks.length == 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tKey min = ks[0];\n\t\tfor (int i = 1; i < ks.length; i++) {\n\t\t\tif (ks[i].compareTo(min) < 0) {\n\t\t\t\tmin = ks[i];\n\t\t\t}\n\t\t}\n\t\treturn min;\n\t}", "public static int select(int[] arr, int k){\n return select(arr, 0, arr.length, k);\n }", "@Test\n public void test_kmin_Integer_Collection3() {\n populate_i3();\n int actual = Selector.kmin(i3, 3, new CompareIntegerAscending());\n int expected = 6;\n Assert.assertEquals(\"3rd minimum not found\", expected, actual);\n }", "public static int min(int[] a){\r\n\t\tint m = a[0];\r\n\t\tfor( int i=1; i<a.length; i++ )\r\n if( m > a[i] ) m = a[i];\r\n\t\treturn m;\r\n\t}", "public int kthSmallest(TreeNode root, int k) {\n if (root == null || k <= 0) return -1;\n\n BSTIterator it = new BSTIterator(root);\n TreeNode node = null;\n while (k-- > 0) {\n node = it.next();\n if (node == null) return -1;\n }\n return node.val;\n }", "public static int indexOfSmallest(String[] inputs, int k){\n\t\tint minDex=k;\n\t\tfor (int i=k; i<inputs.length; i++){\n\t\t\tint cmp=inputs[i].compareTo(inputs[minDex]);\n\t\t\tif (cmp<0){\n\t\t\t\tminDex=i;\n\t\t\t}\n\t\t}\n\t\treturn minDex;\n\t}", "static int maxMin(int k, int[] arr) {\n Arrays.sort(arr);\n return IntStream.range(0, arr.length - k + 1).map(i -> arr[i + k - 1] - arr[i]).min().getAsInt();\n }", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n int N,i,k;\n System.out.println(\"enter array size\");\n N=sc.nextInt();\n int A[]=new int[N];\n System.out.println(\"enter array elements\");\n for(i=0;i<N;i++) {\n A[i]=sc.nextInt();\n }\n Arrays.sort(A);\n System.out.println(\"enter k\");\n k=sc.nextInt();\n System.out.println(\"kth smallest element is\"+A[k-1]);\n\t}", "public static int min(int[] a) throws IllegalArgumentException {\n if (a == null || a.length == 0) {\n throw new IllegalArgumentException();\n }\n int min = a[0];\n \n if (a.length > 1) {\n for (int i = 1; i < a.length; i++) {\n if (a[i] < min) {\n min = a[i];\n }\n }\n }\n return min;\n }", "private int findKthSmallest(LargeFile file, int k) {\n long lower = Integer.MIN_VALUE;\n long upper = Integer.MAX_VALUE;\n int res = Integer.MIN_VALUE;\n while (lower <= upper) {\n long mid = lower + (upper - lower) / 2;\n //count how many nums smaller than or equal to mid in file\n int count = 0;\n int kthNum = Integer.MIN_VALUE;\n while (file.hasNext()) {\n int next = file.next();\n if (next <= mid) {\n kthNum = Math.max(kthNum, next);\n count++;\n }\n }\n file.reset();\n if (count >= k) {\n //store potential ans\n res = kthNum;\n upper = mid - 1;\n } else {\n lower = mid + 1;\n }\n }\n return res;\n }", "public static int findKth(int k, int [] A, int aStart, int[] B, int bStart) {\n if (aStart >= A.length) {\n return B[bStart + k - 1];\n }\n if (bStart >= B.length) {\n return A[aStart + k - 1];\n }\n if (k == 1)\n return Math.min(A[aStart], B[bStart]);\n\n int aMid = aStart + k / 2 - 1;\n int bMid = bStart + k / 2 - 1;\n\n int aValue = aMid < A.length ? A[aMid] : Integer.MAX_VALUE;\n int bValue = bMid < B.length ? B[bMid] : Integer.MAX_VALUE;\n\n if (aValue < bValue) {\n return findKth(k - k / 2, A, aMid + 1, B, bStart);\n } else {\n return findKth(k - k / 2, A, aStart, B, bMid + 1);\n }\n }", "public int kthSmallest(TreeNode root, int k) {\n return dfsInOrderIterativeSol(root, k);\n }", "public static int findNextHigher(int[] a, int k) {\n\t int low = 0; \n\t int high = a.length - 1;\n\t \n\t int result = Integer.MAX_VALUE;\n\t while (low <= high) {\n\t int mid = (low + high) / 2;\n\t \n\t if (a[mid] > k) {\n\t result = a[mid]; /*update the result and continue*/\n\t high = mid - 1;\n\t } else {\n\t low = mid + 1;\n\t }\n\t } \n\t \n\t return result;\n\t}", "private Double find_kth_element(Object arr[], int left, int right, int k) {\n\t\t\n\t\tif (k >= 0 && k <= right - left + 1) {\n\t\t\tint pos = random_partition(arr, left, right), offset = pos - left;\n\t\t\tif (offset == k - 1)\n\t\t\t\treturn (Double)arr[pos];\n\t\t\telse if (offset > k - 1)\n\t\t\t\treturn find_kth_element(arr, left, pos - 1, k);\n\t\t\treturn find_kth_element(arr, pos + 1, right, k - pos + left - 1);\n\t\t}\n\t\treturn null; // return null when k is invalid\n\t}", "private static int solution( int[] arr, int k) {\n\t\tif ( arr == null || arr.length < k ) {\n\t\t\treturn Integer.MIN_VALUE;\n\t\t}\n\t\t\n\t\tint res = -1;\n\t\t\n\t\treturn res;\n\t\t\n\t}", "public int kth1(int k) {\n\t int[] dp = new int[k];\n\t int indexTwo = 0;\n\t int indexThree = 0; \n\t int numberOfTwo = 2;\n\t int numberOfThree = 3;\n\t int nextNumber = 1;\n\t dp[0] = 1;\n\t for (int i = 1 ; i < k ; i++) {\n\t nextNumber = Math.min(numberOfTwo, numberOfThree);\n\t dp[i] = nextNumber;\n\t if (nextNumber == numberOfTwo) {\n\t indexTwo += 1;\n\t numberOfTwo = dp[indexTwo] * 2;\n\t }\n\t if (nextNumber == numberOfThree) {\n\t indexThree +=1;\n\t numberOfThree = dp[indexThree] * 3;\n\t }\n\t }\n\t return nextNumber;\n\t }", "public static int quickSelectImpl(int k, CompareInt[] arr) {\n\t\tint select = Sorting.quickSelect(k, arr).val;\n\t\tquickSelectComparisons = CompareInt.countComparisons(arr, 0, arr.length - 1);\n\t\treturn select;\n\t}", "public int quickSelect(int[] a, int l, int h, int k){\n int pivot=a[h],pIndex=l;\n for(int i=l;i<h;i++){\n if(a[i]<=pivot){\n swap(a,i,pIndex);\n pIndex++;\n }\n }\n \n swap(a,pIndex,h);\n if(k==pIndex)return a[pIndex]);\n else if(k>pIndex){\n return quickSelect(a,l,pIndex-1,k);\n }else return quickSelect(a,pIndex+1,h,k); \n \n }", "@Test\n public void test_kmin_Integer_Collection1() {\n populate_i1();\n int actual = Selector.kmin(i1, 1, new CompareIntegerAscending());\n int expected = 2;\n Assert.assertEquals(\"1st minimum not found\", expected, actual);\n }", "public int findKthSmallestNumber(int[] nums, int k) {\n\t\t//Create a max heap with k elements\n\t\tPriorityQueue<Integer> maxHeap = new PriorityQueue<>((a,b) -> Integer.compare(b, a));\n\t\t\n\t\tint i = 0;\n\t\tfor(; i < k; ++i) {\n\t\t\tmaxHeap.add(nums[i]);\n\t\t}\n\t\t\n\t\t// Iterate over the remaining elements and remove root and add to heap\n\t\t// if the number is less than the root.\n\t\t\n\t\tfor(; i < nums.length; ++i) {\n\t\t\tif(maxHeap.peek() > nums[i]) {\n\t\t\t\tmaxHeap.poll();\n\t\t\t\tmaxHeap.add(nums[i]);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn maxHeap.poll();\n\t}", "public int[] getLeastNumbers2(int[] arr, int k) {\n if (k == 0) {\n return new int[0];\n }\n PriorityQueue<Integer> queue = new PriorityQueue<>((n1, n2) -> n2 - n1);\n for (int i = 0; i < k; i++) {\n queue.add(arr[i]);\n }\n for (int i = k; i < arr.length; i++) {\n if (arr[i] < queue.peek()) {\n queue.poll();\n queue.add(arr[i]);\n }\n }\n int[] results = new int[k];\n int i = 0;\n while (!queue.isEmpty()) {\n results[i++] = queue.poll();\n }\n return results;\n }", "public static int findNextHigherIndex(int[] a, int k) {\n\t\tint start = 0, end = a.length - 1; \n\t \n int ans = -1; \n while (start <= end) { \n int mid = (start + end) / 2; \n \n // Move to right side if target is \n // greater. \n if (a[mid] <= k) { \n start = mid + 1; \n } \n \n // Move left side. \n else { \n ans = mid; \n end = mid - 1; \n } \n } \n return ans;\n\t}", "public static int kthElement(int[] arr1, int[] arr2, int k) {\n\t\treturn 1; // not implemented yet, too hard!\n\t}", "public int kth(int[] a, int[] b, int k) {\n\t\treturn kth(a, 0, a.length - 1, b, 0, b.length - 1, k);\n\t}", "public static Node findKthSmallest(Node node, int k){\n if(node!=null){ // node มีตัวตน\n int l = size(node.left);\n if(k==l+1){\n return node;\n }else if(k<l+1){ //ถ้า k is น้อยกว่า size ค่าของ kth จะอยูที่ left subtree.\n return findKthSmallest(node.left,k);\n }else{\n return findKthSmallest(node.right,k-l-1); // recursive right-subtree และค่า k ลบด้วย size ทางขวา และตัวมันเอง(1)\n }\n }\n else {\n return null;\n }\n\n }", "public int KthInArrays(int[][] arrays, int k) {\n return 0;\n }", "private static int solution3( int[] arr, int k) {\n\t\tif ( arr == null || arr.length < k ) {\n\t\t\treturn Integer.MIN_VALUE;\n\t\t}\n\t\t\n\t\t// Store the first k elements in a temporary array\n\t\tint[] tmp = Arrays.copyOfRange( arr, 0, k);\n\t\tint[] a = Arrays.copyOfRange( arr, 0, arr.length);\n\t\tint res = Integer.MAX_VALUE;\n\t\t\n\t\t\n\t\t// Loop for n-k times: each times for element in a[k] to a[n-1], find the largest to switch with tmp[j] for j = 0 to k-1\n\t\tfor ( int i = 0; i < k; ++i ) {\n\t\t\tint max = tmp[i];\n\t\t\tint index = i;\n\t\t\t\n\t\t\tfor ( int j = k; j < a.length; ++j ) {\n\t\t\t\tif ( a[j] > max ) {\n\t\t\t\t\tmax = a[j];\n\t\t\t\t\tindex = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ( index != i ) {\n\t\t\t\ta[index] = tmp[i];\n\t\t\t\ttmp[i] = max;\n\t\t\t}\n\t\t\t\n\t\t\tres = Math.min(res, tmp[i]);\n\t\t}\n\t\t\n\t\t\n\t\treturn res;\n\t}", "public static int selectUsingPQ(int[] arr, int k){\n PriorityQueue<Integer> pq = new PriorityQueue<>();\n int i;\n\n //add first k elements in the priority queue\n for(i=0; i<k ; i++){\n pq.add(arr[i]);\n }\n\n while(i<arr.length){\n if(arr[i] > pq.peek()){\n pq.add(arr[i]);\n pq.remove();\n }\n i++;\n }\n\n // the top of the heap will be the kth largest element\n return pq.peek();\n }", "public int kthSmallest_3(TreeNode root, int k) {\n \tStack<TreeNode> stack =new Stack<TreeNode>();\n \twhile(root!=null){\n \t\tstack.push(root);\n \t\troot = root.left;\n \t}\n \t\n \twhile(k!=0){\n \t\tTreeNode n = stack.pop();\n \t\tk--;\n \t\tif(k==0)\n \t\t\treturn n.val;\n \t\tTreeNode right = n.right;\n \t\twhile(right!=null){\n \t\t\tstack.push(right);\n \t\t\tright =right.left;\n \t\t}\n \t}\n \treturn -10086;\n }", "private int quickSelect(int[] a, int low, int high,int k) {\n //using quick sort\n //put nums that are <= pivot to the left\n //put nums that are > pivot to the right\n int i = low, j = high, pivot = a[high];\n while(i < j) {\n if(a[i++] > pivot)\n swap(a, --i, --j);\n }\n swap(a, i, high);\n\n //count the nums that are <= pivot from low\n int m = i - low + 1;\n if(m == k)\n return i;\n //pivot is too big\n else if(m > k)\n return quickSelect(a, low, i-1, k);\n else\n return quickSelect(a, i+1, high, k - m);\n }", "public static int kthSmallest(TreeNode root, int k) {\n\n int count = countNode(root.left);\n if (k <= count) {\n return kthSmallest(root.left, k);\n } else if (k > count + 1) {\n return kthSmallest(root.right, k - 1 - count); // 1 is counted as current node\n }\n\n return root.val;\n }", "@Test\n public void test_kmin_Integer_Collection5() {\n List<Integer> i5 = new ArrayList<Integer>();\n i5.add(3);\n i5.add(7);\n i5.add(3);\n i5.add(3);\n i5.add(1);\n i5.add(9);\n i5.add(1);\n i5.add(1);\n i5.add(1);\n i5.add(5);\n int actual = Selector.kmin(i5, 2, new CompareIntegerAscending());\n int expected = 3;\n Assert.assertEquals(\"Failed in duplicate, size 10 list\", expected, actual);\n }", "public List<int[]> kSmallestPairs(int[] nums1, int[] nums2, int k) {\n return null;\n }", "public int kth(int[] a, int[] b, int k) {\n\t\treturn kthHelper(a, 0, b, 0, k);\n\t}", "private static int QuickSelect(int[] arr, int lo, int hi, int k){\n if(hi <= lo) return arr[lo];\n\t\t\n\t\tint p = pickPivot(arr, lo, hi);\n\t\tint j = partition(arr, lo, hi, p);\n\t\t\n\t\tif(k <= j){\n\t\t\treturn QuickSelect(arr, lo, j-1, k);\n\t\t} else if (k == j+1){\n\t\t\treturn arr[j];\n\t\t} else {\n\t\t\treturn QuickSelect(arr, j+1, hi, k);\n\t\t}\n }", "public static int heapImpl(int k, CompareInt[] arr) {\n\t\tMinHeap h = new MinHeap(arr.length);\n\t\t//add all the elements to a min-heap\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\th.add(arr[i]);\n\t\t}\n\t\t//remove the first k-1 elements (i.e. the k-1 smallest element)\n\t\tfor (int i = 0; i < k-1; i++) {\n\t\t\th.extractMin();\n\t\t}\n\t\tminHeapComparisons = CompareInt.countComparisons(arr, 1, arr.length - 1);\n\t\t//the next smallest element in the min-heap is the kth smallest element\n\t\treturn h.extractMin().val;\n\t}", "public int kth(int k) {\n\t int counter = 0;\n\t int begin = 0;\n\t while (counter < k) {\n\t begin++;\n\t if (check(begin) == 1) {\n\t counter++;\n\t }\n\t }\n\t return begin;\n\t }", "public boolean isKth(int[] a, int[] b, int k, int i) {\n if (i > k-1) return false;\n\n\n\n }", "public int[] kClosestNumbers(int[] A, int target, int k) {\n // write your code here\n if (A == null || A.length == 0) return null;\n int lastLower = findLastLower(A, target);\n int left = lastLower, right = left + 1;\n int[] res = new int[k];\n\n for (int i = 0; i < k; i++) {\n if (isLeftCloser(A, target, left, right)) {\n res[i] = A[left];\n left--;\n }\n else {\n res[i] = A[right];\n right++;\n }\n }\n return res;\n }", "private static int min_coins(int[] d, int k) {\n\t\t\n\t\treturn -1;\n\t}", "public K select(int k) {\n if (root == null) {\n return null;\n } else {\n int size = 0;\n Node curr = root;\n while (curr != null) {\n int leftSize = size(curr.left);\n if (leftSize + size > k) {\n curr = curr.left;\n } else if (leftSize + size < k) {\n size += leftSize + 1;\n curr = curr.right;\n } else {\n break;\n }\n }\n if (curr == null)\n return null;\n return curr.key;\n }\n }", "public static int[] maximumFromConsecutiveKElements(int[] a, int k) {\r\n int length = a.length;\r\n int outputLength = length - k + 1;\r\n int[] maximums = new int[outputLength];\r\n\r\n // O(n)\r\n for (int i = 0; i < outputLength; i++) {\r\n int currentMax = Integer.MIN_VALUE;\r\n // O(k)\r\n for (int j = 0; j < k; j++) {\r\n int currentValue = a[i + j];\r\n if (currentValue > currentMax) {\r\n currentMax = currentValue;\r\n }\r\n }\r\n maximums[i] = currentMax;\r\n }\r\n\r\n return maximums;\r\n }", "public K select(int k);", "public int kthSmallest(int[][] matrix, int k) {\n int rows = matrix.length;\n int columns = matrix[0].length;\n // setup a Min heap for getting the first k items in the heap\n PriorityQueue<Cell> minHeap = new PriorityQueue<Cell>(k, new Comparator<Cell>() {\n @Override\n public int compare(Cell o1, Cell o2) {\n if(o1.value == o2.value) return 0;\n return o1.value < o2.value ? -1 : 1;\n }\n });\n boolean[][] visited = new boolean[rows][columns];\n minHeap.offer(new Cell(0,0,matrix[0][0]));\n visited[0][0] = true;\n // BFS. Imaging the matrix is a graph, and neighbor is left, and down 1.\n // using BFS searching, but keep the data in min heap structure.\n for(int i = 0; i < k-1; i++){\n Cell curr = minHeap.poll();\n // two condition for putting the element into min heep\n // 1.if it is in the range of matrix\n // 2.if it is not visited.\n if(curr.row + 1 < rows && !visited[curr.row+1][curr.column]){\n minHeap.offer(new Cell(curr.row+1,curr.column,matrix[curr.row+1][curr.column]));\n visited[curr.row+1][curr.column] = true;\n }\n if(curr.column + 1 < columns && ! visited[curr.row][curr.column+1]){\n minHeap.offer(new Cell(curr.row,curr.column+1, matrix[curr.row][curr.column+1]));\n visited[curr.row][curr.column+1] = true;\n }\n }\n // after put first k item into min heap, we only need to get the top item\n return minHeap.peek().value;\n }", "@Test\n public void test_kmin_Integer_Collection4() {\n List<Integer> i4 = new ArrayList<Integer>();\n i4.add(2);\n i4.add(2);\n int actual = Selector.kmin(i4, 1, new CompareIntegerAscending());\n int expected = 2;\n Assert.assertEquals(\"Failed in duplicate, size 2 list\", expected, actual);\n }", "private static void findKLargestElementBad(List<Integer> a, int k) {\n PriorityQueue<Integer> maxHeap =\n new PriorityQueue<Integer>(a.size(), new MaxHeapComperator());\n for (Integer n : a) {\n maxHeap.add(n); // O(n)\n }\n int i = k + 1;\n while (i > 0) { // O(klogn)\n System.out.print(maxHeap.remove() + \" \");\n i--;\n }\n }", "private static int indexOfSmallest(int[] a, int start) {\n int minNum = a[start];\n int minIndex = start;\n for(int i=start; i<a.length; i++){\n if(a[i]<minNum){\n minNum = a[i];\n minIndex = i;\n }\n\n }\n return minIndex;\n }", "public static int[] getMinKthNearestN(double[][] pts, int k){\n if(k>= pts.length){\n int[] indexs = new int[k];\n for(int i = 0;i<indexs.length;i++){\n indexs[i] = i;\n }\n return indexs;\n }\n\n double[][] distanceTo = new double[pts.length][pts.length];\n int[][] indexs = new int[pts.length][pts.length];\n for(int i = 0; i<pts.length;i++){\n for(int j = 0; j<pts.length;j++){\n indexs[i][j] = j;\n distanceTo[i][j] = Math.pow(pts[i][0] - pts[j][0],2)+Math.pow(pts[i][1] - pts[j][1],2);\n }\n }\n\n\n for(int i = 0; i<pts.length;i++){\n iSort(indexs[i],distanceTo[i]);\n }\n\n double minKthNearestN = Double.POSITIVE_INFINITY;\n int pos = -1;\n for(int i = 0; i<pts.length;i++){\n if(distanceTo[i][k] < minKthNearestN){\n minKthNearestN = distanceTo[i][k];\n pos = i;\n }\n }\n int[] space = new int[k+1];\n for(int i = 0; i<=k; i++){\n space[i] = indexs[pos][i];\n }\n\n return space;\n }", "private int kthSmallestTreeNode(Tree tree, int k){\n List<Integer> values = new ArrayList<>();\n List<Integer> arr = printTree(tree, values);\n System.out.println(\"\\nPrinting out the whole list created by In order traversal\\n\");\n System.out.print(arr);\n return arr.get(k);\n}", "public int kthLargestElement(int k, int[] nums) {\n if(k<1||nums.length==0){\n return -1;\n }\n return quickSort(0,nums.length-1,k,nums);\n }", "public int subarraysWithKDistinct(int[] nums, int k) {\n return lessThanOrEqualToK(nums, k) - lessThanOrEqualToK(nums, k - 1);\n }", "public static void selectionSort(Comparable[] a) {\n int n = a.length;\n int im;\n for (int i = 0; i < n; i++) {\n im = i;\n for (int j = im; j < n; j++) {\n // Find the min\n if (less(a[j], a[im])) im = j;\n if (i != im) exch(a, i, im);\n }\n }\n }", "int min() {\n\t\t// added my sort method in the beginning to sort our array\n\t\tint n = array.length;\n\t\tint temp = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 1; j < (n - i); j++) {\n\t\t\t\tif (array[j - 1] > array[j]) {\n\t\t\t\t\ttemp = array[j - 1];\n\t\t\t\t\tarray[j - 1] = array[j];\n\t\t\t\t\tarray[j] = temp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// finds the first term in the array --> first term should be min if\n\t\t// sorted\n\t\tint x = array[0];\n\t\treturn x;\n\t}", "private static int select (int[] arr, int p, int n, int k){\n //threshold of 17\n if(n < 17 ){\n insertionSort(arr, p, p+n-1);\n return arr[p + n - k];\n }else{\n int q = randomizedPartition(arr,p,p+n-1);\n int left = q-p;\n int right = n - left - 1;\n if(right >= k)\n return select(arr,q+1,right,k);\n else if(right + 1 == k )\n return arr[q];\n else\n return select(arr,p,left,k-right-1);\n }\n }", "private static <Key extends Comparable<Key> > void swim(Key []a, int k){\n while(k>1 &&less(a, k/2, k)){\n exch(a, k/2, k);\n k=k/2;\n }\n }", "public String[] topKFrequent(String[] combo, int k) {\n if (combo == null || combo.length == 0 || k <= 0) {\n return new String[0];\n }\n Map<String, Integer> map = getMap(combo);\n PriorityQueue<Map.Entry<String, Integer>> minHeap = new PriorityQueue<>(k, new Comparator<Map.Entry<String, Integer>>() {\n @Override\n public int compare(Map.Entry<String, Integer> e1, Map.Entry<String, Integer> e2) {\n if (e1.getValue().equals(e2.getValue())) {\n return 0;\n }\n return e1.getValue() < e2.getValue() ? -1 : 1;\n }\n });\n for (Map.Entry<String, Integer> entry : map.entrySet()) {\n if (minHeap.size() < k) {\n minHeap.offer(entry);\n } else if (entry.getValue() > minHeap.peek().getValue()) {\n minHeap.poll();\n minHeap.offer(entry);\n }\n }\n String[] res = new String[minHeap.size()];\n for (int i = minHeap.size() - 1; i >= 0; i--) {\n res[i] = minHeap.poll().getKey();\n }\n return res;\n }", "public Key select(int k) {\n if (k < 0 || k >= size()) return null;\n Node x = select(root, k);\n return x.key;\n }", "public static int findKthLargest(int[] nums, int k) {\n\t\tint start = 0, end = nums.length - 1, index = nums.length - k;\n\t\twhile (start < end) {\n\t\t\tint pivot = partition(nums, start, end);\n\t\t\tif (pivot < index)\n\t\t\t\tstart = pivot + 1;\n\t\t\telse if (pivot > index)\n\t\t\t\tend = pivot - 1;\n\t\t\telse\n\t\t\t\treturn nums[pivot];\n\t\t}\n\t\treturn nums[start];\n\t}", "public int kthSmallest_binary_search(TreeNode root, int k) {\n int count = getNodeCount(root.left);\n if (k <= count) {\n return kthSmallest(root.left, k);\n } else if (k > count + 1) {\n return kthSmallest(root.right, k - 1 - count); // 1 is counted as current node\n }\n return root.val;\n }", "public static int floor(int[] a, int key) throws IllegalArgumentException {\n if (a == null || a.length == 0) {\n throw new IllegalArgumentException();\n }\n \n int candidate = Integer.MIN_VALUE;\n boolean happen = false;\n \n for (int i : a) {\n if (i <= key && i >= candidate) {\n candidate = i;\n happen = true;\n }\n }\n \n if (happen) {\n return candidate;\n }\n throw new IllegalArgumentException();\n }", "public int quickselect(int left, int right, int k_smallest) {\n\t\t\t\n\t\t\tif (left == right) // If the list contains only one element,\n\t\t\t{\n\t\t\t\treturn this.nums[left]; // return that element\n\t\t\t}\n\t\t\t\n\t\t\t// select a random pivot_index\n\t\t\tRandom random_num = new Random();\n\t\t\tint pivot_index = left + random_num.nextInt(right - left);\n\t\t\t\n\t\t\tpivot_index = partition(left, right, pivot_index);\n\t\t\t\n\t\t\t// the pivot is on (N - k)th smallest position\n\t\t\tif (k_smallest == pivot_index) {\n\t\t\t\treturn this.nums[k_smallest];\n\t\t\t}\n\t\t\t// go left side\n\t\t\telse if (k_smallest < pivot_index) {\n\t\t\t\treturn quickselect(left, pivot_index - 1, k_smallest);\n\t\t\t}\n\t\t\t// go right side\n\t\t\treturn quickselect(pivot_index + 1, right, k_smallest);\n\t\t}", "private static int partition(int[] array, int k) {\n final int item = array[k];\n\n swap(array, k, array.length - 1);\n k = array.length - 1;\n\n for (int i = 0; i < k; i++) {\n while (array[i] > item && k > i) {\n swap(array, i, k);\n swap(array, i, k - 1);\n k--;\n }\n }\n \n return k;\n }", "public static int maxSum(int[] a, int k) \n {\n PriorityQueue<Integer> pq = new PriorityQueue<>(); \n for (int x : a) \n pq.add(x); \n \n // Do k negations by removing a minimum element k times \n while (k-- > 0) \n { \n // Retrieve and remove min element \n int temp = pq.poll(); \n \n // Modify the minimum element and add back \n // to priority queue \n temp *= -1; \n pq.add(temp); \n } \n \n // Compute sum of all elements in priority queue. \n int sum = 0; \n for (int x : pq) \n sum += x; \n return sum; \n }", "public int findMinimum(int[] numbers, int length)\n {\n }", "public int solution1(int[] nums, int k) {\n final int N = nums.length;\n Arrays.sort(nums);\n \n return nums[N-k];\n }", "private static void findKClosestNumbers(int[] arr, int key, int k) {\n\n\t\tPriorityQueue<Integer> pq;\n\t\tint max = findMaxInArr(arr);\n\t\tint min = findMinInArr(arr);\n\n\t\tint maxDiff = Math.abs(key - max);\n\t\tint minDiff = Math.abs(key - min);\n\n\t\tif (maxDiff <= minDiff) {\n\t\t\tpq = new PriorityQueue<>(Collections.reverseOrder());\n\t\t} else {\n\t\t\tpq = new PriorityQueue<>();\n\t\t}\n\n\t\tfor (int e : arr) {\n\t\t\tpq.add(e);\n\t\t}\n\n\t\tint c = 0;\n\n\t\twhile (c < k) {\n\t\t\tSystem.out.println(pq.remove());\n\t\t\tc++;\n\t\t}\n\n\t}", "private static void min(int[] a) {\n int min = a[0];\n for(int i=1; i<a.length; i++){\n if(min > a[i]){\n min = a[i];\n }\n }\n System.out.println(\"Min\" + min);\n\n }", "public int kthLargestElement(int k, ArrayList<Integer> numbers) {\n\t\tthis.k = k;\r\n\t\tkthQsort(numbers, 0, numbers.size()-1);\r\n\t\treturn rs;\r\n }", "public static double orderStatistic(double[] a, int rank) {\n\t\tif (a == null || a.length <= rank)\n\t\t\tthrow new IndexOutOfBoundsException();\n\n\t\tint from = 0, to = a.length - 1;\n\n\t\t// if from == to we reached the kth element\n\t\twhile (from < to) {\n\t\t\tint r = from, w = to;\n\t\t\tdouble mid = a[(r + w) / 2];\n\n\t\t\t// stop if the reader and writer meets\n\t\t\twhile (r < w) {\n\n\t\t\t\tif (a[r] >= mid) { // put the large values at the end\n\t\t\t\t\tdouble tmp = a[w];\n\t\t\t\t\ta[w] = a[r];\n\t\t\t\t\ta[r] = tmp;\n\t\t\t\t\tw--;\n\t\t\t\t} else { // the value is smaller than the pivot, skip\n\t\t\t\t\tr++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// if we stepped up (r++) we need to step one down\n\t\t\tif (a[r] > mid)\n\t\t\t\tr--;\n\n\t\t\t// the r pointer is on the end of the first k elements\n\t\t\tif (rank <= r) {\n\t\t\t\tto = r;\n\t\t\t} else {\n\t\t\t\tfrom = r + 1;\n\t\t\t}\n\t\t}\n\n\t\treturn a[rank];\n\t}", "public int findKthLargest(int[] nums, int k) {\n if (nums.length == 0 || nums == null) return -1;\n PriorityQueue<Integer> pq = new PriorityQueue<>(k);\n for (int num : nums){\n if (pq.size() < k) pq.add(num);\n else if (num > pq.peek()){\n pq.remove();\n pq.add(num);\n }\n\n }\n return pq.peek();\n }", "public int numSubarrayProductLessThanK(int[] nums, int k) {\n return effective(nums, k);\n }", "public static void selectionSort(int[] a) {\r\n int temp; // catalyst variable for Integer swapping\r\n int spot; //location in array where minimum will be inserted\r\n int minimum; //location of minimum value in remainder\r\n\r\n for (spot = 0; spot < a.length - 1; spot++) {\r\n minimum = spot; //\r\n for (int i = spot + 1; i < a.length; i++) {\r\n if (a[i] < a[minimum]) {\r\n minimum = i; //if i is less than minimum, i is new minimum\r\n }\r\n }//end for i\r\n\r\n //swap a[spot] and a[minimum]\r\n temp = a[minimum];\r\n a[minimum] = a[spot];\r\n a[spot] = temp;\r\n }//end for spot\r\n }", "private static int getFirst( final Comparable[] c ) {\n\t\tfor ( int i = c.length - 2; i >= 0; --i )\n\t\t\tif ( c[ i ].compareTo( c[ i + 1 ] ) < 0 )\n\t\t\t\treturn i;\n\t\treturn -1;\n\t}", "private static int solution2( int[] arr, int k) {\n\t\tif ( arr == null || arr.length < k ) {\n\t\t\treturn Integer.MIN_VALUE;\n\t\t}\n\t\t\n\t\tint[] a = Arrays.copyOfRange( arr, 0, arr.length );\n\t\t\n\t\tfor ( int i = 1; i <= k; ++i ) {\n\t\t\tfor ( int j = 0; j < a.length - i; ++j ) {\n\t\t\t\tif ( a[j] > a[j+1] ) {\n\t\t\t\t\tint tmp = a[j];\n\t\t\t\t\ta[j] = a[j+1];\n\t\t\t\t\ta[j+1] = tmp;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//displayArray(a);\n\t\t}\n\t\t\n\t\treturn a[a.length-k];\n\t}" ]
[ "0.83517826", "0.7551771", "0.7149566", "0.69360334", "0.66148734", "0.65577126", "0.6533464", "0.6507685", "0.64425546", "0.63713217", "0.63600016", "0.63462955", "0.63196266", "0.6317461", "0.6301773", "0.62836295", "0.62759984", "0.62743574", "0.6226743", "0.62229025", "0.6213379", "0.6211789", "0.615717", "0.61473477", "0.6139123", "0.6100405", "0.60754246", "0.6051831", "0.6047904", "0.60153717", "0.6008252", "0.6005933", "0.5992777", "0.59813607", "0.59807295", "0.59737164", "0.59520847", "0.59474194", "0.5934785", "0.59118086", "0.5901021", "0.5856278", "0.5851015", "0.58475715", "0.5837765", "0.5826104", "0.58178455", "0.57745576", "0.57706326", "0.57632893", "0.57245", "0.5720827", "0.57182926", "0.5697825", "0.56942105", "0.5692978", "0.5689694", "0.5685943", "0.56831527", "0.56688076", "0.56646836", "0.56267667", "0.56207675", "0.5614643", "0.56031543", "0.5596033", "0.5571698", "0.5564478", "0.55482054", "0.5542883", "0.55236423", "0.55149853", "0.5511219", "0.54913145", "0.5472612", "0.5459052", "0.5459027", "0.54517883", "0.54516226", "0.54477763", "0.544627", "0.54315305", "0.54307956", "0.5419979", "0.54090804", "0.54068553", "0.5405275", "0.5403333", "0.5403274", "0.53902835", "0.53857607", "0.5385654", "0.53803253", "0.53726685", "0.5353545", "0.5350646", "0.5343162", "0.5341891", "0.5338459", "0.5333064" ]
0.63556176
11
Selects the kth maximum value from the array a. This method throws IllegalArgumentException if a is null, has zero length, or if there is no kth maximum value. Note that there is no kth maximum value if k a.length, or if k is larger than the number of distinct values in the array. The array a is not changed by this method.
public static <T> T kmax(Collection<T> c, int k, Comparator<T> comp) { //Check collectionfor null or empty, comp is null. if (c == null || comp == null) { throw new IllegalArgumentException(); } //Check if collection is empty. if (c.isEmpty()) { throw new NoSuchElementException(); } // Create Arraylist of collection and sort. List<T> copyList = new ArrayList(c); java.util.Collections.sort(copyList, comp); // Check if k < 0 or k > array length. if (k > copyList.size() || k <= 0) { throw new NoSuchElementException(); } // Count the number of unique values, remove duplicates. int dupCount = 0; int uniTot = 0; int origTot = copyList.size(); for (int i = 0;i < copyList.size();i++) { while (copyList.size() > 1 && i < copyList.size() - 1 && copyList.get(i) == copyList.get(i + 1)) { copyList.remove(i); dupCount++; } } uniTot = origTot - dupCount; // k is greater than the number of unique values. if (k > uniTot) { throw new NoSuchElementException(); } return copyList.get(uniTot - k); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int kmax(int[] a, int k) throws IllegalArgumentException {\n if (ktest(a, k)) {\n throw new IllegalArgumentException();\n }\n int[] array = Arrays.copyOf(a, a.length);\n int element;\n int increment = 1;\n \n Arrays.sort(array);\n element = array[array.length - 1];\n \n for (int i = array.length - 1; i > -1; i--) {\n if (element > array[i]) {\n element = array[i];\n increment ++;\n }\n if (k == increment) {\n return element;\n }\n }\n throw new IllegalArgumentException();\n }", "public static int findNextHigher(int[] a, int k) {\n\t int low = 0; \n\t int high = a.length - 1;\n\t \n\t int result = Integer.MAX_VALUE;\n\t while (low <= high) {\n\t int mid = (low + high) / 2;\n\t \n\t if (a[mid] > k) {\n\t result = a[mid]; /*update the result and continue*/\n\t high = mid - 1;\n\t } else {\n\t low = mid + 1;\n\t }\n\t } \n\t \n\t return result;\n\t}", "public static int[] maximumFromConsecutiveKElements(int[] a, int k) {\r\n int length = a.length;\r\n int outputLength = length - k + 1;\r\n int[] maximums = new int[outputLength];\r\n\r\n // O(n)\r\n for (int i = 0; i < outputLength; i++) {\r\n int currentMax = Integer.MIN_VALUE;\r\n // O(k)\r\n for (int j = 0; j < k; j++) {\r\n int currentValue = a[i + j];\r\n if (currentValue > currentMax) {\r\n currentMax = currentValue;\r\n }\r\n }\r\n maximums[i] = currentMax;\r\n }\r\n\r\n return maximums;\r\n }", "public static int findNextHigherIndex(int[] a, int k) {\n\t\tint start = 0, end = a.length - 1; \n\t \n int ans = -1; \n while (start <= end) { \n int mid = (start + end) / 2; \n \n // Move to right side if target is \n // greater. \n if (a[mid] <= k) { \n start = mid + 1; \n } \n \n // Move left side. \n else { \n ans = mid; \n end = mid - 1; \n } \n } \n return ans;\n\t}", "public int[] getMaxSub(int[] array, int k) {\r\n int out[] = new int[k];\r\n int idx = 0;\r\n for (int i = 0; i < array.length; i++) {\r\n // move the pointer back only when both condition happens\r\n // 1. current element is larger than last one in candidate\r\n // 2. there are enough elements in rest of array\r\n while (idx > 0 && array.length - i + idx > k && out[idx-1] < array[i]) {\r\n idx--;\r\n }\r\n if (idx < k)\r\n out[idx++] = array[i];\r\n }\r\n return out;\r\n }", "public int getKthVariantDimension(final int k) {\n int n = k - 1;\n\n if (n > dimensions) {\n System.out.println(\"ERROR: Non-existent dimension requested\");\n\n return -1;\n }\n\n boolean[] pastGreatest = new boolean[dimensions];\n double[] variances = new double[dimensions];\n ArrayList<Integer> ret = new ArrayList<Integer>();\n\n /* Make an array of variances and populate booles */\n for (int i = 0; i < dimensions; i++) {\n Double var = new Double(getCovariance(i, i));\n\n // System.out.println(\"[\" + i + \"]=\" + var);\n variances[i] = var.doubleValue();\n pastGreatest[i] = false;\n }\n\n /* Find k-th maximium variance */\n for (int i = 0; i <= n; i++) {\n double max = 0;\n int greatest = 0;\n\n for (int j = 0; j < dimensions; j++) {\n if (pastGreatest[j]) {\n continue;\n }\n\n if (variances[j] > max) {\n max = variances[j];\n greatest = j;\n }\n }\n\n pastGreatest[greatest] = true;\n ret.add(greatest);\n }\n\n return ret.get(n);\n }", "public static int findKthLargest(int[] nums, int k) { \n\t\t//sorts the array\n\t\tArrays.sort(nums);\n\t\t//determines kth largest\n\t\tint kthLargest = nums.length - k;\n\t\treturn nums[kthLargest];\n\t}", "private static int solution3( int[] arr, int k) {\n\t\tif ( arr == null || arr.length < k ) {\n\t\t\treturn Integer.MIN_VALUE;\n\t\t}\n\t\t\n\t\t// Store the first k elements in a temporary array\n\t\tint[] tmp = Arrays.copyOfRange( arr, 0, k);\n\t\tint[] a = Arrays.copyOfRange( arr, 0, arr.length);\n\t\tint res = Integer.MAX_VALUE;\n\t\t\n\t\t\n\t\t// Loop for n-k times: each times for element in a[k] to a[n-1], find the largest to switch with tmp[j] for j = 0 to k-1\n\t\tfor ( int i = 0; i < k; ++i ) {\n\t\t\tint max = tmp[i];\n\t\t\tint index = i;\n\t\t\t\n\t\t\tfor ( int j = k; j < a.length; ++j ) {\n\t\t\t\tif ( a[j] > max ) {\n\t\t\t\t\tmax = a[j];\n\t\t\t\t\tindex = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ( index != i ) {\n\t\t\t\ta[index] = tmp[i];\n\t\t\t\ttmp[i] = max;\n\t\t\t}\n\t\t\t\n\t\t\tres = Math.min(res, tmp[i]);\n\t\t}\n\t\t\n\t\t\n\t\treturn res;\n\t}", "private static int findKthSmallestElementUsingQuickSelect(int[] a, int low, int high, int k) {\n\n //CHECKS\n //In your original method check if array is null or empty\n //k is from 1 to n\n\n //If k is smaller than number of elements in array\n if (k > 0 && k <= a.length) {\n\n int pi = partition(a, low, high);\n\n if (pi == k - 1) {\n return a[pi];\n }\n if (pi > k - 1) {\n return findKthSmallestElementUsingQuickSelect(a, low, pi - 1, k);\n } else {\n return findKthSmallestElementUsingQuickSelect(a, pi + 1, high, k);\n }\n }\n return Integer.MAX_VALUE;\n }", "public int kthLargestElement(int k, int[] nums) {\n if(k<1||nums.length==0){\n return -1;\n }\n return quickSort(0,nums.length-1,k,nums);\n }", "public static int findKthLargest(int[] nums, int k) {\n\t\tint start = 0, end = nums.length - 1, index = nums.length - k;\n\t\twhile (start < end) {\n\t\t\tint pivot = partition(nums, start, end);\n\t\t\tif (pivot < index)\n\t\t\t\tstart = pivot + 1;\n\t\t\telse if (pivot > index)\n\t\t\t\tend = pivot - 1;\n\t\t\telse\n\t\t\t\treturn nums[pivot];\n\t\t}\n\t\treturn nums[start];\n\t}", "public int kthLargestElement(int k, ArrayList<Integer> numbers) {\n\t\tthis.k = k;\r\n\t\tkthQsort(numbers, 0, numbers.size()-1);\r\n\t\treturn rs;\r\n }", "private static void findKLargestElementBad(List<Integer> a, int k) {\n PriorityQueue<Integer> maxHeap =\n new PriorityQueue<Integer>(a.size(), new MaxHeapComperator());\n for (Integer n : a) {\n maxHeap.add(n); // O(n)\n }\n int i = k + 1;\n while (i > 0) { // O(klogn)\n System.out.print(maxHeap.remove() + \" \");\n i--;\n }\n }", "public int findKthLargest(int[] nums, int k) {\n if (nums.length == 0 || nums == null) return -1;\n PriorityQueue<Integer> pq = new PriorityQueue<>(k);\n for (int num : nums){\n if (pq.size() < k) pq.add(num);\n else if (num > pq.peek()){\n pq.remove();\n pq.add(num);\n }\n\n }\n return pq.peek();\n }", "private static List<Integer> findKLargestElement(List<Integer> a, int k) {\n PriorityQueue<Integer> minHeap = new PriorityQueue<Integer>(k);\n int i = 0;\n while (i <= k) {\n minHeap.add(a.get(i)); // O(k)\n i++;\n }\n\n // Not insert rest of the n-k elements .. slowly..\n // We are trying to store all k greatest numbers in heap..\n // with min heap telling us which is the smallest among the k largest.\n for (i = k; i < a.size(); i++) {\n if (a.get(i) > minHeap.peek()) {\n minHeap.remove();\n minHeap.add(a.get(i));\n }\n }\n return Arrays.asList(minHeap.toArray(new Integer[k]));\n }", "@Test\n public void test_kmax_Integer_Collection3() {\n populate_i3();\n int actual = Selector.kmax(i3, 3, new CompareIntegerAscending());\n int expected = 6;\n Assert.assertEquals(\"3rd maximum not found\", expected, actual);\n }", "public static int QuickSelect(int[] arr, int k){\n if(k > arr.length || k <= 0){\n\t\t\treturn -1;\n\t\t}\n\t\t\n\t\treturn QuickSelect(arr, 0, arr.length-1 , k);\n }", "public static int kmin(int[] a, int k) throws IllegalArgumentException {\n if (ktest(a, k)) {\n throw new IllegalArgumentException();\n }\n int[] array = Arrays.copyOf(a, a.length);\n int increment = 1;\n int element;\n \n Arrays.sort(array);\n element = array[0];\n \n for (int i = 0; i < array.length; i++) {\n if (element < array[i]) {\n element = array[i];\n increment ++;\n }\n if (k == increment) {\n return element;\n }\n }\n throw new IllegalArgumentException();\n }", "public static int maxSum(int[] a, int k) \n {\n PriorityQueue<Integer> pq = new PriorityQueue<>(); \n for (int x : a) \n pq.add(x); \n \n // Do k negations by removing a minimum element k times \n while (k-- > 0) \n { \n // Retrieve and remove min element \n int temp = pq.poll(); \n \n // Modify the minimum element and add back \n // to priority queue \n temp *= -1; \n pq.add(temp); \n } \n \n // Compute sum of all elements in priority queue. \n int sum = 0; \n for (int x : pq) \n sum += x; \n return sum; \n }", "private static Key max(Key... ks) {\n\t\tif (ks == null || ks.length == 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tKey max = ks[0];\n\t\tfor (int i = 1; i < ks.length; i++) {\n\t\t\tif (ks[i].compareTo(max) > 0) {\n\t\t\t\tmax = ks[i];\n\t\t\t}\n\t\t}\n\t\treturn max;\n\t}", "public static ArrayList<Integer> kLargest(int input[], int k) {\n\tMaxPQComparator maxPQComparator = new MaxPQComparator();\n\t\tPriorityQueue<Integer> pQueue = new PriorityQueue<>(maxPQComparator);\n\t\tArrayList<Integer> output = new ArrayList<>();\n\t\tfor (int i = 0; i < input.length; i++) {\n\t\t\tpQueue.add(input[i]);\n\t\t}\n\t\twhile (pQueue.size() != k) {\n\t\t\tpQueue.remove();\n\t\t}\n\t\twhile (!pQueue.isEmpty()) {\n\t\t\toutput.add(pQueue.remove());\n\t\t}\n\t\treturn output;\t\n\t}", "private static int getSmallerThanOrEqualToKCount(int[] a, int k){\n int left=0, right=a.length-1;\n while(left<right){\n int mid=left+(right+1-left)/2;\n if(a[mid]>k){\n right=mid-1;\n } else{\n left=mid;\n }\n }\n return left-0+1;\n }", "public static int KthLargestWithMaxHeap(Integer[] arr, int k) {\n\t\tHeap<Integer> heap = new Heap<>(arr, false);\n\n\t\t// k removal from heap\n\t\tfor (int i = 0; i < k - 1; i++) {\n\t\t\theap.remove();\n\t\t}\n\n\t\treturn heap.getHP();\n\n\t\t// complexity is n+klogn\n\t}", "public static int findMax(int[] a) {\r\n int max = a[0];\r\n\r\n //10th error , n = 1\r\n for (int n = 1; n < a.length; n++) {\r\n if (a[n] > max) {\r\n max = a[n];\r\n }\r\n }\r\n return max;\r\n\r\n }", "public K max();", "@Test\n public void test_kmax_Integer_Collection1() {\n populate_i1();\n int actual = Selector.kmax(i1, 1, new CompareIntegerAscending());\n int expected = 8;\n Assert.assertEquals(\"1st maximum not found\", expected, actual);\n }", "public static int select(int[] arr, int k){\n return select(arr, 0, arr.length, k);\n }", "public static int kthLargest(Node node, int k){\n return 0;\n }", "public static int selectUsingPQ(int[] arr, int k){\n PriorityQueue<Integer> pq = new PriorityQueue<>();\n int i;\n\n //add first k elements in the priority queue\n for(i=0; i<k ; i++){\n pq.add(arr[i]);\n }\n\n while(i<arr.length){\n if(arr[i] > pq.peek()){\n pq.add(arr[i]);\n pq.remove();\n }\n i++;\n }\n\n // the top of the heap will be the kth largest element\n return pq.peek();\n }", "@Test\n public void test_kmax_Integer_Collection5() {\n List<Integer> i5 = new ArrayList<Integer>();\n i5.add(3);\n i5.add(7);\n i5.add(3);\n i5.add(3);\n i5.add(1);\n i5.add(9);\n i5.add(1);\n i5.add(1);\n i5.add(1);\n i5.add(5);\n int actual = Selector.kmax(i5, 5, new CompareIntegerAscending());\n int expected = 1;\n Assert.assertEquals(\"Failed in duplicate, size 10 list\", expected, actual);\n }", "public static int findKthLargest(int[] nums, int k) {\n\n //min heap smallest element first\n PriorityQueue<Integer> heap = new PriorityQueue<Integer>((n1, n2) -> n1 - n2);\n\n //keep k largest elements in the heap\n for (int n : nums) {\n heap.add(n);\n if (heap.size() > k) {\n heap.poll();\n }\n }\n return heap.poll();\n }", "public int maxSubArrayLen(int[] nums, int k) {\n if(nums == null || nums.length == 0) {\n return 0;\n }\n int maxLength = 0;\n int[] sums = new int[nums.length];\n sums[0] = nums[0];\n HashMap<Integer, Integer> map = new HashMap<>();\n map.put(sums[0], 0);\n for(int i = 1; i < nums.length; i++) {\n sums[i] = sums[i - 1] + nums[i];\n map.put(sums[i], i);\n if(sums[i] == k && i + 1 > maxLength) {\n maxLength = i + 1;\n }\n Integer index = map.get(sums[i] - k);\n if(index == null) {\n continue;\n }\n int length = i - index; // length = i - (index + 1) + 1 = i - index\n if(length > maxLength) {\n maxLength = length; \n }\n }\n return maxLength;\n }", "int findKthSmallest(int[] a, int[] b, int aLength, int bLength, int k) {\n\tif(aLength > bLength)\n\t\treturn findKthSmallest(b,a,bLength,aLength,k);\n\t//Base cases.\n\tif(aLength ==0 && bLength >0)\n\t\treturn b[k-1];\n\tif (k ==1)\n\t\treturn Math.min(a[0],b[0]);\n\t\n\tint i = Math.min(k/2,aLength); // k is always less than length of array.\n\tint j= Math.min(k/2,bLength);\n\t\n\tif(a[i-1] >b[j-1])// slice b, find the k-jth element.\n\t\treturn findKthSmallest(a, Arrays.copyOfRange(b,j,b.length),aLength,bLength-j,k-j);\n\telse \n\t\treturn findKthSmallest(Arrays.copyOfRange(a,i,a.length),b,aLength-i,b,k-i);\n}", "@Test\n public void test_kmax_Integer_Collection2() {\n populate_i2();\n int actual = Selector.kmax(i2, 2, new CompareIntegerDescending());\n int expected = 3;\n Assert.assertEquals(\"2nd maximum in descending comparator not found\", expected, actual);\n }", "public static int max(int[] a) {\n\t\tint b=a[0];\r\n\t\tfor(int i=0;i<a.length;i++) {\r\n\t\t\tif(a[i]>b) {\r\n\t\t\t\tb=a[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn b;\r\n\t}", "public int findKth (ArrayList<Integer> arr, int k) {\n int start = 0;\n int end = arr.size()-1;\n int pivotIndex = 0;\n \n while (start < end) {\n pivotIndex = partition(arr, start, end);\n if (pivotIndex == k) return arr.get(k);\n else if (pivotIndex < k) {\n start = pivotIndex+1;\n } else {\n end = pivotIndex-1;\n }\n }\n \n //System.out.println(start +\" - \"+ arr.get(k));\n return arr.get(k);\n }", "private static <AnyType extends Comparable<? super AnyType>> void quickSelect(AnyType[] a, int left, int right, int k)\n {\n if(left + CUTOFF <= right)\n {\n AnyType pivot = median3(a, left, right);\n\n // Begin partitioning\n int i = left, j = right - 1;\n for( ; ; )\n {\n while(a[++i].compareTo(pivot) < 0);\n while(a[--j].compareTo(pivot) > 0);\n if(i < j)\n CommonFunc.swapReference(a, i, j);\n else \n break;\n }\n\n CommonFunc.swapReference(a, i, right - 1);\n\n // if k = i + 1, the a[i] is the kth smallest item\n if(k <= i)\n quickSelect(a, left, i - 1, k);\n else if(k > i + 1)\n quickSelect(a, i + 1, right, k);\n }\n else // Do an insertion sort on the subarray\n Insertionsort.insertionsort(a, left, right);\n }", "public static int max(int[] a){\r\n\t\tint m = a[0];\r\n\t\tfor( int i=1; i<a.length; i++ )\r\n\t\t\tif( m < a[i] ) m = a[i];\r\n\t\treturn m;\r\n\t}", "private Double find_kth_element(Object arr[], int left, int right, int k) {\n\t\t\n\t\tif (k >= 0 && k <= right - left + 1) {\n\t\t\tint pos = random_partition(arr, left, right), offset = pos - left;\n\t\t\tif (offset == k - 1)\n\t\t\t\treturn (Double)arr[pos];\n\t\t\telse if (offset > k - 1)\n\t\t\t\treturn find_kth_element(arr, left, pos - 1, k);\n\t\t\treturn find_kth_element(arr, pos + 1, right, k - pos + left - 1);\n\t\t}\n\t\treturn null; // return null when k is invalid\n\t}", "private static int solution1(int[] arr, int k) {\n\t\tif ( arr == null || arr.length < k ) {\n\t\t\treturn Integer.MIN_VALUE;\n\t\t}\n\t\t\n\t\tint[] a = Arrays.copyOfRange( arr, 0, arr.length );\n\t\tdisplayArray(a);\n\t\tArrays.sort(a);\n\t\tdisplayArray(a);\n\t\t\n\t\treturn a[a.length - k];\n\t}", "int arraykey(int max);", "public static int max(int[] a) throws IllegalArgumentException {\n if (a == null || a.length == 0) {\n throw new IllegalArgumentException();\n }\n int max = a[0];\n \n if (a.length > 1) {\n for (int i = 1; i < a.length; i++) {\n if (a[i] > max) {\n max = a[i];\n }\n }\n }\n return max;\n }", "private static int solution2( int[] arr, int k) {\n\t\tif ( arr == null || arr.length < k ) {\n\t\t\treturn Integer.MIN_VALUE;\n\t\t}\n\t\t\n\t\tint[] a = Arrays.copyOfRange( arr, 0, arr.length );\n\t\t\n\t\tfor ( int i = 1; i <= k; ++i ) {\n\t\t\tfor ( int j = 0; j < a.length - i; ++j ) {\n\t\t\t\tif ( a[j] > a[j+1] ) {\n\t\t\t\t\tint tmp = a[j];\n\t\t\t\t\ta[j] = a[j+1];\n\t\t\t\t\ta[j+1] = tmp;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//displayArray(a);\n\t\t}\n\t\t\n\t\treturn a[a.length-k];\n\t}", "public int findKthLargestValueInBst(BST tree, int k) {\n\n Node current = new Node(-1, 0);\n\n findKthLargestValueInBst(tree, current, k);\n\n return current.value;\n }", "public int kth(int[] a, int[] b, int k) {\n\t\treturn kth(a, 0, a.length - 1, b, 0, b.length - 1, k);\n\t}", "public K select(int k);", "private static int QuickSelect(int[] arr, int lo, int hi, int k){\n if(hi <= lo) return arr[lo];\n\t\t\n\t\tint p = pickPivot(arr, lo, hi);\n\t\tint j = partition(arr, lo, hi, p);\n\t\t\n\t\tif(k <= j){\n\t\t\treturn QuickSelect(arr, lo, j-1, k);\n\t\t} else if (k == j+1){\n\t\t\treturn arr[j];\n\t\t} else {\n\t\t\treturn QuickSelect(arr, j+1, hi, k);\n\t\t}\n }", "public int quickSelect(int[] a, int l, int h, int k){\n int pivot=a[h],pIndex=l;\n for(int i=l;i<h;i++){\n if(a[i]<=pivot){\n swap(a,i,pIndex);\n pIndex++;\n }\n }\n \n swap(a,pIndex,h);\n if(k==pIndex)return a[pIndex]);\n else if(k>pIndex){\n return quickSelect(a,l,pIndex-1,k);\n }else return quickSelect(a,pIndex+1,h,k); \n \n }", "public static int maxSubArrayLen(int[] nums, int k) {\n Map<Integer, Integer> map = new HashMap<>();\n int sum = 0, maxLen = 0;\n for (int i = 0; i < nums.length; i++) {\n sum += nums[i];\n\n if (!map.containsKey(sum)) {\n map.put(sum, i);\n }\n\n if (sum == k) {\n maxLen = i + 1;\n } else {\n int diff = sum - k;\n if (map.containsKey(diff)) {\n maxLen = Math.max(maxLen, i - map.get(diff));\n }\n }\n }\n return maxLen;\n }", "public boolean isKth(int[] a, int[] b, int k, int i) {\n if (i > k-1) return false;\n\n\n\n }", "public int nthLargest(int i) {\n Vector<Integer> rVector;\n if (i <= 0 || i > arr.size()){\n throw new IllegalArgumentException();\n } else {\n rVector = quickSort(arr, i);\n return rVector.get(0);\n }\n }", "public static int get_max(Integer[] a){\n int max = Integer.MIN_VALUE;\n\n for (int i = 0; i < a.length; i++){\n if (a[i] > max);\n max = a[i];\n }\n return max;\n }", "public static int secondaryArgmax(double[] a) {\n\t\tint mi = argmax(a);\n\t\t// scan left until increasing\n\t\tint i;\n\t\tfor (i=mi-1; i>=0 && a[i]<=a[i+1]; i--);\n\t\tint l = argmax(a,0,i+1);\n\t\tfor (i=mi+1; i<a.length && a[i]<=a[i-1]; i++);\n\t\tint r = argmax(a,i,a.length);\n\t\tif (l==-1) return r;\n\t\tif (r==-1) return l;\n\t\treturn a[l]>=a[r]?l:r;\n\t}", "int rank(int[] array, int k) {\n\t\tif (k >= array.length) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\treturn rank(array, k, 0, array.length - 1);\n\t}", "private static void p215() {\n// int[] nums = {5, 2, 1, 8, 3};\n// int[] nums = {5, 2, 1, 8, 3, 5, 7};\n int[] nums = {3, 2, 3, 1, 2, 4, 5, 5, 6};\n int k = 4;\n// int ret1 = findKthLargestUsingSort(nums, k);\n// System.out.println(ret1);\n int ret2 = findKthLargestUsingPQ(nums, k);\n// System.out.println(ret2);\n int ret3 = findKthLargestUsingQuickSort(nums, k);\n System.out.println(ret3);\n }", "public int findKthLargest_Heap(int[] nums, int k) {\n\t\tPriorityQueue<Integer> heap = new PriorityQueue<>(Comparator.comparingInt(n1 -> n1));\n\t\tList<Double> lis = new ArrayList<>();\n\t\t// keep k largest elements in the heap\n\t\tfor (int n : nums) {\n\t\t\theap.add(n);\n\t\t\tif (heap.size() > k) {\n\t\t\t\theap.poll();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// output\n\t\treturn heap.poll();\n\t}", "private int quickSelect(int[] a, int low, int high,int k) {\n //using quick sort\n //put nums that are <= pivot to the left\n //put nums that are > pivot to the right\n int i = low, j = high, pivot = a[high];\n while(i < j) {\n if(a[i++] > pivot)\n swap(a, --i, --j);\n }\n swap(a, i, high);\n\n //count the nums that are <= pivot from low\n int m = i - low + 1;\n if(m == k)\n return i;\n //pivot is too big\n else if(m > k)\n return quickSelect(a, low, i-1, k);\n else\n return quickSelect(a, i+1, high, k - m);\n }", "private static int solution( int[] arr, int k) {\n\t\tif ( arr == null || arr.length < k ) {\n\t\t\treturn Integer.MIN_VALUE;\n\t\t}\n\t\t\n\t\tint res = -1;\n\t\t\n\t\treturn res;\n\t\t\n\t}", "public int maxFrequency(int[] nums, int k) {\n Arrays.sort(nums);\n int n = nums.length;\n int res = 1;\n for (int i = 0, j = 1, cost = 0; j < n; ) {\n int nextCost = cost + (nums[j] - nums[j - 1]) * (j - i);\n if (nextCost <= k) {\n res = Math.max(res, ++j - i);\n cost = nextCost;\n } else {\n cost -= nums[j - 1] - nums[i++];\n }\n }\n return res;\n }", "public int subarraysWithKDistinct(int[] nums, int k) {\n return lessThanOrEqualToK(nums, k) - lessThanOrEqualToK(nums, k - 1);\n }", "public int maxFrequency2(int[] nums, int k) {\n Arrays.sort(nums);\n int i = 0;\n int j = 0;\n long sum = k;\n for (int n = nums.length; j < n; j++) {\n sum += nums[j];\n if (sum < (long)nums[j] * (j - i + 1)) {\n sum -= nums[i++];\n }\n }\n return j - i;\n }", "public static int findMaxSumSubArray(int k, int[] arr) {\n int windowSum = 0, maxSum = Integer.MIN_VALUE;\n int windowStart = 0;\n for (int windowEnd = 0; windowEnd < arr.length; windowEnd++) {\n windowSum += arr[windowEnd]; // add the next element\n // slide the window, we don't need to slide if we've not hit the required window size of 'k'\n if (windowEnd >= k - 1) {\n maxSum = Math.max(maxSum, windowSum);\n windowSum -= arr[windowStart]; // subtract the element going out\n windowStart++; // slide the window ahead\n }\n }\n return maxSum;\n }", "public static int[] topKFrequent(int[] nums, int k) {\n int[] a = new int[k];\n Map<Integer, Integer> map = new HashMap<Integer, Integer>();\n for (int i = 0; i < nums.length; i++) {\n if (map.containsKey(nums[i])) {\n map.put(nums[i], map.get(nums[i]) + 1);\n } else {\n map.put(nums[i], 1);\n }\n }\n\n PriorityQueue<Map.Entry<Integer, Integer>> maxHeap = new PriorityQueue<Map.Entry<Integer, Integer>>(k, Map.Entry.<Integer, Integer>comparingByValue().reversed());\n for (Map.Entry<Integer, Integer> e : map.entrySet()) {\n maxHeap.offer(e);\n }\n\n while (k > 0) {\n a[--k] = maxHeap.poll().getKey();\n }\n\n return a;\n }", "int sumKOfLargest(int[] array, int k){\n int heapSize = array.length;\n int sum = 0;\n buildMaxHeap(array,heapSize);\n for(int i = 0; i< k ; i++){\n sum = sum+array[0];\n extractMax(array,heapSize);\n heapSize--;\n heapify(array,i,heapSize);\n }\n return sum;\n }", "public int KthInArrays(int[][] arrays, int k) {\n return 0;\n }", "public int kth(int[] a, int[] b, int k) {\n\t\treturn kthHelper(a, 0, b, 0, k);\n\t}", "public K select(int k) {\n if (root == null) {\n return null;\n } else {\n int size = 0;\n Node curr = root;\n while (curr != null) {\n int leftSize = size(curr.left);\n if (leftSize + size > k) {\n curr = curr.left;\n } else if (leftSize + size < k) {\n size += leftSize + 1;\n curr = curr.right;\n } else {\n break;\n }\n }\n if (curr == null)\n return null;\n return curr.key;\n }\n }", "private static int[] topKFrequent(int[] nums, int k) {\n HashMap<Integer, Integer> map = new HashMap<>();\n for (int n: nums){\n map.put(n, map.getOrDefault(n, 0) + 1);\n }\n\n // Step2: Build max heap.\n PriorityQueue<Integer> pq = new PriorityQueue<>();\n for (int value: map.values()){\n pq.add(value);\n if (pq.size() > k){\n pq.poll();\n }\n }\n\n // Step3: Build result list.\n ArrayList<Integer> retList = new ArrayList<>();\n for (int n: pq){\n for (Map.Entry<Integer, Integer> entry: map.entrySet()){\n if (n == entry.getValue()){\n retList.add(entry.getKey());\n }\n }\n }\n\n return retList.stream().distinct().mapToInt(x -> x).toArray();\n }", "double largestNumber(double[] a) {\n\t\tdouble max = a[0];\n\t\tdouble no = 0;\n\t\tfor (int index = 1; index < a.length; index++) {\n\t\t\tif (max > a[index] && max > a[index + 1]) {\n\t\t\t\tno = max;\n\t\t\t\tbreak;\n\t\t\t} else if (a[index] > max && a[index] > a[index + 1]) {\n\t\t\t\tno = a[index];\n\t\t\t\tbreak;\n\t\t\t} else if (a[index + 1] > max && a[index + 1] > a[index]) {\n\t\t\t\tno = a[index + 1];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn no;\n\t}", "public int[] maxSlidingWindow_1(int[] nums, int k) {\n\t\tint maxIndex = 0;\n\t\tint currStorePtr=0;\n\t\tfor(int i=0;i<nums.length;i++){\n\t\t\tif(i<= maxIndex +k-1){\n\t\t\t\tif(nums[i]>=nums[maxIndex]) {\n\t\t\t\t\tmaxIndex =i;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\tmaxIndex =i-k+1;\n\t\t\t\tfor(int j=i-k+1;j<=i;j++){\n\t\t\t\t\tif(nums[j]>=nums[maxIndex]) maxIndex =j;\n\t\t\t\t}\n\t\t\t}\n\t\t\tnums[currStorePtr]=nums[maxIndex];\n\n\t\t\tif(i>=k-1){\n\t\t\t\tcurrStorePtr++;\n\t\t\t}\n\t\t}\n\t\treturn Arrays.copyOfRange(nums,0,currStorePtr);\n\t}", "static int maxMin(int k, int[] arr) {\n Arrays.sort(arr);\n return IntStream.range(0, arr.length - k + 1).map(i -> arr[i + k - 1] - arr[i]).min().getAsInt();\n }", "private static int maxValue(int[] a) {\n\t\tint max_value =0;\r\n\t\tint current_max=0;\r\n\t\t\r\n\t\tfor(int i=0;i<a.length;i++)\r\n\t\t{\r\n\t\t\tcurrent_max += a[i];\r\n\t\t\tmax_value= Math.max(max_value, current_max);\r\n\t\t\tif(a[i]<0)\r\n\t\t\t\tcurrent_max=0;\r\n\t\t}\r\n\t\t\r\n\t\treturn max_value;\r\n\t}", "public static int ceiling(int[] a, int key) throws IllegalArgumentException {\n if (a == null || a.length == 0) {\n throw new IllegalArgumentException();\n }\n \n int candidate = Integer.MAX_VALUE;\n boolean happen = false;\n \n for (int i : a) {\n if (i >= key && i <= candidate) {\n candidate = i;\n happen = true;\n }\n }\n \n if (happen) {\n return candidate;\n }\n throw new IllegalArgumentException();\n }", "public int solution2(int[] nums, int k) {\n PriorityQueue<Integer> pq = new PriorityQueue<Integer>();\n \n for (int i : nums) {\n pq.offer(i);\n \n if (pq.size() > k) {\n pq.poll();\n }\n }\n \n \n return pq.peek();\n }", "public static int[] mostCompetitive(int[] nums, int k) {\n int[] copy = Arrays.copyOf(nums, nums.length); // 复制一个数组\n Arrays.sort(copy); // 排序\n for (int value : copy) { // 挨个顺序作为最小竞争子序列的头元素\n for (int j = 0; j < nums.length; j++) {\n if (nums[j] == value) {\n // 判断后续元素个数可够k长度\n if(k == 1){\n int[] ret = new int[1];\n ret[0] = nums[j];\n return ret;\n }\n if (j + k > nums.length) break;\n else if (j + k == nums.length) return Arrays.copyOfRange(nums, j, nums.length);\n else {\n int[] child = Arrays.copyOfRange(nums, j + 1, nums.length);\n int[] childMost = mostCompetitive(child, k - 1);\n System.out.println(Arrays.toString(childMost));\n // 取前k-1即为最优解\n int[] ret = new int[k];\n ret[0] = nums[j];\n System.arraycopy(childMost, 0, ret, 1, k - 1);\n System.out.println(Arrays.toString(ret));\n return ret;\n }\n }\n }\n }\n // [10, 23, 61, 62, 34, 41, 80, 25, 91, 43, 4, 75, 65, 13, 37, 41, 46, 90, 55, 8, 85, 61, 95, 71]\n // [10, 23, 61, 62, 34, 41, 80, 25, 91, 43, 4, 75, 65, 13, 37, 41, 46, 90, 55, 8, 85, 61, 95, 71]\n /* 2\n 4 3 3 5 4 9 6 3\n 3\n 3 5 4 9 6 3\n 2\n 5 4 9 6\n 1\n */\n return Arrays.copyOf(nums, k); // 这步不会执行\n }", "private static void findStrongestMMAFighter(int[] arr, int k)\n\t{\n\n\t\tDeque<Integer> dq = new LinkedList<Integer>();\n\t\t// Dequeue first element will be the largest one always\n\t\tint i = 0;\n\t\t// We have to process first k elements separately\n\t\tfor (; i < k; i++)\n\t\t{\n\t\t\twhile (!dq.isEmpty() && arr[i] >= arr[dq.peekLast()])\n\t\t\t{\n\t\t\t\tdq.removeLast();\n\t\t\t}\n\t\t\tdq.addLast(i);\n\n\t\t}\n\t\tfor (; i < arr.length; i++)\n\t\t{\n\n\t\t\t// First element will always be larger\n\t\t\tSystem.out.print(arr[dq.peekFirst()] + \" \");\n\n\t\t\t// remove elements which are not in current window\n\t\t\twhile (!dq.isEmpty() && dq.peekFirst() <= i - k)\n\t\t\t{\n\t\t\t\tdq.removeFirst();\n\t\t\t}\n\t\t\t// Remove unwanted elements\n\t\t\twhile (!dq.isEmpty() && arr[i] > arr[dq.peekLast()])\n\t\t\t{\n\t\t\t\tdq.removeLast();\n\t\t\t}\n\t\t\tdq.addLast(i);\n\t\t}\n\t\tif (!dq.isEmpty())\n\t\t\tSystem.out.print(arr[dq.peek()] + \" \");\n\n\t}", "public int solution1(int[] nums, int k) {\n final int N = nums.length;\n Arrays.sort(nums);\n \n return nums[N-k];\n }", "public static int[] maxSlidingWindow(int[] nums, int k) {\n if (nums == null || k <= 0) {\n return new int[0];\n }\n int[] result = new int[nums.length-k+1];\n int resultIndex = 0;\n // store index\n Deque<Integer> queue = new LinkedList<>();\n for (int index = 0; index < nums.length; index++) {\n // remove numbers out of range k\n while (!queue.isEmpty() && queue.peek() < index - k + 1) {\n queue.poll();\n }\n // remove smaller numbers in k range as they are useless\n while (!queue.isEmpty() && nums[queue.peekLast()] < nums[index]) {\n queue.pollLast();\n }\n // q contains index... r contains content\n queue.offer(index);\n if (index >= k - 1) {\n result[resultIndex++] = nums[queue.peek()];\n }\n }\n return result;\n }", "public static int quickSelectImpl(int k, CompareInt[] arr) {\n\t\tint select = Sorting.quickSelect(k, arr).val;\n\t\tquickSelectComparisons = CompareInt.countComparisons(arr, 0, arr.length - 1);\n\t\treturn select;\n\t}", "public static double orderStatistic(double[] a, int rank) {\n\t\tif (a == null || a.length <= rank)\n\t\t\tthrow new IndexOutOfBoundsException();\n\n\t\tint from = 0, to = a.length - 1;\n\n\t\t// if from == to we reached the kth element\n\t\twhile (from < to) {\n\t\t\tint r = from, w = to;\n\t\t\tdouble mid = a[(r + w) / 2];\n\n\t\t\t// stop if the reader and writer meets\n\t\t\twhile (r < w) {\n\n\t\t\t\tif (a[r] >= mid) { // put the large values at the end\n\t\t\t\t\tdouble tmp = a[w];\n\t\t\t\t\ta[w] = a[r];\n\t\t\t\t\ta[r] = tmp;\n\t\t\t\t\tw--;\n\t\t\t\t} else { // the value is smaller than the pivot, skip\n\t\t\t\t\tr++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// if we stepped up (r++) we need to step one down\n\t\t\tif (a[r] > mid)\n\t\t\t\tr--;\n\n\t\t\t// the r pointer is on the end of the first k elements\n\t\t\tif (rank <= r) {\n\t\t\t\tto = r;\n\t\t\t} else {\n\t\t\t\tfrom = r + 1;\n\t\t\t}\n\t\t}\n\n\t\treturn a[rank];\n\t}", "public int getKth(int lo, int hi, int k) {\n HashMap<Integer, Integer> map = new HashMap<>();\n map.put(1, 0);\n int[][] powerValues = new int[hi - lo + 1][2];\n for (int i = lo; i <= hi; i++) {\n powerValues[i - lo][1] = getPowerValue(i, map);\n powerValues[i - lo][0] = i;\n }\n // for (int i = 0; i < powerValues.length; i++) {\n // System.out.print(Arrays.toString(powerValues[i]) + \" \");\n // }\n Arrays.sort(powerValues, new Comparator<int[]>() {\n @Override\n public int compare(int[] o1, int[] o2) {\n return o1[1] - o2[1];\n }\n });\n // System.out.println();\n // for (int i = 0; i < powerValues.length; i++) {\n // System.out.print(Arrays.toString(powerValues[i]) + \" \");\n // }\n return powerValues[k - 1][0];\n }", "public T getMax()\n\t{\n\t\tif(size == 0)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\telse if(size == 1)\n\t\t{\n\t\t\treturn array[0];\n\t\t}\n\t\telse if(size == 2)\n\t\t{\n\t\t\treturn array[1];\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\tif(object.compare(array[1], array[2]) < 0)\n\t\t\t{\n\t\t\t\treturn array[2];\n\t\t\t}\n\t\t\telse if(object.compare(array[1], array[2]) > 0)\n\t\t\t{\n\t\t\t\treturn array[1];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn array[1];\n\t\t\t}\n\n\t\t}\n\t}", "public static int maxSubArray(final List<Integer> a) {\n\t\tint size = a.size();\n\t\tint max_so_far = Integer.MIN_VALUE, max_ending_here = 0;\n\t\tint position = 0;\n\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tmax_ending_here = max_ending_here + a.get(i);\n\t\t\tif (max_so_far < max_ending_here)\n\t\t\t\tmax_so_far = max_ending_here;\n\t\t\tif (max_ending_here < 0)\n\t\t\t\tmax_ending_here = 0;\n\t\t}\n\t\treturn max_so_far;\n\t}", "private static List<Integer> getTopKFrequentElementsBestCase(int[] nums, int k) {\n if(k > nums.length) {\n return new ArrayList<>();\n }\n\n Map<Integer, Integer> numToCount = new HashMap<>();\n int max = 0;\n for(int i = 0; i < nums.length; i++) {\n numToCount.put(nums[i], numToCount.getOrDefault(nums[i], 0) + 1);\n max = Math.max(max, numToCount.get(nums[i]));\n }\n\n List<Integer>[] numsPerFrequency = new ArrayList[max + 1];\n for(int i = 1; i <= max; i++) {\n numsPerFrequency[i] = new ArrayList<>();\n }\n\n for(Map.Entry<Integer, Integer> entry : numToCount.entrySet()) {\n numsPerFrequency[entry.getValue()].add(entry.getKey());\n }\n\n List<Integer> result = new ArrayList<>();\n\n for(int i = max; i >= 0; i--) {\n List<Integer> numsWithThisFreq = numsPerFrequency[i];\n\n for(int num : numsWithThisFreq) {\n result.add(num);\n if(result.size() == k) {\n return result;\n }\n }\n }\n\n return new ArrayList<>();\n }", "public static int max(int a, int... vals) {\n\t\tint maxVal = a;\n\t\tfor (int v : vals) {\n\t\t\tif (v > maxVal) {\n\t\t\t\tmaxVal = v;\n\t\t\t}\n\t\t}\n\t\treturn maxVal;\n\t}", "public static int getRealTopK(int k, long items){\n return (int)(k > items ? items : k);\n }", "public static int maximumScore_rev2(int[] nums, int k) {\n int[] mins = new int[nums.length];\n mins[k] = nums[k];\n for (int i = k + 1; i < nums.length; ++i) {\n mins[i] = Math.min(mins[i - 1], nums[i]);\n }\n for (int i = k - 1; i >= 0; --i) {\n mins[i] = Math.min(mins[i + 1], nums[i]);\n }\n int score = mins[k], left = 0, right = nums.length - 1;\n// Then starting from both ends as the first good subarray, move the end corresponds to smaller value of the mins, and update the score accordingly.\n while (left < right) {\n score = Math.max(score, (right - left + 1) * Math.min(mins[left], mins[right]));\n if (right == k || mins[left] < mins[right]) {\n// right has reached k, The only option you have to increase left\n// left have lowest min, so by increasing the left side, the minimum value will be increased.\n ++left;\n } else {\n --right;\n }\n }\n return score;\n }", "public static double orderStatistic(int[] a, int rank) {\n\t\tif (a == null || a.length <= rank)\n\t\t\tthrow new IndexOutOfBoundsException();\n\n\t\tint from = 0, to = a.length - 1;\n\n\t\t// if from == to we reached the kth element\n\t\twhile (from < to) {\n\t\t\tint r = from, w = to;\n\t\t\tint mid = a[(r + w) / 2];\n\n\t\t\t// stop if the reader and writer meets\n\t\t\twhile (r < w) {\n\n\t\t\t\tif (a[r] >= mid) { // put the large values at the end\n\t\t\t\t\tint tmp = a[w];\n\t\t\t\t\ta[w] = a[r];\n\t\t\t\t\ta[r] = tmp;\n\t\t\t\t\tw--;\n\t\t\t\t} else { // the value is smaller than the pivot, skip\n\t\t\t\t\tr++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// if we stepped up (r++) we need to step one down\n\t\t\tif (a[r] > mid)\n\t\t\t\tr--;\n\n\t\t\t// the r pointer is on the end of the first k elements\n\t\t\tif (rank <= r) {\n\t\t\t\tto = r;\n\t\t\t} else {\n\t\t\t\tfrom = r + 1;\n\t\t\t}\n\t\t}\n\n\t\treturn a[rank];\n\t}", "public int[] maxSlidingWindow(int[] nums, int k) {\n if (nums.length == 0)\n return nums;\n \n int[] output = new int[nums.length-k+1];\n \n for (int i=0; i+k-1 < nums.length; i++) {\n int max = nums[i];\n for (int j=1; j<k; j++) {\n if (nums[i+j] > max)\n max = nums[i+j];\n }\n output[i] = max;\n }\n \n return output;\n }", "public int findKthSmallestNumber(int[] nums, int k) {\n\t\t//Create a max heap with k elements\n\t\tPriorityQueue<Integer> maxHeap = new PriorityQueue<>((a,b) -> Integer.compare(b, a));\n\t\t\n\t\tint i = 0;\n\t\tfor(; i < k; ++i) {\n\t\t\tmaxHeap.add(nums[i]);\n\t\t}\n\t\t\n\t\t// Iterate over the remaining elements and remove root and add to heap\n\t\t// if the number is less than the root.\n\t\t\n\t\tfor(; i < nums.length; ++i) {\n\t\t\tif(maxHeap.peek() > nums[i]) {\n\t\t\t\tmaxHeap.poll();\n\t\t\t\tmaxHeap.add(nums[i]);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn maxHeap.poll();\n\t}", "public static void main(String[] args) {\n\n for (int i = 1; i <= 9; i++) {\n int[] array = { 3, 4, 1, 2, 9, 8, 6, 5, 7 };\n System.out.println(findKthLargest(array,i));\n }\n }", "public int Select(int[] A, int k, int l, int h){\n\tint low = l;\n\tint high = h-1;\n\tint pivot= A[l];\n\tint index = 0;\n\t//switches the two\n\tint first= A[l];\n\tint second= A[h];\n\tA[l]=second;\n\tA[h]=first;\n\twhile(low < high) {\n\t if (A[low] < pivot) {\n\t\tlow++;\n\t } else {\n\t\tint uno= A[low];\n\t\tA[low]= A[high];\n\t\tA[high]=uno;\t\n\t\thigh--;\n\t }\n\t}\n\tif (A[low] < pivot){\n\t A[h] = A[low + 1];\n\t index = low + 1;\n\t A[index] = pivot;\n\n\t}\n if (A[low] > pivot){\n\t A[h] = A[low];\n\t index = low;\n\t A[index] = pivot;\n\t}\n\t//rec\n\tif (low < k) {\n\t Select(A,k,index+1,h);\n\t}\n if (low > k) {\n\t Select(A,k,l,index-1);\n\t}\n\treturn A[k];\n }", "private static int select (int[] arr, int p, int n, int k){\n //threshold of 17\n if(n < 17 ){\n insertionSort(arr, p, p+n-1);\n return arr[p + n - k];\n }else{\n int q = randomizedPartition(arr,p,p+n-1);\n int left = q-p;\n int right = n - left - 1;\n if(right >= k)\n return select(arr,q+1,right,k);\n else if(right + 1 == k )\n return arr[q];\n else\n return select(arr,p,left,k-right-1);\n }\n }", "public static int iterationsUpperBound(double error, int k) {\r\n\t\treturn (int)(Math.log(1.0/error)*Math.pow(Math.E, k)+0.5);\r\n\t}", "private static <Key extends Comparable<Key> > void sink(Key [] a,int k, int n){\n while(2*k<=n){\n int max=2*k;\n if(max<n &&less(a, max, max+1)) max++;\n if(!less(a,k,max)) break; \n exch(a,max,k);\n k=max;\n }\n }", "public int getMaximumValueForSet(long j, int i) {\n int a = this.b.a() - 1;\n return (i > a || i < 1) ? getMaximumValue(j) : a;\n }", "public int maxValue( int[ ] n ) {\n int max = Integer.MIN_VALUE;\n for(int each: n){\n if(each > max){\n max = each;\n }\n }\n return max;\n }", "public static int kthElement(int[] arr1, int[] arr2, int k) {\n\t\treturn 1; // not implemented yet, too hard!\n\t}", "private static int partition(int[] array, int k) {\n final int item = array[k];\n\n swap(array, k, array.length - 1);\n k = array.length - 1;\n\n for (int i = 0; i < k; i++) {\n while (array[i] > item && k > i) {\n swap(array, i, k);\n swap(array, i, k - 1);\n k--;\n }\n }\n \n return k;\n }", "public static long maximumSubarraySum(int[] nums, int k) {\n int len = nums.length;\n\n long ans = 0;\n\n Map<Integer, Integer> map = new HashMap<>();\n long sum = 0;\n for (int i = 0, j = 0; j <= len; j++) {\n if (j - i == k) {\n if (map.size() == k) {\n ans = Math.max(ans, sum);\n }\n\n int cnt = map.getOrDefault(nums[i], 0);\n if (cnt > 1) {\n map.put(nums[i], cnt - 1);\n } else {\n map.remove(nums[i]);\n }\n sum -= nums[i];\n i++;\n }\n\n if (j == len) {\n break;\n }\n\n map.put(nums[j], map.getOrDefault(nums[j], 0) + 1);\n sum += nums[j];\n }\n\n return ans;\n }" ]
[ "0.80327123", "0.70282423", "0.68296516", "0.65733016", "0.63795257", "0.63691974", "0.6358627", "0.62670594", "0.6198016", "0.618936", "0.61764884", "0.61552596", "0.6136665", "0.60544974", "0.60518044", "0.5978899", "0.59439486", "0.5897347", "0.58705235", "0.58655095", "0.58271384", "0.5800039", "0.5778316", "0.57725257", "0.57659596", "0.5755926", "0.5692986", "0.5692506", "0.56787276", "0.5660528", "0.5660448", "0.5652427", "0.562844", "0.5576521", "0.55707693", "0.5564424", "0.5562039", "0.5525623", "0.55162597", "0.54994327", "0.5467645", "0.54621285", "0.5456567", "0.54548824", "0.54497325", "0.54388463", "0.5434793", "0.5418676", "0.54162157", "0.5414865", "0.5379224", "0.53780717", "0.5374994", "0.53569764", "0.5339203", "0.53281605", "0.5325329", "0.5317535", "0.53172386", "0.53134483", "0.53101104", "0.530494", "0.5296244", "0.5294505", "0.5281358", "0.5268583", "0.52633727", "0.52538943", "0.52481097", "0.5235298", "0.5222705", "0.52176845", "0.52032256", "0.5179002", "0.5156848", "0.51500577", "0.51398474", "0.51321477", "0.5120193", "0.51194257", "0.511857", "0.5112201", "0.5101326", "0.51004803", "0.5098061", "0.50929356", "0.5089039", "0.5073488", "0.5069744", "0.5059594", "0.50495327", "0.5047549", "0.50398904", "0.5033872", "0.50296056", "0.50274473", "0.50273544", "0.5026392", "0.5005457", "0.50018626" ]
0.6104964
13
Returns an array containing all the values in a in the range [low..high]; that is, all the values that are greater than or equal to low and less than or equal to high, including duplicate values. The length of the returned array is the same as the number of values in the range [low..high]. If there are no qualifying values, this method returns a zerolength array. Note that low and high do not have to be actual values in a. This method throws an IllegalArgumentException if a is null or has zero length. The array a is not changed by this method.
public static <T> Collection<T> range(Collection<T> c, T low, T high, Comparator<T> comp) { // Check for null. if (c == null || comp == null) { throw new IllegalArgumentException(); } // Checks if collection is empty. if (c.isEmpty()) { throw new NoSuchElementException(); } // Make arraylist of original and arraylist for the range // Set j for number of qualifying values List<T> copyList = new ArrayList(c); List<T> range = new ArrayList(c); int j = 0; /* New copy so that the values within range listed are first in the array*/ for (int i = 0; i < copyList.size(); i++) { if ((comp.compare(copyList.get(i), low) >= 0) && (comp.compare(copyList.get(i), high) <= 0)) { range.set(j, copyList.get(i)); j++; } } // No values in the arraylist fall within the range. if (j == 0) { throw new NoSuchElementException(); } // Delete extra values of range. for (int i = range.size() - 1; i > j - 1; i--) { range.remove(i); } return range; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int[] range(int[] a, int low, int high) throws IllegalArgumentException {\n if (a == null || a.length == 0) {\n throw new IllegalArgumentException();\n }\n \n int increment = 0;\n \n for (int i : a) {\n if (i >= low && i <= high) {\n increment++;\n }\n }\n \n int[] array = new int[increment];\n increment = 0;\n \n //for(int i = 0; i < a.length; i++)\n for (int i : a) {\n if (i >= low && i <= high) {\n array[increment] = i;\n increment++;\n }\n }\n \n return array;\n }", "public static int[] minmax(int[] a)\n {\n \tint[] b= {0,0};\n \tint min=(int)1e9;\n \tint max=(int)-1e9;\n \tfor(int i=0;i<a.length;i++)\n \t{\n \t\tmin=Math.min(min, a[i]);\n \t\tmax=Math.max(max, a[i]);\n \t}\n \tb[0]=min;\n \tb[1]=max;\n \treturn b;\n }", "public long[] toArray() {\n/* 406 */ long[] array = new long[(int)(this.max - this.min + 1L)];\n/* 407 */ for (int i = 0; i < array.length; i++) {\n/* 408 */ array[i] = this.min + i;\n/* */ }\n/* 410 */ return array;\n/* */ }", "public static int[] toArray(Collection<Integer> a) {\n assert (a != null);\n int[] ret = new int[a.size()];\n int i = 0;\n for (int e : a)\n ret[i++] = e;\n return ret;\n }", "protected static Integer[] range(int from, int to) {\n if (from > to) {\n throw new IllegalArgumentException(\"from must be <= to (\" + from\n + \",\" + to + \")\");\n }\n int n = to - from + 1;\n Integer[] range = new Integer[n];\n for (int i = 0; i < n; i++) {\n range[i] = from + i;\n }\n return range;\n }", "private static int partition(Comparable[] a, int lo, int hi) {\n int i = lo, j = hi+1;\n Comparable v = a[lo];\n while (true) {\n while (less(a[++i], v)) if (i == hi) break;\n while (less(v, a[--j])) if (j == lo) break;\n if (i >= j) break;\n exch(a, i, j);\n }\n exch(a, lo, j);\n return j; // with a[lo..j-1] <= a[j] <= a[j+1..hi].\n }", "public double[] getRange();", "public abstract double[] getUpperBound();", "public static int[] copyAndSort(int[] a) {\n int[] result = new int[a.length];\n\n for (int i = 0; i < a.length; ++i) result[i] = a[i];\n\n QuickSort.quick1(result);\n\n return result;\n }", "public int[] filterByPlateauSize(double lower_threshold, double upper_threshold) {\n ArrayList<Integer> newPeaks = new ArrayList<Integer>();\n for (int i=0; i<this.plateau_size.length; i++) {\n if (this.plateau_size[i] >= lower_threshold && this.plateau_size[i] <= upper_threshold) {\n newPeaks.add(this.midpoints[i]);\n }\n }\n return UtilMethods.convertToPrimitiveInt(newPeaks);\n }", "private static ArrayList getStocksSpan(int[] a) {\n Stack<ValueIndex> stack = new Stack<>();\n ArrayList<Integer> list = new ArrayList();\n for(int i =0 ; i<a.length;i++){\n if(stack.isEmpty())list.add(-1);\n else if(stack.peek().value>a[i])list.add(i-1);\n else if(stack.peek().value<= a[i]){\n while(!stack.isEmpty() && stack.peek().value<=a[i])stack.pop();\n if(stack.isEmpty())list.add(-1);\n else list.add(stack.peek().index);\n }\n stack.push(new ValueIndex(a[i],i));\n }\n for(int i=0;i<list.size();i++){\n// System.out.print(list.get(i)+\"\\t\"); //[-1, 1, 2, -1, 4, -1, 6]\n if(list.get(i)!= -1)list.set(i,i-list.get(i));\n }\n return list;\n }", "public static int count(int[] a, int low, int high) {\n\n if (high < low) {\n return 0;\n }\n\n if (high == low) {\n return low;\n }\n\n int mid = low + (high - low) / 2;\n\n if (mid < high && a[mid + 1] < a[mid]) {\n return mid + 1;\n }\n\n if (mid > low && a[mid] < a[mid - 1]) {\n return mid;\n }\n\n if (a[high] > a[mid]) {\n return count(a, low, mid - 1);\n } else {\n return count(a, mid + 1, high);\n }\n }", "private static int[] arrangeIntegers(int[] a) {\n\n\t\tint i = 0, j = a.length - 1, k = 0;\n\t\tint[] temp = new int[a.length];\n\n\t\twhile (k<a.length) {\n\t\t\t\n\t\t\tif(a[k]<0)\n\t\t\t{\n\t\t\t\ttemp[i]= a[k];\n\t\t\t\ti++;\n\t\t\t\tk++;\n\t\t\t}\n\t\t\t\n\t\t\telse if(a[k]>0)\n\t\t\t{\n\t\t\t\ttemp[j]= a[k];\n\t\t\t\tj--;\n\t\t\t\tk++;\n\t\t\t}\n\t\t\t\n\t\t\telse\n\t\t\t{\n\t\t\t\tk++;\n\t\t\t}\n\n\t\t}\n\t\t\n\t\tif(i!=j)\n\t\t{\n\t\t\twhile(i!=j)\n\t\t\t{\n\t\t\t\ttemp[i]=0;\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\n\t\treturn temp;\n\t}", "int[] maxAndMin() {\n\n // **** ****\n HashMap<Integer, Integer> hm = new HashMap<Integer, Integer>();\n\n // **** traverse parrents array inserting into hashmap: O(n) ****\n for (int val : this.parents) {\n hm.put(val, hm.getOrDefault(val, 0) + 1);\n }\n\n // ???? ????\n // System.out.println(\"maxAndMin <<< hm: \" + hm.toString());\n\n // **** initialize the min and max values ****\n int min = Integer.MAX_VALUE;\n int max = Integer.MIN_VALUE;\n\n // **** traverse hashmap looking for min and max: O(n) ****\n Iterator<Entry<Integer, Integer>> it = hm.entrySet().iterator();\n while (it.hasNext()) {\n Entry<Integer, Integer> e = it.next();\n\n // **** skip this key ****\n if (e.getKey() == 0)\n continue;\n\n // **** update min and max ****\n min = Math.min(e.getValue(), min);\n max = Math.max(e.getValue(), max);\n }\n\n // **** package results ****\n int[] result = { min, max };\n\n // **** return results ****\n return result;\n }", "public static int[] getRanks(double[] a) {\n\t\tint[] re = seq(0, a.length-1, 1);\n\t\tparallelSort(a.clone(), re,0,a.length);\n\t\treturn re;\n\t}", "private static <T extends Comparable<? super T>> void sort(T[] a, int lo, int hi) {\n\t\tif (hi <= lo) {\n\t\t\treturn;\n\t\t}\n\t\tint lt = lo, gt = hi;\n\t\tT v = a[lo];\n\t\tint i = lo + 1;\n\t\twhile (i <= gt) {\n\t\t\tint cmp = a[i].compareTo(v);\n\t\t\tif (cmp < 0) {\n\t\t\t\texch(a, lt++, i++);\n\t\t\t\tshow(a, lt, i, gt);\n\t\t\t} else if (cmp > 0) {\n\t\t\t\texch(a, i, gt--);\n\t\t\t\tshow(a, lt, i, gt);\n\t\t\t} else {\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\n\t\t// a[lo..lt-1] < v = a[lt..gt] < a[gt+1..hi].\n//\t\tsort(a, lo, lt - 1);\n//\t\tsort(a, gt + 1, hi);\n\t}", "public static int unique(int[] a) {\n\t\treturn unique(a,0,a.length);\n\t}", "public static Integer[] genRandomIntArray(int arrSize, int lowerBound, int upperBound) {\n\n Integer[] arr = new Integer[arrSize];\n Random rand = new Random();\n\n for (int i = 0; i < arrSize; i += 1) {\n Integer randNum = rand.nextInt((upperBound - lowerBound) + 1) + lowerBound;\n arr[i] = randNum;\n }\n\n return arr;\n }", "static double [] quickSort (double a[]){\r\n \tif(a==null||a.length==0) {\r\n \t\tSystem.out.print(\"Array empty\");\r\n \t\treturn null;\r\n \t}\r\n \tdoQuickSort(a,0,a.length-1);\r\n \treturn a;\r\n\r\n }", "private static void Merge(int[] a, int low, int m, int high) {\n\t\tint j=m+1,k=low;\n\t\tint temp=low;\n\t\tint [] tmp=new int [a.length];\n\t\twhile(low<=m&&j<=high){\n\t\t\tif(a[low]<=a[j]){\n\t\t\t\ttmp[k++]=a[low++];\n\t\t\t}else {\n\t\t\t\ttmp[k++]=a[j++];\n\t\t\t}\n\t\t}\n\t\twhile (low<=m) {\n\t\t\ttmp[k++]=a[low++];\n\t\t}\n\t\twhile (j<=high) {\n\t\t\ttmp[k++]=a[j++];\n\t\t}\n\t\twhile (temp<=high) {\n\t\t\ta[temp]=tmp[temp++];\n\t\t\t\n\t\t}\n\t\t\n\t}", "private double[] limits(double a, double b, double c) {\n\t\tif (a > 1.0 || a < 0.0) {\n\t\t\tif (a > 1.0) {\n\t\t\t\ta = 1.0;\n\t\t\t} else {\n\t\t\t\ta = 0.0;\n\t\t\t}\n\t\t}\n\t\tif (b > 1.0 || b < 0.0) {\n\t\t\tif (b > 1.0) {\n\t\t\t\tb = 1.0;\n\t\t\t} else {\n\t\t\t\tb = 0.0;\n\t\t\t}\n\t\t}\n\t\tif (c > 1.0 || c < 0.0) {\n\t\t\tif (c > 1.0) {\n\t\t\t\tc = 1.0;\n\t\t\t} else {\n\t\t\t\tc = 0.0;\n\t\t\t}\n\t\t}\n\n\t\treturn new double[] { a, b, c };\n\t}", "public static int[] histogram (int[] ages)\n {\n \t// If ages array has no elements, return an array that has one element of 0 to show that no ages were contained in the ages array\n \t\n \tif(ages.length == 0)\n \t{\n \t\tint[] agesCount = new int[1];\n \t\tagesCount[0] = 0;\n \t\treturn agesCount;\n \t}\n \t\n \t// Find maximum age in the ages array to then determine size of the list that will be returned\n \t\n \tint maxAge = ages[0];\n \t\n \tfor(int i = 1; i < ages.length; i++)\n \t\tif(ages[i] > maxAge)\n \t\t\tmaxAge = ages[i];\n \t\n \tint arraySize = maxAge + 1;\n \t\n \t// Create the array that will be returned based on the size determined above\n \t\n \tint[] agesCount = new int[arraySize];\n \t\n \t// Loop through the ages array and increment the agesCount array depending on the values taken from the ages array\n \t\n \tfor (int temp : ages)\n\t\t\tagesCount[temp] += 1;\n \t\n return agesCount; // You will write this method as part of programming assignment #7. \n }", "private static int[] generateArray(int size, int startRange, int endRange) {\n\t\tint[] array = new int[size];\n\t\tfor(int i = 0; i < array.length; i++) {\n\t\t\tarray[i] = (int)((Math.random()*(endRange - startRange + 1)) + startRange);\n\t\t}\n\t\treturn array;\n\t}", "int[] minAndMax() {\n\n // **** declare and populate array of Integers with the values of the parents O(n) ****\n Integer[] arr = new Integer[this.parents.length];\n int i = 0;\n for (int val : this.parents)\n arr[i++] = val;\n\n // **** create a list with the values in the parents ****\n List<Integer> al = Arrays.asList(arr);\n\n // **** initialize the min and max values ****\n int min = Integer.MAX_VALUE;\n int max = Integer.MIN_VALUE;\n\n // **** traverse the array arr: O(n^2) ****\n for (int item : arr) {\n if (item != 0) {\n\n // **** get the frequency of item in the list: O(n) ****\n int freq = Collections.frequency(al, item);\n\n // ???? ????\n System.out.println(\"minAndMax <<< item: \" + item + \" freq: \" + freq);\n\n // **** update the min and max values ****\n min = Math.min(min, freq);\n max = Math.max(max, freq);\n }\n }\n\n // **** package results ****\n int[] result = { min, max };\n\n // **** return results ****\n return result;\n }", "public FractileArray (double[] the_values, int lo, int hi) {\n\t\t\tif (the_values == null) {\n\t\t\t\tvalues = null;\n\t\t\t} else {\n\t\t\t\tvalues = Arrays.copyOfRange (the_values, lo, hi);\n\t\t\t}\n\t\t}", "public static int[] uniqueRandIntArray(int min, int max, int arrayLength) {\n int[] intArray = new int[arrayLength];\n for (int i = 0; i < arrayLength; i++) {\n intArray[i] = randInt(min, max);\n if (i > 0 && min < max) {\n while (intArray[i] == intArray[i-1]) {\n intArray[i] = randInt(min, max);\n }\n }\n }\n return intArray;\n }", "public static List<Integer> asList(int[] a) {\n assert (a != null);\n List<Integer> ret = new ArrayList<>(a.length);\n for (int e : a)\n ret.add(e);\n return ret;\n }", "public abstract double[] getLowerBound();", "public static int[] range(int start, int end) {\r\n int sz = end - start;\r\n int[] result = new int[sz];\r\n for (int i = 0; i < sz; i++)\r\n result[i] = start + i;\r\n return result;\r\n }", "public static int[] buildZ(char[] a) {\n int n = a.length;\n int[] z = new int[n];\n if (n == 0) return z;\n z[0] = n;\n int l = 0, r = 0;\n for (int i = 1; i < n; i++) {\n if (i > r) {\n l = r = i;\n while (r < n && a[r - l] == a[r]) {\n r++;\n }\n z[i] = r - l;\n r--;\n } else {\n int k = i - l;\n if (z[k] < r - i + 1) {\n z[i] = z[k];\n } else {\n l = i;\n while (r < n && a[r - l] == a[r]) {\n r++;\n }\n z[i] = r - l;\n r--;\n }\n }\n }\n return z;\n }", "public static void shuffle( int[] a, int lo, int hi ) {\n if ( lo < 0 || lo > hi || hi >= a.length )\n throw new RuntimeException( \"Illegal subarray range\" );\n \n for ( int i = lo; i <= hi; i++ ) {\n int r = i + uniform( hi - i + 1 ); // between i and hi\n int temp = a[i];\n a[i] = a[r];\n a[r] = temp;\n }\n }", "public static int[] restrict(int[] a, BitVector entries) {\n\t\tint[] re = new int[entries.cardinality()];\n\t\tint index = 0;\n\t\tfor (int i=0; i<a.length; i++)\n\t\t\tif (entries.getQuick(i))\n\t\t\t\tre[index++] = a[i];\n\t\treturn re;\n\t}", "public Array<T> copyOfRange(int from, int to)\n {\n assert to >= from;\n\n Array<T> out = Array.ofSize(to - from);\n out.copyFrom(this, from, 0, to - from);\n return out;\n }", "public static int[] getArray( int start, int end ) {\n int[] array = new int[ (end - start) + 1 ];\n for (int i = 0; i <= (end - start); i++) {\n array[i] = start + i;\n }\n return array;\n }", "public static int[] removeDuplicates(int[] a) {\n\t int length = a.length;\n\t \n\t /*Sort the array*/\n\t Arrays.sort(a);\n\t \n\t int fillPos = 1;\n\t for (int i = 1; i < length; ++i) {\n\t if (a[i] != a[i - 1]) {\n\t a[fillPos] = a[i];\n\t fillPos++;\n\t }\n\t }\n\t \n\t int[] result = Arrays.copyOf(a, fillPos);\n\t return result;\n\t}", "public static int partition(int[] a, int lo, int hi)\n {\n int i = lo, j = hi+1; // left and right scan indices\n int v = a[lo]; // partitioning item\n while (true)\n { // Scan right, scan left, check for scan complete, and exchange.\n while (a[++i] < v){ if (i == hi) break;}//checks for elements to swap from left\n while (v < a[--j]){ if (j == lo) break;}//checks for elements to swap from right\n if (i >= j) break;//if they crossed we are done\n exch(a, i, j);\n }\n exch(a, lo, j); // Put v = a[j] into position\n return j; // with a[lo..j-1] <= a[j] <= a[j+1..hi].\n }", "public static void shuffle(int[] a, int lo, int hi) {\r\n if (lo < 0 || lo > hi || hi >= a.length)\r\n throw new RuntimeException(\"Illegal subarray range\");\r\n for (int i = lo; i <= hi; i++) {\r\n int r = i + uniform(hi-i+1); // between i and hi\r\n int temp = a[i];\r\n a[i] = a[r];\r\n a[r] = temp;\r\n }\r\n }", "private static int partition(Student[] a, int lo, int hi){\r\n int i = lo, j = hi+1;\r\n while(true) {\r\n while (less(a[++i], a[lo])) {\r\n if (i == hi) {\r\n break;\r\n }\r\n }\r\n while(less(a[lo], a[--j])){\r\n if(j == lo){\r\n break;\r\n }\r\n }\r\n if(i >= j){\r\n break;\r\n }\r\n exch(a,i,j);\r\n }\r\n exch(a, lo, j);\r\n return j;\r\n }", "public IntPlus[] randArrNoDuplicates(int min, int max,\n int length, Random randNums) {\n if (max - min <= length) {\n throw new IllegalArgumentException(\"Range too small: Can't \"\n + \"generate array without duplicates\");\n }\n\n //stores already-added values\n HashSet<Integer> valuesInList = new HashSet<>();\n\n IntPlus[] randArr = new IntPlus[length];\n\n int toAdd;\n for (int i = 0; i < length; i++) {\n //Generate random number not already in list\n do {\n toAdd = randNums.nextInt(max - min + 1) + min;\n } while (!valuesInList.add(toAdd));\n\n randArr[i] = new IntPlus(toAdd);\n }\n return randArr;\n }", "protected static int[] range(int start, int end_incl) {\n int[] arr = new int[end_incl - start + 1];\n for(int num = start, id = 0; num <= end_incl; num++, id++)\n arr[id] = num;\n return arr;\n }", "public static double outside(double[] values, double low, double high) {\n return -1.0; // FIXME Q1\n }", "protected double[] toArrayNotIncludingNoDataValues() {\r\n boolean handleOutOfMemoryError = false;\r\n Grids_GridDouble g = getGrid();\r\n int nrows = g.getChunkNRows(ChunkID, handleOutOfMemoryError);\r\n int ncols = g.getChunkNCols(ChunkID, handleOutOfMemoryError);\r\n double noDataValue = g.getNoDataValue(handleOutOfMemoryError);\r\n long n = getN();\r\n if (n != (int) n) {\r\n throw new Error(\"Error n != (int) n \");\r\n }\r\n double[] array = new double[(int) getN()];\r\n int row;\r\n int col;\r\n int count = 0;\r\n double value;\r\n for (row = 0; row < nrows; row++) {\r\n for (col = 0; col < ncols; col++) {\r\n value = getCell( row, col);\r\n if (value != noDataValue) {\r\n array[count] = value;\r\n count++;\r\n }\r\n }\r\n }\r\n return array;\r\n }", "public Date212[] getNumbDates(int a){ //a is the number that signfies the dates passed in.\n // System.out.println(a+ \"a is\");\n Date212 myDates[] = new Date212[a]; //initalize it from the a.\n\n for(int d = 0; d< myTempDates.length; d++){ //that \"myTempDates\" array which holds the dates is used to copy it into the specified array.\n if(myTempDates[d] != null){ //if next index is not null then copy.\n myDates[d] = myTempDates[d];\n }\n }\n return myDates; //return the array to method calling it!\n }", "public Integer[] createSortedArray() {\n Integer[] value = new Integer[defaultLaenge];\n\n for (int i = 0; i < value.length; i++) {\n value[i] = i;\n }\n\n return value;\n }", "public static int[] range(int start, int end) {\n int size = end - start;\n int[] result = new int[size];\n for (int i = 0; i < size; i++) {\n result[i] = start + i;\n }\n return result;\n }", "public static void shuffle( Object[] a, int lo, int hi ) {\n if ( lo < 0 || lo > hi || hi >= a.length )\n throw new RuntimeException( \"Illegal subarray range\" );\n \n for ( int i = lo; i <= hi; i++ ) {\n int r = i + uniform( hi - i + 1 ); // between i and hi\n Object temp = a[i];\n a[i] = a[r];\n a[r] = temp;\n }\n }", "public Integer[] createArray() {\n Integer[] value = new Integer[defaultLaenge];\n\n for (int i = 0; i < value.length; i++) {\n value[i] = (int)(value.length*Math.random());\n }\n\n return value;\n }", "static int minimumInRange(int a[], int from, int to){ //\"O(to-from+1)\" O(m)\n int min = from;\n for(int i = from+1; i<= to; i++){ //n times\n if(a[i]<a[min]){\n min = i;\n }\n }\n return min;\n }", "public int[] filterByWidth(double lower_threshold, double upper_threshold) {\n ArrayList<Integer> newPeaks = new ArrayList<Integer>();\n for (int i=0; i<this.width.length; i++) {\n if (this.width[i] >= lower_threshold && this.width[i] <= upper_threshold) {\n newPeaks.add(this.midpoints[i]);\n }\n }\n return UtilMethods.convertToPrimitiveInt(newPeaks);\n }", "private static int partition(int[] a, int low, int high) {\n int middle = (low + high)/2;\n medianOfThree(a, low, middle, high);\n swap(a, middle, high);\n\n int pivot = a[high];\n int i = low - 1;\n for (int j = low; j < high; j++) {\n if(a[j] <= pivot) {\n i++;\n swap(a, i, j);\n }\n }\n i++;\n swap(a, i, high);\n return i;\n }", "private static int[] getMeRandomArray(int length) {\n\t\tint array[] = new int[length];\n\t\tint min = -1000;\n\t\tint max = 1000;\n\t\tfor(int i = 0; i < length; i++) {\n\t\t\tarray[i] = (int)(Math.random() * ((max - min) + 1)) + min;\n\t\t}\n\t\treturn array;\n\t}", "private static int partition(int[] a, int lo, int hi) {\n \n int i = lo, j = hi+1; // left and right scan indices\n int v = a[lo]; // partitioning item\n int buff;\n while (true) { // Scan right, scan left, check for scan complete, and swap.\n while (a[++i] < v) if (i == hi) break;\n while (v < a[--j]) if (j == lo) break;\n if (i >= j) break;\n buff = a[i];\n a[i] = a[j];\n a[j] = buff;\n }\n \n // Put v = a[j] into position with a[lo..j-1] <= a[j] <= a[j+1..hi].\n buff = a[lo];\n a[lo] = a[j];\n a[j] = buff;\n return j;\n}", "static int[] sol1(int[]a, int n){\r\n\t\tMap <Integer,Integer> map= new HashMap();\r\n\t\tfor (int i = 0; i< a.length; i++){\r\n\t\t\tmap.put(a[i],i);\r\n\t\t}\r\n\t\tArrays.sort(a);\r\n\t\tint i = 0; \r\n\t\tint j = a.length -1;\r\n\t\twhile (i <= j){\r\n\t\t\tif(a[i]+a[j]>n) j--;\r\n\t\t\telse if (a[i]+a[j]<n) i++;\r\n\t\t\telse break;\r\n\t\t}\r\n\t\tint[] ans= {map.get(a[i]),map.get(a[j])};\r\n\t\treturn ans;\r\n\t}", "private void generateIntervalArray(){\n BigDecimal maximumValue = this.getTfMaximumInterval();\n BigDecimal minimumValue = this.getTfMinimumInterval();\n BigDecimal stepValue = this.getTfStepInterval();\n \n intervalArray = new ArrayList<BigDecimal>();\n BigDecimal step = maximumValue;\n \n //Adiciona os valores \"inteiros\"\n while(step.doubleValue() >= minimumValue.doubleValue()){\n intervalArray.add(step);\n step = step.subtract(stepValue);\n }\n }", "public static void shuffle( double[] a, int lo, int hi ) {\n if ( lo < 0 || lo > hi || hi >= a.length )\n throw new RuntimeException(\"Illegal subarray range\");\n \n for ( int i = lo; i <= hi; i++ ) {\n int r = i + uniform( hi - i + 1 ); // between i and hi\n double temp = a[i];\n a[i] = a[r];\n a[r] = temp;\n }\n }", "private static int[] removeDuplicates(int[] a) {\n\t\tif (a.length < 2) return a;\n\n\t\tint i = 0;\n\t\tint j = 1;\n\n\t\twhile (j < a.length) {\n\t\t\tif (a[i] == a[j]) {\n\t\t\t\tj++;\n\t\t\t} else {\n\t\t\t\ti++;\n\t\t\t\ta[i] = a[j];\n\t\t\t\tj++;\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(Arrays.toString(a));\n\t\tint[] b = Arrays.copyOf(a, i + 1);\n\t\treturn b;\n\t}", "public static void shuffle(double[] a, int lo, int hi) {\r\n if (lo < 0 || lo > hi || hi >= a.length)\r\n throw new RuntimeException(\"Illegal subarray range\");\r\n for (int i = lo; i <= hi; i++) {\r\n int r = i + uniform(hi-i+1); // between i and hi\r\n double temp = a[i];\r\n a[i] = a[r];\r\n a[r] = temp;\r\n }\r\n }", "public static int range(int[] theArray) {\n\n int min = IntegerArrays.min(theArray);\n int max = IntegerArrays.max(theArray);\n return max - min;\n\n }", "public static int[] range(int n) {\n int[] result = new int[n];\n for (int i = 0; i < n; i++) {\n result[i] = i;\n }\n return result;\n }", "default <T> T[] toArray(T[] a) {\n int size = size();\n\n // It is more efficient to call this method with an empty array of the correct type.\n // See also: https://stackoverflow.com/a/29444594/146622 and https://shipilev.net/blog/2016/arrays-wisdom-ancients/\n @SuppressWarnings(\"unchecked\")\n T[] array = a.length != size ? (T[])java.lang.reflect.Array.newInstance(a.getClass().getComponentType(), size) : a;\n\n // This implementation allocates the iterator object,\n // since collections, in general, do not have random access.\n\n Iterator<E> iterator = this.iterator();\n int i = 0;\n // Copy all the elements from the iterator to the array we allocated\n while (iterator.hasNext() && i < size) {\n @SuppressWarnings(\"unchecked\")\n T element = (T)iterator.next();\n array[i] = element;\n i += 1;\n }\n if (i < size) {\n // Somehow we got less elements from the iterator than expected.\n // Null-terminate the array (seems to be good practice).\n array[i] = null;\n // Copy the interesting part of the array and return it.\n return Arrays.copyOf(array, i);\n }\n else if (iterator.hasNext()) {\n // Somehow there are more elements in the iterator than expected.\n // We'll use an ArrayList for the rest.\n List<T> list = Arrays.asList(array);\n while (iterator.hasNext()) {\n @SuppressWarnings(\"unchecked\")\n T element = (T)iterator.next();\n list.add(element);\n }\n // Here we know the array was too small, so it doesn't matter what we pass.\n return list.toArray(a);\n } else {\n // Happy path: the array's size was just right to get all the elements from the iterator.\n return array;\n }\n }", "public static void QuickSort(int a[]) {\n\t Sort(a, 0, a.length-1); \n\t }", "private static void mergeSortInternally(int[] a, int low, int high) {\n\n if (low >= high) {\n return;\n }\n int mid = low + (high - low) / 2;\n mergeSortInternally(a, low, mid);\n mergeSortInternally(a, mid + 1, high);\n System.out.println(\"low:\" + low + \", mid:\" + mid + \", high:\" + high);\n merge(a, low, mid, high);\n }", "public static Integer[] makeRandomArray(int size, int min, int max){\n\t\tRandom rand = new Random();\n\t\tInteger[] list = new Integer[size];\n\n\t\tfor (int i = 0; i < list.length; i++){\n\t\t\tlist[i] = rand.nextInt((max - min) + 1) + min;\n\t\t}\t\n\t\t\n\t\treturn list;\n\t}", "public static int[] RandomizeArray(int a, int b){\n\t\tRandom rgen = new Random(); \t\n\t\tint size = b-a+1;\n\t\tint[] array = new int[size];\n \n\t\tfor(int i=0; i< size; i++){\n\t\t\tarray[i] = a+i;\n\t\t}\n \n\t\tfor (int i=0; i<array.length; i++) {\n\t\t int randomPosition = rgen.nextInt(array.length);\n\t\t int temp = array[i];\n\t\t array[i] = array[randomPosition];\n\t\t array[randomPosition] = temp;\n\t\t}\n \n\t\t\n \n\t\treturn array;\n\t}", "@Override\n public int[] toArray() {\n int[] result = new int[size];\n Entry tmp = first;\n for (int i = 0; i < size; i++) {\n result[i] = tmp.value;\n tmp = tmp.next;\n }\n return result;\n }", "public static int[] sortedPermutation(final double[] a) {\n\t\tInteger[] re = new Integer[a.length];\n\t\tfor (int i=0; i<re.length; i++)\n\t\t\tre[i] = i;\n\t\tArrays.sort(re,new Comparator<Integer>() {\n\t\t\t@Override\n\t\t\tpublic int compare(Integer o1, Integer o2) {\n\t\t\t\treturn Double.compare(a[o1], a[o2]);\n\t\t\t}\n\t\t});\n\t\treturn intCollectionToPrimitiveArray(Arrays.asList(re));\n\t}", "protected double[] toArrayIncludingNoDataValues() {\r\n boolean handleOutOfMemoryError = false;\r\n Grids_GridDouble g = getGrid();\r\n int nrows = g.getChunkNRows(ChunkID, handleOutOfMemoryError);\r\n int ncols = g.getChunkNCols(ChunkID, handleOutOfMemoryError);\r\n double[] array;\r\n if (((long) nrows * (long) ncols) > Integer.MAX_VALUE) {\r\n //throw new PrecisionExcpetion\r\n System.out.println(\r\n \"PrecisionException in \" + getClass().getName()\r\n + \".toArray()!\");\r\n System.out.println(\r\n \"Warning! The returned array size is only \"\r\n + Integer.MAX_VALUE + \" instead of \"\r\n + ((long) nrows * (long) ncols));\r\n }\r\n array = new double[nrows * ncols];\r\n int row;\r\n int col;\r\n int count = 0;\r\n for (row = 0; row < nrows; row++) {\r\n for (col = 0; col < ncols; col++) {\r\n array[count] = getCell( row, col);\r\n count++;\r\n }\r\n }\r\n return array;\r\n }", "static double [] selectionSort (double a[]){\r\n \tif(a==null){\r\n \t\tSystem.out.print(\"Array empty\");\r\n \t\treturn null;\r\n \t}\r\n \tfor (int i =0; i<a.length-1;i++) {\r\n \t\tint minIndex = i;\r\n \t\tfor(int j =i+1; j<a.length ;j++) { //Find min element in unsorted array\r\n \t\t\tif(a[j]<a[minIndex]) {\r\n \t\t\t\tminIndex =j;\r\n \t\t\t}\r\n \t\t}\r\n \t\tdouble temp = a[minIndex]; //Swap min with first element \r\n \t\ta[minIndex]=a[i];\r\n \t\ta[i]=temp;\r\n \t}\r\n \treturn a;\r\n }", "public static int[] seriesValues(final EIASeries series) {\n\t\tfinal int[] src = EIA_VALUES[series.ordinal()], ret = new int[src.length];\n\t\t// Avoid some caller inadvertently modifying the originals\n\t\tSystem.arraycopy(src, 0, ret, 0, ret.length);\n\t\treturn ret;\n\t}", "public static void shuffle(Object[] a, int lo, int hi) {\r\n if (lo < 0 || lo > hi || hi >= a.length)\r\n throw new RuntimeException(\"Illegal subarray range\");\r\n for (int i = lo; i <= hi; i++) {\r\n int r = i + uniform(hi-i+1); // between i and hi\r\n Object temp = a[i];\r\n a[i] = a[r];\r\n a[r] = temp;\r\n }\r\n }", "public IntegerValue[] getIntegerBoundsForVariable() {\n return select.getIntegerBounds();\n }", "public HighArray(int max) // constructor\n {\n a = new long[max]; // create the array\n nElems = 0; // no items yet\n }", "Array createArray();", "public int[] filterByHeight(double lower_threshold, double upper_threshold) {\n ArrayList<Integer> newPeaks = new ArrayList<Integer>();\n for (int i=0; i<this.height.length; i++) {\n if (this.height[i] >= lower_threshold && this.height[i] <= upper_threshold) {\n newPeaks.add(this.midpoints[i]);\n }\n }\n return UtilMethods.convertToPrimitiveInt(newPeaks);\n }", "static void merge(Comparable[] a, int lo, int mid, int hi) {\n int i = lo, j = mid + 1;\n\n //copy a[lo..hi] to aux[lo..hi]\n for (int k = lo; k <= hi; k++) {\n aux[k] = a[k];\n }\n\n for (int k = lo; k <= hi; k++) {\n if (i > mid) {\n a[k] = aux[j++];\n\n } else if (j > hi) {\n a[k] = aux[i++];\n\n } else if (less(aux[j], aux[i])) {\n a[k] = aux[j++];\n\n } else {\n a[k] = aux[i++];\n\n }\n }\n }", "public void sort(int[] a) {\n\t\tqs(a, 0, a.length-1);\n\t}", "public static double[] copyOfRange(double[] original, int from, int to)\r\n\t{\r\n\t\tif (from > to)\r\n\t\t\tthrow new IllegalArgumentException(\"The initial index is after \" +\r\n\t\t\t\t\t\"the final index.\");\r\n\t\tdouble[] newArray = new double[to - from];\r\n\t\tif (to > original.length)\r\n\t\t{\r\n\t\t\tSystem.arraycopy(original, from, newArray, 0,\r\n\t\t\t\t\toriginal.length - from);\r\n\t\t\tArrays.fill(newArray, original.length, newArray.length, 0d);\r\n\t\t}\r\n\t\telse\r\n\t\t\tSystem.arraycopy(original, from, newArray, 0, to - from);\r\n\t\treturn newArray;\r\n\t}", "int[] toArray();", "public static int[] generateArray(int min, int max, int size) {\n int[] arr = new int[size];\n for (int i = 0; i < size; i++) {\n arr[i] = min + (int) (Math.random() * (max - min));\n }\n return arr;\n }", "public Integer[] createInverseSortedArray() {\n Integer[] value = new Integer[defaultLaenge];\n\n for (int i = 0; i < value.length; i++) {\n value[i] = defaultLaenge - i;\n }\n\n return value;\n }", "public int[] filterByProminence(double lower_threshold, double upper_threshold) {\n ArrayList<Integer> newPeaks = new ArrayList<Integer>();\n for (int i=0; i<this.prominence.length; i++) {\n if (this.prominence[i] >= lower_threshold && this.prominence[i] <= upper_threshold) {\n newPeaks.add(this.midpoints[i]);\n }\n }\n return UtilMethods.convertToPrimitiveInt(newPeaks);\n }", "public java.lang.Object[] getTimeLimitAsArray();", "public static void sort(Comparable[] a) {\n for (int i = 0 ; i < a.length ; i++) { // each position scan\n int min = i;\n for (int j = i+1; j < a.length; j++) { // each time we have to scan through remaining entry\n if (HelperFunctions.less(a[j], a[min])) {\n min = j ;\n }\n HelperFunctions.exch(a, i, min);\n }\n }\n }", "public static void insertionSort(double a[], int low, int high)\n {\n double value;\n int i, j;\n int size = high - low;\n\n for(i = low + 1; i < size; i++) {\n value = a[i];\n j = i;\n\n while(j > 0 && a[j-1] < value) {\n a[j] = a[j-1];\n j = j - 1;\n }\n a[j] = value;\n }\n }", "public static int[] quickSort(int[] arr, int low, int high) {\n if (arr == null || arr.length == 0)\n return arr;\n if (low >= high)\n return arr;\n int middle = low + (high - low) / 2;\n int pivot = arr[middle];\n int i = low, j = high;\n while (i <= j) {\n while (arr[i] < pivot) {\n i++;\n }\n while (arr[j] > pivot) {\n j--;\n }\n if (i <= j) {\n int temp = arr[i];\n arr[i] = arr[j];\n arr[j] = temp;\n i++;\n j--;\n }\n }\n if (low < j)\n quickSort(arr, low, j);\n\n if (high > i)\n quickSort(arr, i, high);\n\n return arr;\n }", "int[] getInts();", "public static int[] normalize(int[] a, int length) {\n\t\tif (a.length >= length) { return a; }\n\t\t\n\t\twhile (a.length < length) {\n\t\t\ta = expand(a);\n\t\t}\n\t\t\n\t\treturn a;\n\t}", "private static int partition(String[] a, int lo, int hi) {\n int i=lo,j=hi+1;\n String tmp;\n while(true) {\n while(a[++i].compareTo(a[lo]) < 0) {\n if(i==hi) break;\n }\n while(a[lo].compareTo(a[--j])<0) {\n if(j==lo) break;\n }\n if(i>=j) break;\n tmp = a[i];\n a[i] = a[j];\n a[j] = tmp;\n }\n tmp = a[lo];\n a[lo] = a[j];\n a[j] = tmp;\n StdOut.printf(\"quicksort(%d, %d, %d): \", lo, j, hi);\n for(int k=0;k<a.length;k++) {\n StdOut.printf(\"%s \", a[k]);\n }\n StdOut.println();\n return j;\n }", "public double[] getArray(){\n\t\t\tdouble[] temp = new double[count];\n\t\t\tfor (int i = 0; i < count; i++){\n\t\t\t\ttemp[i] = anArray[i];\n\t\t\t}\n\t\t\treturn temp;\n\t\t}", "public Object[] toArray(Object ao[])\n {\n // build list of non-expired values\n Object[] aoAll;\n int cAll = 0;\n\n // synchronizing prevents add/remove, keeping size() constant\n OldOldCache map = OldOldCache.this;\n synchronized (map)\n {\n // create the array to store the map values\n int c = map.size();\n aoAll = new Object[c];\n if (c > 0)\n {\n // walk all buckets\n SafeHashMap.Entry[] aeBucket = map.m_aeBucket;\n int cBuckets = aeBucket.length;\n for (int iBucket = 0; iBucket < cBuckets; ++iBucket)\n {\n // walk all entries in the bucket\n Entry entry = (Entry) aeBucket[iBucket];\n while (entry != null)\n {\n if (entry.isExpired())\n {\n removeExpired(entry, true);\n }\n else\n {\n aoAll[cAll++] = entry.getValue();\n }\n entry = entry.getNext();\n }\n }\n }\n }\n\n // if no entries had expired, just return the \"work\" array\n if (ao == null && cAll == aoAll.length)\n {\n return aoAll;\n }\n\n // allocate the necessary array (or stick the null in at the\n // right place) per the Map spec\n if (ao == null)\n {\n ao = new Object[cAll];\n }\n else if (ao.length < cAll)\n {\n ao = (Object[]) Array.newInstance(ao.getClass().getComponentType(), cAll);\n }\n else if (ao.length > cAll)\n {\n ao[cAll] = null;\n }\n\n // copy the data into the array to return and return it\n if (cAll > 0)\n {\n System.arraycopy(aoAll, 0, ao, 0, cAll);\n }\n return ao;\n }", "public static int [] evaluate(int a[]) {\n\t\tint n = a.length;\n\t\tint maxlen = 0;\n\t\tMap<Integer, Integer> map = new HashMap<Integer, Integer>();\n\t\tint sum = 0;\n\t\tint start = 0, end = 0;\n\t\tfor(int i=0; i<n; i++) {\n\t\t\tsum += a[i];\n\t\t\t//case 1: prefix ending at i may be longest\n\t\t\tif(sum == 1) {\n\t\t\t\tmaxlen = i+1;\n\t\t\t\tend = i; start = 0;\n\t\t\t}\n\t\t\t//case 2: suffix ending at i(not starting at 0) may be longest\n\t\t\tif(map.containsKey(sum-1)) {\n\t\t\t\tif(maxlen < i-map.get(sum-1)) {\n\t\t\t\t\tmaxlen = i-map.get(sum-1);\n\t\t\t\t\tstart = map.get(sum-1)+1;\n\t\t\t\t\tend = i;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//using \"!\" b/c we don't want to override the smallest i with this prefix sum\n\t\t\t//in search of longest subarray\n\t\t\tif(!map.containsKey(sum)) map.put(sum, i); \n\t\t}\n\t\tint ans[] = {maxlen, start, end};\n\t\t//System.out.println(\"array : \"+Arrays.toString(a)+\" , start = \"+start+\", end = \"+end+\", max = \"+maxlen);\n\t\treturn ans;\n\t}", "public static int val(int[] a) {\n\n\t\tint count = 0;\n\t\tHashSet<Integer> set = new HashSet<Integer>();\n\t\tfor (int i = 0; i < a.length; i++)\n\t\t\tset.add(a[i]);\n\n\t\tHashMap<Integer, Integer> map = new HashMap<Integer, Integer>();\n\t\tfor (int i = 0, j = 0; i < a.length && j < a.length;) {\n\t\t\twhile (map.size() != set.size()) {\n\t\t\t\tmap.put(a[j], map.getOrDefault(a[j], 0) + 1);\n\t\t\t\tj++;\n\t\t\t\tif (j == a.length)\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\twhile (map.size() == set.size()) {\n\t\t\t\tcount += a.length - j + 1;\n\t\t\t\tif (map.get(a[i]) == 1)\n\t\t\t\t\tmap.remove(a[i]);\n\t\t\t\telse\n\t\t\t\t\tmap.put(a[i], map.get(a[i]) - 1);\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\n\t\treturn count;\n\t}", "public List<Integer> getRepetitiveElementsUnBounded(int[] array) {\n if (array== null) return null;\n\n List<Integer> result = new ArrayList<>();\n Arrays.sort(array); // complexity: O(nlogn)\n\n int startIndex = 0;\n // O(n)\n while (startIndex < array.length) {\n while (startIndex+1 < array.length && array[startIndex] == array[startIndex+1]){\n startIndex++;\n }\n if (startIndex-1 >= 0 && array[startIndex-1] == array[startIndex]) {\n result.add(array[startIndex]);\n }\n startIndex++;\n }\n return result;\n }", "private static int[] merge( int[] a, int[] b ) \n {\n\tint[] c = new int[a.length+b.length];\n\n\tint x=0;\n\tint y=0;\n\tint z=0;\n\n\twhile (x < a.length || y < b.length){\n\t if (x>=a.length) {\n\t\tc[z]=b[y];\n\t\ty++;\n\t }\n\t else if (y>=b.length) {\n\t\tc[z]=a[x];\n\t\tx++;\n\t }\n\n\t else if (a[x] >= b[y]) {\n\t\tc[z] = b[y];\n\t\ty++;\t\t\n\t }\n\t else if (a[x] < b[y]) {\n\t\tc[z] = a[x];\n\t\tx++;\t\t\n\t }\n\t z++;\n\t}\n\treturn c;\n\n }", "public void quickSort(int[] a, int lo0, int hi0) throws Exception\r\n\t\t{\r\n\r\n\t\t\tint lo = lo0;\r\n\t\t\tint hi = hi0;\r\n\t\t\tpause();\r\n\t\t\tif (lo >= hi) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tint mid = a[(lo + hi) / 2];\r\n\t\t\twhile (lo < hi) {\r\n\t\t\t\twhile (lo < hi && a[lo] < mid) {\r\n\t\t\t\t\tlo++;\r\n\t\t\t\t}\r\n\t\t\t\twhile (lo < hi && a[hi] > mid) {\r\n\t\t\t\t\thi--;\r\n\t\t\t\t}\r\n\t\t\t\tif (lo < hi) {\r\n\t\t\t\t\tint T = a[lo];\r\n\t\t\t\t\ta[lo] = a[hi];\r\n\t\t\t\t\ta[hi] = T;\r\n\t\t\t\t\tlo++;\r\n\t\t\t\t\thi--;\r\n\t\t\t\t\tpause();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (hi < lo) {\r\n\t\t\t\tint T = hi;\r\n\t\t\t\thi = lo;\r\n\t\t\t\tlo = T;\r\n\t\t\t}\r\n\t\t\tquickSort(a, lo0, lo);\r\n\t\t\tquickSort(a, lo == lo0 ? lo + 1 : lo, hi0);\r\n\t\t}", "public Object[] toArray(Object a[]) {\r\n if (a.length < size)\r\n//STUB BEGIN\r\n /*a = (Object[])java.lang.reflect.Array.newInstance(\r\n a.getClass().getComponentType(), size);*/\r\n \ta = new Object[size];\r\n//STUB END\r\n int i = 0;\r\n for (Entry e = header.next; e != header; e = e.next)\r\n a[i++] = e.element;\r\n\r\n if (a.length > size)\r\n a[size] = null;\r\n\r\n return a;\r\n }", "private static double[] allarga(double[] a)\r\n\t{\r\n\t\t// in alternativa a copyOf:\r\n\t\t\t\t\t/*\r\n\t\t\t\t\tdouble[] nuovoStorico = new double[storico.length+1];\r\n\t\t\t\t\tfor (int k = 0; k < storico.length; k++) nuovoStorico[k] = storico[k];\r\n\t\t\t\t\tnuovoStorico[storico.length-1] = energia;\r\n\t\t\t\t\tstorico = nuovoStorico;\r\n\t\t\t\t\t */\r\n\t\t\r\n\t\treturn Arrays.copyOf(a, a.length+1);\r\n\t}", "public int[] sort(int[] a) {\n\t\t// Outer loop that will progress the marker one step ahead\n\t\tfor (int i = 1; i < a.length; i++) {\n\t\t\t// Get the current element which we need to compare with the remaining i-1\n\t\t\t// elements of the array\n\t\t\tint key = a[i];\n\t\t\t// Select the j index which checks the 1-1 elements\n\t\t\tint j = i - 1;\n\t\t\t// Loop for these i-1 elements and compare each element with the key in the\n\t\t\t// reverse order\n\t\t\twhile (j >= 0 && a[j] > key) {\n\t\t\t\t// Move the element to the left\n\t\t\t\ta[j + 1] = a[j];\n\t\t\t\t// Decrement counter by 1\n\t\t\t\tj--;\n\t\t\t}\n\t\t\t// Now put the key in its appropriate position\n\t\t\ta[j + 1] = key;\n\t\t}\n\t\treturn a;\n\t}", "private static final boolean isArrayValueAtIndexInsideOrInsideAdjacent(DataSet aDataSet, int i, int pointCount, double aMin, double aMax)\n {\n // If val at index in range, return true\n double val = aDataSet.getX(i);\n if (val >= aMin && val <= aMax)\n return true;\n\n // If val at next index in range, return true\n if (i+1 < pointCount)\n {\n double nextVal = aDataSet.getX(i + 1);\n if (val < aMin && nextVal >= aMin || val > aMax && nextVal <= aMax)\n return true;\n }\n\n // If val at previous index in range, return true\n if (i > 0)\n {\n double prevVal = aDataSet.getX(i - 1);\n if ( val < aMin && prevVal >= aMin || val > aMax && prevVal <= aMax)\n return true;\n }\n\n // Return false since nothing in range\n return false;\n }", "static int[] populateArray(int lenght) {\n\t\tint[] A = new int[lenght];\n\t\t\n\t\tfor(int i=0; i < A.length; i++) {\n\t\t\tA[i] = (int)(Integer.MAX_VALUE * Math.random());\n\t\t}\n\t\t\n\t\treturn A;\n\t}", "int absoluteValuesSumMinimization(int[] a) {\n return a[(a.length-1)/2];\n }" ]
[ "0.7233186", "0.6009235", "0.56813645", "0.5615104", "0.5430987", "0.54206085", "0.54177314", "0.53450364", "0.53366387", "0.532791", "0.53268284", "0.5314805", "0.53010964", "0.52832997", "0.52411157", "0.517275", "0.5168968", "0.5141095", "0.51357365", "0.51341206", "0.5093414", "0.5046063", "0.50402087", "0.50341934", "0.5033826", "0.5026148", "0.5023393", "0.50215423", "0.50156116", "0.50024396", "0.49971843", "0.4988264", "0.49847558", "0.49818984", "0.4964095", "0.49608484", "0.4945933", "0.493481", "0.49324444", "0.49300605", "0.49298793", "0.49260515", "0.49132589", "0.49095914", "0.49067348", "0.49064347", "0.4896685", "0.48835853", "0.4882164", "0.48747045", "0.48683655", "0.48655644", "0.48631492", "0.48612007", "0.48450887", "0.48353764", "0.482481", "0.4820816", "0.48184627", "0.48145276", "0.48126662", "0.48106065", "0.4809763", "0.48042157", "0.48009214", "0.4790094", "0.4787886", "0.47878295", "0.47795683", "0.477848", "0.476979", "0.47690868", "0.47647455", "0.4763496", "0.4761168", "0.47552192", "0.474633", "0.47427085", "0.47422287", "0.4737479", "0.4737059", "0.47358233", "0.47212785", "0.47136375", "0.4710317", "0.47100985", "0.47053832", "0.47050563", "0.46999848", "0.4699887", "0.46972433", "0.4693908", "0.46933025", "0.46885455", "0.4681126", "0.46803933", "0.46749204", "0.46636775", "0.46587476", "0.4657336", "0.46484205" ]
0.0
-1
Returns the smallest value in a that is greater than or equal to the given key. This method throws an IllegalArgumentException if a is null or has zero length, or if there is no qualifying value. Note that key does not have to be an actual value in a. The array a is not changed by this method.
public static <T> T ceiling(Collection<T> c, T key, Comparator<T> comp) { // a is null or has a length of 0 if (c == null || comp == null) { throw new IllegalArgumentException(); } if (c.isEmpty()) { throw new NoSuchElementException(); } T ceiling = null; Iterator<T> itr = c.iterator(); boolean found = false; //Tells if first possible ceiling found while (itr.hasNext()) { T temp = itr.next(); //if haven't found first ceiling, just compare to key. if (!found && comp.compare(temp, key) >= 0) { ceiling = temp; found = true; } //if found first ceiling, compare to key and current ceiling value else if (comp.compare(temp, key) >= 0 && comp.compare(temp, ceiling) <= 0) { ceiling = temp; } } if (!found) { throw new NoSuchElementException(); } return ceiling; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int floor(int[] a, int key) throws IllegalArgumentException {\n if (a == null || a.length == 0) {\n throw new IllegalArgumentException();\n }\n \n int candidate = Integer.MIN_VALUE;\n boolean happen = false;\n \n for (int i : a) {\n if (i <= key && i >= candidate) {\n candidate = i;\n happen = true;\n }\n }\n \n if (happen) {\n return candidate;\n }\n throw new IllegalArgumentException();\n }", "public static int lower_bound_equals(long[] a, long key)\n\t{\n\t\tint low = 0, high = a.length - 1;\n\t\tint mid;\n\t\twhile (low < high)\n\t\t{\n\t\t\tmid = low + (high - low)/2;\n\t\t\tif (a[mid] > key)\n\t\t\t\thigh = mid;\n\t\t\telse\n\t\t\t\tlow = mid - 1;\n\t\t}\n\t\treturn low;\n\t}", "public int searchStrictlyGreater(T key) {\n if ((array.length == 1) ||\n (array[0].compareTo(key) == -1) ||\n (array[array.length - 1].compareTo(key) == 1)) {\n return 0;\n }\n\n int start = 0, end = array.length - 2;\n\n do {\n int mid = start + (end - start)/2;\n if (array[mid].compareTo(key) <= 0) {\n if (array[mid + 1].compareTo(key) > 0) {\n return mid + 1;\n }\n else {\n start = mid + 1;\n }\n }\n else {\n end = mid - 1;\n }\n }\n while (start <= end);\n\n return 0;\n }", "public static int lower_bound(long[] a, long key)\n\t{\n\t\tint low = 0, high = a.length - 1;\n\t\tint mid;\n\t\twhile (low < high)\n\t\t{\n\t\t\tmid = low + (high - low)/2;\n\t\t\tif (a[mid] >= key)\n\t\t\t\thigh = mid;\n\t\t\telse\n\t\t\t\tlow = mid - 1;\n\t\t}\n\t\treturn low;\n\t}", "private static Key min(Key... ks) {\n\t\tif (ks == null || ks.length == 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tKey min = ks[0];\n\t\tfor (int i = 1; i < ks.length; i++) {\n\t\t\tif (ks[i].compareTo(min) < 0) {\n\t\t\t\tmin = ks[i];\n\t\t\t}\n\t\t}\n\t\treturn min;\n\t}", "public static <Key> int firstIndexOf(Key[] a, Key key, Comparator<Key> comparator)\n {\n try\n {\n if ((a) != null && (key) != null && (comparator) != null)\n {\n //Binary search code modified from BinarySearch.java in algs4\n int lo = 0;\n int hi = a.length - 1;\n while (lo <= hi)\n {\n // Key is in a[lo..hi] or not present.\n int mid = lo + (hi - lo) / 2;\n int comp = comparator.compare(key, a[mid]);\n if (comp < 0) hi = mid - 1;\n else if (comp > 0) lo = mid + 1;\n //if the entire range hasn't been scanned,then set the hi to whatever mid is and keep going\n else if (mid != lo) hi = mid;\n else return mid;\n }\n\n\n } else\n {\n throw new java.lang.NullPointerException();\n }\n } catch (NullPointerException e)\n {\n System.err.println(\"One of the arguments is null.\");\n\n }\n return -1;\n }", "int minKey(float key[], Boolean mstSet[]){\n float min = Float.MAX_VALUE;\n int min_index = -1;\n \n for (int v = 0; v < V; v++)\n if (mstSet[v] == false && key[v] < min) {\n min = key[v];\n min_index = v;\n }\n \n return min_index;\n }", "public static int min(int[] a){\r\n\t\tint m = a[0];\r\n\t\tfor( int i=1; i<a.length; i++ )\r\n if( m > a[i] ) m = a[i];\r\n\t\treturn m;\r\n\t}", "public static int ceiling(int[] a, int key) throws IllegalArgumentException {\n if (a == null || a.length == 0) {\n throw new IllegalArgumentException();\n }\n \n int candidate = Integer.MAX_VALUE;\n boolean happen = false;\n \n for (int i : a) {\n if (i >= key && i <= candidate) {\n candidate = i;\n happen = true;\n }\n }\n \n if (happen) {\n return candidate;\n }\n throw new IllegalArgumentException();\n }", "public static <Key> int firstIndexOf(Key[] a, Key key, Comparator<Key> comparator) {\r\n if (a == null || key == null || comparator == null)\r\n throw new NullPointerException();\r\n\r\n return binarySearch(a, key, comparator, Direction.LOWER);\r\n }", "public static int upper_bound_equals(long[] a, long key)\n\t{\n\t\tint low = 0, high = a.length - 1;\n\t\tint mid;\n\t\twhile (low < high)\n\t\t{\n\t\t\tmid = low + (high - low)/2;\n\t\t\tif (a[mid] < key)\n\t\t\t\tlow = mid + 1;\n\t\t\telse\n\t\t\t\thigh = mid;\n\t\t}\n\t\treturn low;\n\t}", "public static <Key> int firstIndexOf(Key[] a, Key key, Comparator<Key> comparator){\n\n if(a == null || key == null || comparator == null) throw new NullPointerException(\"one or multiple arguments null\");\n if(a.length == 0) return -1;\n\n int start = 0;\n int end = a.length - 1;\n\n //binary search - if key is in mid or less, set end = mid, otherwise\n //set start = mid. this will allow end to be set to the first\n //instance of the key, and start will converge to end until\n //they're next to each other\n while(start + 1 < end){\n int mid = start + (end - start) / 2;\n if(comparator.compare(key, a[mid]) <= 0) end = mid;\n else start = mid;\n }\n\n //return index\n if(comparator.compare(key, a[start]) == 0) return start;\n if(comparator.compare(key, a[end]) == 0) return end;\n\n //return if no such key\n return -1;\n }", "public static int kmin(int[] a, int k) throws IllegalArgumentException {\n if (ktest(a, k)) {\n throw new IllegalArgumentException();\n }\n int[] array = Arrays.copyOf(a, a.length);\n int increment = 1;\n int element;\n \n Arrays.sort(array);\n element = array[0];\n \n for (int i = 0; i < array.length; i++) {\n if (element < array[i]) {\n element = array[i];\n increment ++;\n }\n if (k == increment) {\n return element;\n }\n }\n throw new IllegalArgumentException();\n }", "static int numGreaterThanKey(int[] array, int key) {\n\t\treturn numGreaterThanKey(array, key, 0);\n\t}", "public static int rank(int key, int[] a){\n\t\tint lo = 0;\n\t\tint hi = a.length - 1;\n\t\twhile(lo <= hi){\n\t\t\t//Key is in a[lo..hi or not present\n\t\t\tint mid = lo + (hi - lo)/2;\n\t\t\tif(key < a[mid] ){\n\t\t\t\thi = mid - 1;\n\t\t\t}\n\t\t\telse if(key < a[mid]){\n\t\t\t\tlo = mid + 1;\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn mid;\n\t\t}\n\t\treturn -1;\n\t}", "public abstract Key getSmallest();", "public static int rank(int key, int[] a) {\n int lo = 0;\n int hi = a.length - 1;\n while (lo <= hi) { // Key is in a[lo..hi] or not present.\n int mid = lo + (hi - lo) / 2;\n if\n (key < a[mid]) hi = mid - 1;\n else if (key > a[mid]) lo = mid + 1;\n else\n return mid;\n }\n return -1;\n }", "public static int findIdxOfGreatestValueLesserThanOrEqualToN(long[] a, long n) {\n\t\tint lo = 0;\n\t\tint hi = a.length - 1;\n\t\t// int loops = 0;\n\t\twhile (lo <= hi) {\n\t\t\t// ++loops;\n\t\t\t// Key is in a[lo..hi] or not present.\n\t\t\tint mid = lo + (hi - lo) / 2;\n\t\t\tif (n < a[mid]) hi = mid - 1;\n\t\t\telse if (n > a[mid]) lo = mid + 1;\n\t\t\telse return mid; // Equality Match!\n\t\t}\n\t\t// System.err.println(\"k: \" + n + \", loops: \" + loops);\n\t\tif (hi < 0) return -1; // Less than lowest\n\t\telse if (lo >= a.length) return a.length - 1; // Greater than highest\n\t\telse return hi; // Greatest lower element\n\t}", "private static int findKthSmallestElementUsingQuickSelect(int[] a, int low, int high, int k) {\n\n //CHECKS\n //In your original method check if array is null or empty\n //k is from 1 to n\n\n //If k is smaller than number of elements in array\n if (k > 0 && k <= a.length) {\n\n int pi = partition(a, low, high);\n\n if (pi == k - 1) {\n return a[pi];\n }\n if (pi > k - 1) {\n return findKthSmallestElementUsingQuickSelect(a, low, pi - 1, k);\n } else {\n return findKthSmallestElementUsingQuickSelect(a, pi + 1, high, k);\n }\n }\n return Integer.MAX_VALUE;\n }", "int minKey(int[] key, Boolean[] mstSet) {\n // Initialize min value\n int min = Integer.MAX_VALUE, min_index = -1;\n\n for (int v = 0; v < VERTICES; v++)\n if (mstSet[v] == false && key[v] < min) {\n min = key[v];\n min_index = v;\n }\n\n return min_index;\n }", "public static int min(int[] a) throws IllegalArgumentException {\n if (a == null || a.length == 0) {\n throw new IllegalArgumentException();\n }\n int min = a[0];\n \n if (a.length > 1) {\n for (int i = 1; i < a.length; i++) {\n if (a[i] < min) {\n min = a[i];\n }\n }\n }\n return min;\n }", "ComparableExpression<T> min();", "public static int findNextHigher(int[] a, int k) {\n\t int low = 0; \n\t int high = a.length - 1;\n\t \n\t int result = Integer.MAX_VALUE;\n\t while (low <= high) {\n\t int mid = (low + high) / 2;\n\t \n\t if (a[mid] > k) {\n\t result = a[mid]; /*update the result and continue*/\n\t high = mid - 1;\n\t } else {\n\t low = mid + 1;\n\t }\n\t } \n\t \n\t return result;\n\t}", "public static <Key> int lastIndexOf(Key[] a, Key key, Comparator<Key> comparator)\n {\n try\n {\n if ((a) != null && (key) != null && (comparator) != null)\n {\n //Binary searth code modified from BinarySearch.java in algs4\n int lo = 0;\n int hi = a.length - 1;\n while (lo <= hi)\n {\n // Key is in a[lo..hi] or not present.\n int mid = lo + (hi - lo) / 2;\n int comp = comparator.compare(key, a[mid]);\n if (comp < 0) hi = mid - 1;\n else if (comp > 0) lo = mid + 1;\n //if the entire range hasn't been scanned,then set the lo to whatever mid is and keep going\n else if (mid != hi) lo = mid;\n else return mid;\n }\n\n } else\n {\n throw new java.lang.NullPointerException();\n }\n } catch (NullPointerException e)\n {\n System.err.println(\"One of the arguments is null.\");\n\n }\n return -1;\n }", "int findKthSmallest(int[] a, int[] b, int aLength, int bLength, int k) {\n\tif(aLength > bLength)\n\t\treturn findKthSmallest(b,a,bLength,aLength,k);\n\t//Base cases.\n\tif(aLength ==0 && bLength >0)\n\t\treturn b[k-1];\n\tif (k ==1)\n\t\treturn Math.min(a[0],b[0]);\n\t\n\tint i = Math.min(k/2,aLength); // k is always less than length of array.\n\tint j= Math.min(k/2,bLength);\n\t\n\tif(a[i-1] >b[j-1])// slice b, find the k-jth element.\n\t\treturn findKthSmallest(a, Arrays.copyOfRange(b,j,b.length),aLength,bLength-j,k-j);\n\telse \n\t\treturn findKthSmallest(Arrays.copyOfRange(a,i,a.length),b,aLength-i,b,k-i);\n}", "private static int minKey(int[] key, Boolean[] mstSet, int V)\r\n {\r\n // Initialize min value\r\n int min = Integer.MAX_VALUE, min_index=-1;\r\n\r\n for (int v = 0; v < V; v++)\r\n if (!mstSet[v] && key[v] < min)\r\n {\r\n min = key[v];\r\n min_index = v;\r\n }\r\n\r\n return min_index;\r\n }", "private static int firstGreaterEqual(int[] A, int target) {\n int low = 0, high = A.length;\n while (low < high) {\n int mid = low + ((high - low) >> 1);\n //low <= mid < high\n if (A[mid] < target) {\n low = mid + 1;\n } else {\n //should not be mid-1 when A[mid]==target.\n //could be mid even if A[mid]>target because mid<high.\n high = mid;\n }\n }\n return low;\n }", "public static int upper_bound(long[] a, long key)\n\t{\n\t\tint low = 0, high = a.length - 1;\n\t\tint mid;\n\t\twhile (low < high)\n\t\t{\n\t\t\tmid = low + (high - low)/2;\n\t\t\tif (a[mid] <= key)\n\t\t\t\tlow = mid + 1;\n\t\t\telse\n\t\t\t\thigh = mid;\n\t\t}\n\t\treturn low;\n\t}", "public T findLowest(){\n T lowest = array[0]; \n for (int i=0;i<array.length; i++)\n {\n if (array[i].doubleValue()<lowest.doubleValue())\n {\n lowest = array[i]; \n } \n }\n return lowest;\n }", "private static int findKthSmallest(Integer[] arr, int kthSmallest) {\n\t\tArrays.sort(arr);\n\t\t\n\t\t// return kth element;\n\t\treturn arr[kthSmallest-1];\n\t\t\n\t}", "int arraykey(int max);", "public boolean smallerThan(int a, int b)\n\t{\n\t\tif (data[a].compareTo(data[b]) < 0)\n\t\t\treturn true;\n\t\treturn false;\n\t}", "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 }", "private double findMin(){\r\n Set<Map.Entry<Double, Double>> list = heap.entrySet();\r\n double minKey = heap.firstKey();\r\n double minVal = MAX_WEIGHT;\r\n if (list != null){\r\n for (Map.Entry<Double, Double> entry: list){\r\n if (minVal > entry.getValue()){\r\n minVal = entry.getValue();\r\n minKey = entry.getKey();\r\n }\r\n }\r\n }\r\n return minKey;\r\n }", "public static float min(float a, float... vals) {\n\t\tfloat minVal = a;\n\t\tfor (float v : vals) {\n\t\t\tif (v < minVal) {\n\t\t\t\tminVal = v;\n\t\t\t}\n\t\t}\n\t\treturn minVal;\n\t}", "public int compare(Key<Double, Double> a, Key<Double, Double> b){\n\t\t\tif (a.getFirst() < b.getFirst()){\n\t\t\t\treturn -1;\n\t\t\t} else if (a.getFirst() == b.getFirst()){\n\t\t\t\treturn 0;\n\t\t\t} else {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}", "public Key floor(final Key key) {\n int rank = rank(key);\n if (rank == 0) {\n return null;\n }\n if (rank < size && key.compareTo(keys[rank]) == 0) {\n return keys[rank];\n } else {\n return keys[rank - 1];\n }\n }", "public static void sort(int[] a,int key){\n\t\tint lo = 0;\n\t\tint hi = a.length - 1;\n\t\tint j;\n\t\tkey = key - 1;\n\t\tdo{\n\t\t\tj = partition(a,lo,hi);\n\t\t\tif (key < j)\n\t\t\t\thi = j - 1;\n\t\t\telse if (key > j)\n\t\t\t\tlo = j + 1;\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Found, \" + a[j]);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}while(true);\n\t\t\n\t}", "public int BinarySearch(Object[] a, int size, Object key) {\n int start = 0;\n int end = size - 1;\n while (start < end) {\n int mid = (start + size) / 2;\n if (key.equals(a[mid])) {\n return mid;\n } else if (((Comparable) key).compareTo(a[mid]) > 0) {\n start = mid + 1;\n } else {\n end = mid - 1;\n }\n }\n return -1;\n }", "public Key min();", "private static Key max(Key... ks) {\n\t\tif (ks == null || ks.length == 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tKey max = ks[0];\n\t\tfor (int i = 1; i < ks.length; i++) {\n\t\t\tif (ks[i].compareTo(max) > 0) {\n\t\t\t\tmax = ks[i];\n\t\t\t}\n\t\t}\n\t\treturn max;\n\t}", "private static void min(int[] a) {\n int min = a[0];\n for(int i=1; i<a.length; i++){\n if(min > a[i]){\n min = a[i];\n }\n }\n System.out.println(\"Min\" + min);\n\n }", "public static <K, V extends Comparable<? super V>> K minValueKey(Map<K, V> map)\n\t{\n\t\tif (map.size() > 0)\n\t\t{\n\t\t\tList<Map.Entry<K, V>> list = new LinkedList<Map.Entry<K, V>>(map.entrySet());\n\t\t\tCollections.sort(list, new Comparator<Map.Entry<K, V>>()\n\t\t\t{\n\t\t\t\tpublic int compare(Map.Entry<K, V> o1, Map.Entry<K, V> o2)\n\t\t\t\t{\n\t\t\t\t\treturn (o1.getValue()).compareTo(o2.getValue());\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn list.get(0).getKey();\n\t\t\t}\n\t\t\tcatch (IndexOutOfBoundsException e)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t}", "public static double min(double a, double... vals) {\n\t\tdouble minVal = a;\n\t\tfor (double v : vals) {\n\t\t\tif (v < minVal) {\n\t\t\t\tminVal = v;\n\t\t\t}\n\t\t}\n\t\treturn minVal;\n\t}", "public Key floor(Key key)\t\t\t\t//largest key less than or equal to the given key\n\t{\n\t\tNode x=floor(root,key);\n\t\tif(x!=null)\n\t\t\treturn x.key;\n\t\telse return null;\n\t}", "public long min() {\n\t\tif (!this.isEmpty()) {\n\t\t\tlong result = theElements[0];\n\t\t\tfor (int i=1; i<numElements; i++) {\n\t\t\t\tif (theElements[i] < result) {\n\t\t\t\t\tresult = theElements[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\telse {\n\t\t\tthrow new RuntimeException(\"Attempted to find min of empty array\");\n\t\t}\n\t}", "public K min(Tree<K, V> t, K key) {\n\t\treturn left.min(left, this.key);\n\t}", "@Override\n\tpublic int compareTo(Key o) {\n\t\tint temp = 0;\n\t\t\t\t\n\t\tif (this.value > o.value) \t\ttemp = 1;\n\t\telse if (this.value < o.value) temp = -1;\n\t\telse \t\t\t\t\t\t\ttemp = 0;\n\t\t\n\t\treturn temp;\n\t}", "@Override\n public int compare(Integer a, Integer b) {\n if (base.get(a) >= base.get(b)) {\n return 1;\n } else {\n return -1;\n } // returning 0 would merge keys\n }", "public static int getMin(int[] inputArray){\n int minValue = inputArray[0];\n for(int i=1; i<inputArray.length;i++){\n if(inputArray[i] < minValue){\n minValue=inputArray[i];\n }\n }\n return minValue;\n }", "public static int min(int a, int... vals) {\n\t\tint minVal = a;\n\t\tfor (int v : vals) {\n\t\t\tif (v < minVal) {\n\t\t\t\tminVal = v;\n\t\t\t}\n\t\t}\n\t\treturn minVal;\n\t}", "public static <V extends Comparable<? super V>> V minValueKey(List<V> list)\n\t{\n\t\tCollections.sort(list);\n\t\treturn list.get(0);\n\t}", "private static int binarySearch0_BranchFreeUnrolledStatic16(int[] a, int key) {\n\t\tint low = 8;\n\t\tint midVal;\n\t\tint highMask;\n\n\t\tmidVal = a[low];\n\t\tlow += 4;\n\t\thighMask = (int) (((long) key - midVal) >> 63);\n\t\tlow -= 8 & highMask;\n\n\t\tmidVal = a[low];\n\t\tlow += 2;\n\t\thighMask = (int) (((long) key - midVal) >> 63);\n\t\tlow -= 4 & highMask;\n\n\t\tmidVal = a[low];\n\t\tlow += 1;\n\t\thighMask = (int) (((long) key - midVal) >> 63);\n\t\tlow -= 2 & highMask;\n\n\t\tmidVal = a[low];\n\t\thighMask = (int) (((long) key - midVal) >> 63);\n\t\tlow -= 1 & highMask;\n\n\t\treturn a[low] == key ? low : -(low + 1);\n\n\t}", "static int min(int a, int b) { return a < b ? a : b; }", "public T minimum() {\n return min.key;\n }", "private static int binarySearch0(double[] a, int fromIndex, int toIndex,\n\t\t\tdouble key) {\n\t\tint low = fromIndex;\n\t\tint high = toIndex - 1;\n\n\t\twhile (low <= high) {\n\t\t\tint mid = (low + high) >>> 1;\n\t\t\t\tdouble midVal = a[mid];\n\n\t\t\t\tint cmp;\n\t\t\t\tif (midVal < key) {\n\t\t\t\t\tcmp = -1; // Neither val is NaN, thisVal is smaller\n\t\t\t\t} else if (midVal > key) {\n\t\t\t\t\tcmp = 1; // Neither val is NaN, thisVal is larger\n\t\t\t\t} else {\n\t\t\t\t\tlong midBits = Double.doubleToLongBits(midVal);\n\t\t\t\t\tlong keyBits = Double.doubleToLongBits(key);\n\t\t\t\t\tcmp = (midBits == keyBits ? 0 : // Values are equal\n\t\t\t\t\t\t(midBits < keyBits ? -1 : // (-0.0, 0.0) or (!NaN, NaN)\n\t\t\t\t\t\t\t1)); // (0.0, -0.0) or (NaN, !NaN)\n\t\t\t\t}\n\n\t\t\t\tif (cmp < 0)\n\t\t\t\t\tlow = mid + 1;\n\t\t\t\telse if (cmp > 0)\n\t\t\t\t\thigh = mid - 1;\n\t\t\t\telse\n\t\t\t\t\treturn mid; // key found\n\t\t}\n\t\treturn -(low + 1); // key not found.\n\t}", "private int findNearestValue(final int i, final double key) {\n\n\t\tint low = 0;\n\t\tint high = m_NumValues[i];\n\t\tint middle = 0;\n\t\twhile (low < high) {\n\t\t\tmiddle = (low + high) / 2;\n\t\t\tdouble current = m_seenNumbers[i][middle];\n\t\t\tif (current == key) {\n\t\t\t\treturn middle;\n\t\t\t}\n\t\t\tif (current > key) {\n\t\t\t\thigh = middle;\n\t\t\t} else if (current < key) {\n\t\t\t\tlow = middle + 1;\n\t\t\t}\n\t\t}\n\t\treturn low;\n\t}", "private static int getFirst( final Comparable[] c ) {\n\t\tfor ( int i = c.length - 2; i >= 0; --i )\n\t\t\tif ( c[ i ].compareTo( c[ i + 1 ] ) < 0 )\n\t\t\t\treturn i;\n\t\treturn -1;\n\t}", "public static <Key> int lastIndexOf(Key[] a, Key key, Comparator<Key> comparator) {\r\n if (a == null || key == null || comparator == null)\r\n throw new NullPointerException();\r\n\r\n return binarySearch(a, key, comparator, Direction.HIGHER);\r\n }", "public static <Key> int lastIndexOf(Key[] a, Key key, Comparator<Key> comparator){\n\n if(a == null || key == null || comparator == null) throw new NullPointerException(\"one or multiple arguments null\");\n if(a.length == 0) return -1;\n\n int start = 0;\n int end = a.length - 1;\n\n //binary search - if key is less than mid, set end = mid, otherwise\n //set start = mid. this will allow start to be set to the last\n //instance of the key, and end will converge to start until\n //they're next to each other\n while(start + 1 < end){\n int mid = start + (end - start) / 2;\n if(comparator.compare(key, a[mid]) < 0) end = mid;\n else start = mid;\n }\n\n //return index\n if(comparator.compare(key, a[start]) == 0) return start;\n if(comparator.compare(key, a[end]) == 0) return end;\n\n //return if no such key\n return -1;\n }", "private static int binarySearch0(float[] a, int fromIndex, int toIndex,\n\t\t\tfloat key) {\n\t\tint low = fromIndex;\n\t\tint high = toIndex - 1;\n\n\t\twhile (low <= high) {\n\t\t\tint mid = (low + high) >>> 1;\n\t\tfloat midVal = a[mid];\n\n\t\tint cmp;\n\t\tif (midVal < key) {\n\t\t\tcmp = -1; // Neither val is NaN, thisVal is smaller\n\t\t} else if (midVal > key) {\n\t\t\tcmp = 1; // Neither val is NaN, thisVal is larger\n\t\t} else {\n\t\t\tint midBits = Float.floatToIntBits(midVal);\n\t\t\tint keyBits = Float.floatToIntBits(key);\n\t\t\tcmp = (midBits == keyBits ? 0 : // Values are equal\n\t\t\t\t(midBits < keyBits ? -1 : // (-0.0, 0.0) or (!NaN, NaN)\n\t\t\t\t\t1)); // (0.0, -0.0) or (NaN, !NaN)\n\t\t}\n\n\t\tif (cmp < 0)\n\t\t\tlow = mid + 1;\n\t\telse if (cmp > 0)\n\t\t\thigh = mid - 1;\n\t\telse\n\t\t\treturn mid; // key found\n\t\t}\n\t\treturn -(low + 1); // key not found.\n\t}", "private int gallop_left(PyObject key, PyObject[] localData, int localA, int localN,\n int hint)\n {\n //assert_(n > 0 && hint >= 0 && hint < n);\n localA += hint;\n int ofs = 1;\n int lastofs = 0;\n \n if (iflt(localData[localA], key)) {\n /* a[hint] < key -- gallop right, until\n * a[hint + lastofs] < key <= a[hint + ofs]\n */\n int maxofs = localN - hint; // data[a + n - 1] is highest\n while (ofs < maxofs) {\n if (iflt(localData[localA + ofs], key)) {\n lastofs = ofs;\n ofs = (ofs << 1) + 1;\n if (ofs <= 0) // int overflow\n ofs = maxofs;\n } else {\n // key < data[a + hint + ofs]\n break;\n }\n }\n if (ofs > maxofs)\n ofs = maxofs;\n // Translate back to offsets relative to a.\n lastofs += hint;\n ofs += hint;\n } else {\n /* key <= a[hint] -- gallop left, until\n * a[hint - ofs] < key <= a[hint - lastofs]\n */\n int maxofs = hint + 1; // data[a] is lowest\n while (ofs < maxofs) {\n if (iflt(localData[localA - ofs], key))\n break;\n // key <= data[a + hint - ofs]\n lastofs = ofs;\n ofs = (ofs << 1) + 1;\n if (ofs <= 0) // int overflow\n ofs = maxofs;\n }\n if (ofs > maxofs)\n ofs = maxofs;\n // Translate back to offsets relative to a.\n int k = lastofs;\n lastofs = hint - ofs;\n ofs = hint - k;\n }\n localA -= hint;\n //assert_(-1 <= lastofs && lastofs < ofs && ofs <= n);\n /* Now a[lastofs] < key <= a[ofs], so key belongs somewhere to the\n * right of lastofs but no farther right than ofs. Do a binary\n * search, with invariant a[lastofs-1] < key <= a[ofs].\n */\n ++lastofs;\n while (lastofs < ofs) {\n int m = lastofs + ((ofs - lastofs) >> 1);\n if (iflt(localData[localA + m], key))\n lastofs = m+1; // data[a + m] < key\n else\n ofs = m; // key <= data[a + m]\n }\n //assert_(lastofs == ofs); // so data[a + ofs -1] < key <= data[a+ofs]\n return ofs;\n }", "int[] smallestK(int[] array, int k) {\n if (k <= 0 || k > array.length) {\n throw new IllegalArgumentException();\n }\n Arrays.sort(array);\n\n int[] smallest = new int[k];\n for (int i = 0; i < k; i++) {\n smallest[i] = array[i];\n }\n return smallest;\n }", "public static <T extends Comparable<? super T>> BST<T> minHeight(T[] a) {\n Check.nullCheck(a, \"item array\");\n for (T item : a) {\n Check.nullCheck(item, \"item\");\n }\n \n BST<T> bst = new BST<T>();\n minHeightHelper(bst, a, 0, a.length - 1);\n return bst;\n }", "Object getMinimumValue(Object elementID) throws Exception;", "public static void sort(Comparable[] a) {\n for (int i = 0 ; i < a.length ; i++) { // each position scan\n int min = i;\n for (int j = i+1; j < a.length; j++) { // each time we have to scan through remaining entry\n if (HelperFunctions.less(a[j], a[min])) {\n min = j ;\n }\n HelperFunctions.exch(a, i, min);\n }\n }\n }", "public static int binSearch(int[] a, int first, int last, int key)\n\t{\t\n\t\tif(first <= last)\n\t\t{\n\t\t\tint mid = (first + last) / 2; //Divides the beginning of the array and the length of the array into 2\n\t\t\t\n\t\t\tif (a[mid] == key)\n\t\t\t{\n\t\t\t\treturn mid; \n\t\t\t}\n\t\t\t\n\t\t\telse if (a[mid] > key) //IF THE INDEX(WHICH IS THE MID) OF ARRAY A IS GREATER THAN THE KEY\n\t\t\t{\n\t\t\t\treturn last = mid - 1; //RETURNS THE LENGTH OF THE ARRAY WHICH IS THE DECREMENTED MID\n\t\t\t}\n\t\t\t\n\t\t\telse //IF THE INDEX(WHICH IS THE MID) OF ARRAY A IS LESS THAN THE KEY\n\t\t\t{\n\t\t\t\treturn first = mid + 1; //RETURNS THE FIRST = INCREMENTED MID\t\t\n\t\t\t}\n\t\t}\n\t\treturn -1;\t\n\t}", "public int get(int key) {\n if(arr[key] == -1)\n return 0;\n else if(arr[key] == 0)\n return -1;\n else return arr[key];\n }", "public static void sort(Comparable[] a) {\n int minPos = 0;\n for (int i = 1; i < a.length; i++) {\n if (less(a[i], a[minPos])) minPos = i;\n }\n if (minPos != 0) exch(a, 0, minPos);\n\n // Modify i from 0 to 1, this can avoid index out of bound error\n for (int i = 1; i < a.length; i++) {\n for (int j = i; less(a[j], a[j - 1]); j--) {\n exch(a, j, j - 1);\n }\n }\n }", "int minPriority(){\n if (priorities.length == 0)\n return -1;\n\n int index = 0;\n int min = priorities[index];\n\n for (int i = 1; i < priorities.length; i++){\n if ((priorities[i]!=(-1))&&(priorities[i]<min)){\n min = priorities[i];\n index = i;\n }\n }\n return values[index];\n }", "public static int kmax(int[] a, int k) throws IllegalArgumentException {\n if (ktest(a, k)) {\n throw new IllegalArgumentException();\n }\n int[] array = Arrays.copyOf(a, a.length);\n int element;\n int increment = 1;\n \n Arrays.sort(array);\n element = array[array.length - 1];\n \n for (int i = array.length - 1; i > -1; i--) {\n if (element > array[i]) {\n element = array[i];\n increment ++;\n }\n if (k == increment) {\n return element;\n }\n }\n throw new IllegalArgumentException();\n }", "public abstract Key getLargest();", "public static int findNextHigherIndex(int[] a, int k) {\n\t\tint start = 0, end = a.length - 1; \n\t \n int ans = -1; \n while (start <= end) { \n int mid = (start + end) / 2; \n \n // Move to right side if target is \n // greater. \n if (a[mid] <= k) { \n start = mid + 1; \n } \n \n // Move left side. \n else { \n ans = mid; \n end = mid - 1; \n } \n } \n return ans;\n\t}", "private long minKey() {\n if (left.size == 0) return key;\n // make key 'absolute' (i.e. relative to the parent of this):\n return left.minKey() + this.key;\n }", "@Test\n\tpublic void testExtractMin() {\n\t\tHeap heap = new Heap(testArrayList.length);\n\t\tdouble[] expected = new double[] { 5, 7, 24, 36, 15, 48, 32, 47, 93, 27, 38, 70, 53, 33, 93 };\n\t\theap.build(testArrayList);\n\t\tassertEquals(3, heap.extractMin().key);\n\t\tassertArrayEquals(expected, heap.getKeyArray());\n\t\tassertEquals(14, heap.getSize());\n\t}", "public Key ceiling(Key key)\t\t\t\t//smallest key greater than or equal to the given key\n\t{\n\t\tNode x=ceiling(root,key);\n\t\tif(x!=null)\n\t\t\treturn x.key;\n\t\telse return null;\n\t}", "public static int findMin(int[] A) {\n\t\tint ans = 0;\n\t\tfor(int i=1; i<A.length; i++) {\n\t\t\tif(ans > A[i]) {\n\t\t\t\tans = A[i];\n\t\t\t}\n\t\t}\n\t\treturn ans;\n\t}", "int min() {\n\t\t// added my sort method in the beginning to sort our array\n\t\tint n = array.length;\n\t\tint temp = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 1; j < (n - i); j++) {\n\t\t\t\tif (array[j - 1] > array[j]) {\n\t\t\t\t\ttemp = array[j - 1];\n\t\t\t\t\tarray[j - 1] = array[j];\n\t\t\t\t\tarray[j] = temp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// finds the first term in the array --> first term should be min if\n\t\t// sorted\n\t\tint x = array[0];\n\t\treturn x;\n\t}", "private int min(int a, int b) {\n\t\treturn a<b?a:b;\n\t}", "public static int findMinSortingSubArray(int[] A) {\r\n\t\tint leftPointer=A.length,rightPointer=0;\r\n\t\tStack<Integer> stack=new Stack<Integer>();\r\n\t\tfor (int i = 0; i < A.length; i++) {\r\n\t\t\twhile(!stack.isEmpty() && A[stack.peek()]>A[i])\r\n\t\t\t\tleftPointer=Math.min(leftPointer, stack.pop());\r\n\t\t\tstack.add(i);\r\n\t\t}\r\n\t\tstack.clear();\r\n\t\tfor (int i = A.length-1; i >=0; i--) {\r\n\t\t\twhile(!stack.isEmpty() && A[stack.peek()]<A[i])\r\n\t\t\t\trightPointer=Math.max(rightPointer, stack.pop());\r\n\t\t\tstack.add(i);\r\n\t\t}\r\n\t\treturn rightPointer-leftPointer>0?rightPointer-leftPointer+1:0;\r\n\t\t\r\n\t}", "public static <T> T floor(Collection<T> c, T key, Comparator<T> comp) {\n // a is null or has a length of 0\n if (c == null || comp == null) {\n throw new IllegalArgumentException();\n }\n if (c.isEmpty()) {\n throw new NoSuchElementException();\n }\n \n // Minimum value\n Iterator<T> itr = c.iterator();\n T floor = itr.next();\n if (itr.hasNext()) {\n \n for (T element: c) {\n if (comp.compare(element, floor) < 0) {\n floor = element;\n }\n }\n \n }\n \n \n int change = 0;\n \n // Lowest value equal to or above the key.\n for (T element: c) {\n if ((comp.compare(element, key) <= 0)\n && (comp.compare(element, floor) >= 0)) {\n floor = element;\n change++;\n }\n }\n \n // No qualifying value for ceiling.\n if (change == 0) {\n throw new NoSuchElementException();\n }\n \n return floor;\n }", "@Nullable\n protected abstract Map.Entry<K, V> onGetLowestEntry();", "E minVal();", "private static int bSearch(int[] elements, int key) {\n int left = 0, right = elements.length - 1, mid = 0;\n while (left <= right) {\n mid = (left + right) / 2;\n\n if (key < elements[mid]) {\n right = mid - 1;\n } else if (key == elements[mid]) {\n return mid;\n } else {\n left = mid + 1;\n }\n }\n return -1;\n }", "private static int indexOfSmallest(int[] a, int start) {\n int minNum = a[start];\n int minIndex = start;\n for(int i=start; i<a.length; i++){\n if(a[i]<minNum){\n minNum = a[i];\n minIndex = i;\n }\n\n }\n return minIndex;\n }", "public static int findMin(){\n int min = array[0];\n for(int x = 1; x<array.length; x++ ){\n if(array[x]<min){\n min=array[x];\n }\n }\n return min;\n}", "public static void selectionSort(Comparable[] a) {\n int n = a.length;\n int im;\n for (int i = 0; i < n; i++) {\n im = i;\n for (int j = im; j < n; j++) {\n // Find the min\n if (less(a[j], a[im])) im = j;\n if (i != im) exch(a, i, im);\n }\n }\n }", "public E returnMinElement(){\r\n if (theData.size() <= 0) return null;\r\n\r\n E min = theData.get(0).getData();\r\n\r\n for (int i = 0; i< theData.size() ; i++){\r\n if (min.compareTo(theData.get(i).getData()) > 0 ){\r\n min = theData.get(i).getData();\r\n }\r\n }\r\n return min;\r\n }", "private double min(double a, double b) {\n if (a > b) {\n return b;\n }\n return a;\n }", "public node_data heapMinimum(){return _a[0];}", "public DHeap_Item Get_Min()\n {\n\treturn array[0];\n }", "private static int minimumPosition(int[] a, int from)\n {\n int minPos = from;\n for (int i = from + 1; i < a.length; i++) \n {\n if (a[i] < a[minPos]) { minPos = i; }\n }\n return minPos;\n }", "public String getMinKey();", "private PriorityQueue<Integer> get(Node x, int key) {\n while (x != null) {\n int cmp = key - x.key;\n if (cmp < 0)\n x = x.left;\n else if (cmp > 0)\n x = x.right;\n else\n return x.val;\n }\n return null;\n }", "@Override\n\t@TimeComplexity(\"O(log n)\")\n\tpublic Entry<K, V> higherEntry(K key) {\n\t/* TCJ \n\t * Binary search operation: log n\n\t */\n\t\tint j = findIndex(key);\n\t\tif ( j < size() && key.equals(map.get(j).getKey())) j++;\n\t\treturn safeEntry(j);\n\t}", "int getMinValue(AVLTreeNode node)\r\n {\n if (node == null) return Integer.MIN_VALUE;\r\n\r\n // if this is the left-most node\r\n if (node.left == null) return node.key;\r\n\r\n return getMinValue(node.left);\r\n }", "private double getLowest()\n {\n if (currentSize == 0)\n {\n return 0;\n }\n else\n {\n double lowest = scores[0];\n for (int i = 1; i < currentSize; i++)\n {\n if (scores[i] < lowest)\n {\n scores[i] = lowest;\n }\n }\n return lowest;\n }\n }", "public int FindMinRotatedArray(int[] ar){\n\n int n = ar.length;\n int lo = 0;\n int hi = n - 1;\n while(lo <= hi){\n\n if(ar[lo] <= ar[hi]) // (sub) array is already sorted, yay!\n return ar[lo];\n\n int mid = lo + (hi - lo)/2; //prevent int overflow, assumes all are positive\n int next = (mid + 1) % n; //modulus is needed if mid is the start/end of the array\n int prev = (mid + n - 1) % n;\n\n //check if mid is the min. Both it's previous and next are higher\n if((ar[mid] <=ar[prev])&&(ar[mid] <=ar[next]))\n return ar[mid];\n\n //figure out where is the dip\n if(ar[mid] <= ar[lo])\n hi = mid - 1; //the dip is in the half left side\n else\n lo = mid + 1;\n }\n\n return -1;\n }", "@Override\n public UInt256 getPriorStorageValue(final Address address, final UInt256 key) {\n return getStorageValue(address, key);\n }", "static int maxMin(int k, int[] arr) {\n Arrays.sort(arr);\n return IntStream.range(0, arr.length - k + 1).map(i -> arr[i + k - 1] - arr[i]).min().getAsInt();\n }", "public static float min(float [] array)\r\n\t{\r\n\t\tfloat minValue = array[0];\r\n\t\tfor (int i = 1; i < array.length; i++)\r\n\t\t{\r\n\t\t\tif (array[i] < minValue)\r\n\t\t\t{\r\n\t\t\t\tminValue = array[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn minValue;\r\n\t}" ]
[ "0.69210666", "0.6562654", "0.6521457", "0.65042424", "0.6248657", "0.62360996", "0.6156042", "0.59909564", "0.59523916", "0.58891785", "0.5845993", "0.58312035", "0.57992893", "0.5761462", "0.57548857", "0.5752696", "0.57163936", "0.570965", "0.5666612", "0.56005514", "0.55909014", "0.55587685", "0.55264485", "0.54998696", "0.5485832", "0.54757625", "0.54432714", "0.54431415", "0.54197454", "0.54079455", "0.5393759", "0.5375623", "0.5371534", "0.53656787", "0.5363436", "0.5353968", "0.532794", "0.53211385", "0.5302693", "0.53025085", "0.5291905", "0.5288721", "0.52721107", "0.52584547", "0.52550185", "0.5253928", "0.5252729", "0.52385247", "0.5228272", "0.519439", "0.5194235", "0.51878506", "0.51801115", "0.51751786", "0.5173869", "0.51727074", "0.51585406", "0.5154548", "0.51423204", "0.51390254", "0.5132593", "0.51299286", "0.51157373", "0.51111263", "0.5106422", "0.5105691", "0.51011765", "0.5100358", "0.5096772", "0.50921655", "0.50820947", "0.50753474", "0.50745183", "0.50603795", "0.50497556", "0.5035406", "0.5030807", "0.50302243", "0.50264686", "0.5023227", "0.5017332", "0.50121814", "0.5007768", "0.50021785", "0.49967766", "0.49932945", "0.49924907", "0.49911937", "0.49897534", "0.49818462", "0.49812347", "0.49798658", "0.49787298", "0.49776497", "0.49541363", "0.49353668", "0.493332", "0.49331757", "0.4921531", "0.49201143", "0.49123368" ]
0.0
-1
Returns the largest value in a that is less than or equal to the given key. This method throws an IllegalArgumentException if a is null or has zero length, or if there is no qualifying value. Note that key does not have to be an actual value in a. The array a is not changed by this method.
public static <T> T floor(Collection<T> c, T key, Comparator<T> comp) { // a is null or has a length of 0 if (c == null || comp == null) { throw new IllegalArgumentException(); } if (c.isEmpty()) { throw new NoSuchElementException(); } // Minimum value Iterator<T> itr = c.iterator(); T floor = itr.next(); if (itr.hasNext()) { for (T element: c) { if (comp.compare(element, floor) < 0) { floor = element; } } } int change = 0; // Lowest value equal to or above the key. for (T element: c) { if ((comp.compare(element, key) <= 0) && (comp.compare(element, floor) >= 0)) { floor = element; change++; } } // No qualifying value for ceiling. if (change == 0) { throw new NoSuchElementException(); } return floor; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int searchStrictlyGreater(T key) {\n if ((array.length == 1) ||\n (array[0].compareTo(key) == -1) ||\n (array[array.length - 1].compareTo(key) == 1)) {\n return 0;\n }\n\n int start = 0, end = array.length - 2;\n\n do {\n int mid = start + (end - start)/2;\n if (array[mid].compareTo(key) <= 0) {\n if (array[mid + 1].compareTo(key) > 0) {\n return mid + 1;\n }\n else {\n start = mid + 1;\n }\n }\n else {\n end = mid - 1;\n }\n }\n while (start <= end);\n\n return 0;\n }", "public static int floor(int[] a, int key) throws IllegalArgumentException {\n if (a == null || a.length == 0) {\n throw new IllegalArgumentException();\n }\n \n int candidate = Integer.MIN_VALUE;\n boolean happen = false;\n \n for (int i : a) {\n if (i <= key && i >= candidate) {\n candidate = i;\n happen = true;\n }\n }\n \n if (happen) {\n return candidate;\n }\n throw new IllegalArgumentException();\n }", "public static int ceiling(int[] a, int key) throws IllegalArgumentException {\n if (a == null || a.length == 0) {\n throw new IllegalArgumentException();\n }\n \n int candidate = Integer.MAX_VALUE;\n boolean happen = false;\n \n for (int i : a) {\n if (i >= key && i <= candidate) {\n candidate = i;\n happen = true;\n }\n }\n \n if (happen) {\n return candidate;\n }\n throw new IllegalArgumentException();\n }", "public static int findIdxOfGreatestValueLesserThanOrEqualToN(long[] a, long n) {\n\t\tint lo = 0;\n\t\tint hi = a.length - 1;\n\t\t// int loops = 0;\n\t\twhile (lo <= hi) {\n\t\t\t// ++loops;\n\t\t\t// Key is in a[lo..hi] or not present.\n\t\t\tint mid = lo + (hi - lo) / 2;\n\t\t\tif (n < a[mid]) hi = mid - 1;\n\t\t\telse if (n > a[mid]) lo = mid + 1;\n\t\t\telse return mid; // Equality Match!\n\t\t}\n\t\t// System.err.println(\"k: \" + n + \", loops: \" + loops);\n\t\tif (hi < 0) return -1; // Less than lowest\n\t\telse if (lo >= a.length) return a.length - 1; // Greater than highest\n\t\telse return hi; // Greatest lower element\n\t}", "public static int lower_bound_equals(long[] a, long key)\n\t{\n\t\tint low = 0, high = a.length - 1;\n\t\tint mid;\n\t\twhile (low < high)\n\t\t{\n\t\t\tmid = low + (high - low)/2;\n\t\t\tif (a[mid] > key)\n\t\t\t\thigh = mid;\n\t\t\telse\n\t\t\t\tlow = mid - 1;\n\t\t}\n\t\treturn low;\n\t}", "static int numGreaterThanKey(int[] array, int key) {\n\t\treturn numGreaterThanKey(array, key, 0);\n\t}", "public static int lower_bound(long[] a, long key)\n\t{\n\t\tint low = 0, high = a.length - 1;\n\t\tint mid;\n\t\twhile (low < high)\n\t\t{\n\t\t\tmid = low + (high - low)/2;\n\t\t\tif (a[mid] >= key)\n\t\t\t\thigh = mid;\n\t\t\telse\n\t\t\t\tlow = mid - 1;\n\t\t}\n\t\treturn low;\n\t}", "public static int upper_bound(long[] a, long key)\n\t{\n\t\tint low = 0, high = a.length - 1;\n\t\tint mid;\n\t\twhile (low < high)\n\t\t{\n\t\t\tmid = low + (high - low)/2;\n\t\t\tif (a[mid] <= key)\n\t\t\t\tlow = mid + 1;\n\t\t\telse\n\t\t\t\thigh = mid;\n\t\t}\n\t\treturn low;\n\t}", "public static int upper_bound_equals(long[] a, long key)\n\t{\n\t\tint low = 0, high = a.length - 1;\n\t\tint mid;\n\t\twhile (low < high)\n\t\t{\n\t\t\tmid = low + (high - low)/2;\n\t\t\tif (a[mid] < key)\n\t\t\t\tlow = mid + 1;\n\t\t\telse\n\t\t\t\thigh = mid;\n\t\t}\n\t\treturn low;\n\t}", "private static Key max(Key... ks) {\n\t\tif (ks == null || ks.length == 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tKey max = ks[0];\n\t\tfor (int i = 1; i < ks.length; i++) {\n\t\t\tif (ks[i].compareTo(max) > 0) {\n\t\t\t\tmax = ks[i];\n\t\t\t}\n\t\t}\n\t\treturn max;\n\t}", "public static <Key> int lastIndexOf(Key[] a, Key key, Comparator<Key> comparator)\n {\n try\n {\n if ((a) != null && (key) != null && (comparator) != null)\n {\n //Binary searth code modified from BinarySearch.java in algs4\n int lo = 0;\n int hi = a.length - 1;\n while (lo <= hi)\n {\n // Key is in a[lo..hi] or not present.\n int mid = lo + (hi - lo) / 2;\n int comp = comparator.compare(key, a[mid]);\n if (comp < 0) hi = mid - 1;\n else if (comp > 0) lo = mid + 1;\n //if the entire range hasn't been scanned,then set the lo to whatever mid is and keep going\n else if (mid != hi) lo = mid;\n else return mid;\n }\n\n } else\n {\n throw new java.lang.NullPointerException();\n }\n } catch (NullPointerException e)\n {\n System.err.println(\"One of the arguments is null.\");\n\n }\n return -1;\n }", "int arraykey(int max);", "public static int findNextHigher(int[] a, int k) {\n\t int low = 0; \n\t int high = a.length - 1;\n\t \n\t int result = Integer.MAX_VALUE;\n\t while (low <= high) {\n\t int mid = (low + high) / 2;\n\t \n\t if (a[mid] > k) {\n\t result = a[mid]; /*update the result and continue*/\n\t high = mid - 1;\n\t } else {\n\t low = mid + 1;\n\t }\n\t } \n\t \n\t return result;\n\t}", "public static int kmax(int[] a, int k) throws IllegalArgumentException {\n if (ktest(a, k)) {\n throw new IllegalArgumentException();\n }\n int[] array = Arrays.copyOf(a, a.length);\n int element;\n int increment = 1;\n \n Arrays.sort(array);\n element = array[array.length - 1];\n \n for (int i = array.length - 1; i > -1; i--) {\n if (element > array[i]) {\n element = array[i];\n increment ++;\n }\n if (k == increment) {\n return element;\n }\n }\n throw new IllegalArgumentException();\n }", "public static int max(int[] a) {\n\t\tint b=a[0];\r\n\t\tfor(int i=0;i<a.length;i++) {\r\n\t\t\tif(a[i]>b) {\r\n\t\t\t\tb=a[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn b;\r\n\t}", "public static <Key> int lastIndexOf(Key[] a, Key key, Comparator<Key> comparator) {\r\n if (a == null || key == null || comparator == null)\r\n throw new NullPointerException();\r\n\r\n return binarySearch(a, key, comparator, Direction.HIGHER);\r\n }", "public abstract Key getLargest();", "public static int rank(int key, int[] a){\n\t\tint lo = 0;\n\t\tint hi = a.length - 1;\n\t\twhile(lo <= hi){\n\t\t\t//Key is in a[lo..hi or not present\n\t\t\tint mid = lo + (hi - lo)/2;\n\t\t\tif(key < a[mid] ){\n\t\t\t\thi = mid - 1;\n\t\t\t}\n\t\t\telse if(key < a[mid]){\n\t\t\t\tlo = mid + 1;\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn mid;\n\t\t}\n\t\treturn -1;\n\t}", "public static int rank(int key, int[] a) {\n int lo = 0;\n int hi = a.length - 1;\n while (lo <= hi) { // Key is in a[lo..hi] or not present.\n int mid = lo + (hi - lo) / 2;\n if\n (key < a[mid]) hi = mid - 1;\n else if (key > a[mid]) lo = mid + 1;\n else\n return mid;\n }\n return -1;\n }", "public static int max(int[] a){\r\n\t\tint m = a[0];\r\n\t\tfor( int i=1; i<a.length; i++ )\r\n\t\t\tif( m < a[i] ) m = a[i];\r\n\t\treturn m;\r\n\t}", "public static int get_max(Integer[] a){\n int max = Integer.MIN_VALUE;\n\n for (int i = 0; i < a.length; i++){\n if (a[i] > max);\n max = a[i];\n }\n return max;\n }", "public static <Key> int lastIndexOf(Key[] a, Key key, Comparator<Key> comparator){\n\n if(a == null || key == null || comparator == null) throw new NullPointerException(\"one or multiple arguments null\");\n if(a.length == 0) return -1;\n\n int start = 0;\n int end = a.length - 1;\n\n //binary search - if key is less than mid, set end = mid, otherwise\n //set start = mid. this will allow start to be set to the last\n //instance of the key, and end will converge to start until\n //they're next to each other\n while(start + 1 < end){\n int mid = start + (end - start) / 2;\n if(comparator.compare(key, a[mid]) < 0) end = mid;\n else start = mid;\n }\n\n //return index\n if(comparator.compare(key, a[start]) == 0) return start;\n if(comparator.compare(key, a[end]) == 0) return end;\n\n //return if no such key\n return -1;\n }", "public static int secondaryArgmax(double[] a) {\n\t\tint mi = argmax(a);\n\t\t// scan left until increasing\n\t\tint i;\n\t\tfor (i=mi-1; i>=0 && a[i]<=a[i+1]; i--);\n\t\tint l = argmax(a,0,i+1);\n\t\tfor (i=mi+1; i<a.length && a[i]<=a[i-1]; i++);\n\t\tint r = argmax(a,i,a.length);\n\t\tif (l==-1) return r;\n\t\tif (r==-1) return l;\n\t\treturn a[l]>=a[r]?l:r;\n\t}", "public static <K, V extends Comparable<? super V>> K maxValueKey(Map<K, V> map)\n\t{\n\t\tif (map.size() > 0)\n\t\t{\n\t\t\tList<Map.Entry<K, V>> list = new LinkedList<Map.Entry<K, V>>(map.entrySet());\n\t\t\tCollections.sort(list, new Comparator<Map.Entry<K, V>>()\n\t\t\t{\n\t\t\t\tpublic int compare(Map.Entry<K, V> o1, Map.Entry<K, V> o2)\n\t\t\t\t{\n\t\t\t\t\treturn (o2.getValue()).compareTo(o1.getValue());\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn list.get(0).getKey();\n\t\t\t}\n\t\t\tcatch (IndexOutOfBoundsException e)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t}", "public static <E extends Comparable<E>> E compare(E[] element){\n Arrays.sort(element);\n int length = element.length;\n E max = element[length -1];\n System.out.println(\"max\"+max); //std to give the max value\n return max;\n\n }", "public static int findMax(int[] a) {\r\n int max = a[0];\r\n\r\n //10th error , n = 1\r\n for (int n = 1; n < a.length; n++) {\r\n if (a[n] > max) {\r\n max = a[n];\r\n }\r\n }\r\n return max;\r\n\r\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 <Key> int firstIndexOf(Key[] a, Key key, Comparator<Key> comparator)\n {\n try\n {\n if ((a) != null && (key) != null && (comparator) != null)\n {\n //Binary search code modified from BinarySearch.java in algs4\n int lo = 0;\n int hi = a.length - 1;\n while (lo <= hi)\n {\n // Key is in a[lo..hi] or not present.\n int mid = lo + (hi - lo) / 2;\n int comp = comparator.compare(key, a[mid]);\n if (comp < 0) hi = mid - 1;\n else if (comp > 0) lo = mid + 1;\n //if the entire range hasn't been scanned,then set the hi to whatever mid is and keep going\n else if (mid != lo) hi = mid;\n else return mid;\n }\n\n\n } else\n {\n throw new java.lang.NullPointerException();\n }\n } catch (NullPointerException e)\n {\n System.err.println(\"One of the arguments is null.\");\n\n }\n return -1;\n }", "public static int findNextHigherIndex(int[] a, int k) {\n\t\tint start = 0, end = a.length - 1; \n\t \n int ans = -1; \n while (start <= end) { \n int mid = (start + end) / 2; \n \n // Move to right side if target is \n // greater. \n if (a[mid] <= k) { \n start = mid + 1; \n } \n \n // Move left side. \n else { \n ans = mid; \n end = mid - 1; \n } \n } \n return ans;\n\t}", "double largestNumber(double[] a) {\n\t\tdouble max = a[0];\n\t\tdouble no = 0;\n\t\tfor (int index = 1; index < a.length; index++) {\n\t\t\tif (max > a[index] && max > a[index + 1]) {\n\t\t\t\tno = max;\n\t\t\t\tbreak;\n\t\t\t} else if (a[index] > max && a[index] > a[index + 1]) {\n\t\t\t\tno = a[index];\n\t\t\t\tbreak;\n\t\t\t} else if (a[index + 1] > max && a[index + 1] > a[index]) {\n\t\t\t\tno = a[index + 1];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn no;\n\t}", "public int get(int key) {\n if(arr[key] == -1)\n return 0;\n else if(arr[key] == 0)\n return -1;\n else return arr[key];\n }", "public int[] getMaxSub(int[] array, int k) {\r\n int out[] = new int[k];\r\n int idx = 0;\r\n for (int i = 0; i < array.length; i++) {\r\n // move the pointer back only when both condition happens\r\n // 1. current element is larger than last one in candidate\r\n // 2. there are enough elements in rest of array\r\n while (idx > 0 && array.length - i + idx > k && out[idx-1] < array[i]) {\r\n idx--;\r\n }\r\n if (idx < k)\r\n out[idx++] = array[i];\r\n }\r\n return out;\r\n }", "public T getMax()\n\t{\n\t\tif(size == 0)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\telse if(size == 1)\n\t\t{\n\t\t\treturn array[0];\n\t\t}\n\t\telse if(size == 2)\n\t\t{\n\t\t\treturn array[1];\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\tif(object.compare(array[1], array[2]) < 0)\n\t\t\t{\n\t\t\t\treturn array[2];\n\t\t\t}\n\t\t\telse if(object.compare(array[1], array[2]) > 0)\n\t\t\t{\n\t\t\t\treturn array[1];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn array[1];\n\t\t\t}\n\n\t\t}\n\t}", "@Override\n\t@TimeComplexity(\"O(log n)\")\n\tpublic Entry<K, V> higherEntry(K key) {\n\t/* TCJ \n\t * Binary search operation: log n\n\t */\n\t\tint j = findIndex(key);\n\t\tif ( j < size() && key.equals(map.get(j).getKey())) j++;\n\t\treturn safeEntry(j);\n\t}", "public static int max(int[] a) throws IllegalArgumentException {\n if (a == null || a.length == 0) {\n throw new IllegalArgumentException();\n }\n int max = a[0];\n \n if (a.length > 1) {\n for (int i = 1; i < a.length; i++) {\n if (a[i] > max) {\n max = a[i];\n }\n }\n }\n return max;\n }", "private static int firstGreaterEqual(int[] A, int target) {\n int low = 0, high = A.length;\n while (low < high) {\n int mid = low + ((high - low) >> 1);\n //low <= mid < high\n if (A[mid] < target) {\n low = mid + 1;\n } else {\n //should not be mid-1 when A[mid]==target.\n //could be mid even if A[mid]>target because mid<high.\n high = mid;\n }\n }\n return low;\n }", "public T findHighest(){\n T highest = array[0];\n for (int i=0;i<array.length; i++)\n {\n if (array[i].doubleValue()>highest.doubleValue())\n {\n highest = array[i];\n } \n }\n return highest;\n }", "public static <K, V, C extends Comparator<Map.Entry<K, V>>> K maxValueKey(Map<K, V> map, C c)\n\t{\n\t\tList<Map.Entry<K, V>> list = new LinkedList<Map.Entry<K, V>>(map.entrySet());\n\t\tCollections.sort(list, c);\n\n\t\ttry\n\t\t{\n\t\t\treturn list.get(0).getKey();\n\t\t}\n\t\tcatch (IndexOutOfBoundsException e)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t}", "public static int min(int[] a){\r\n\t\tint m = a[0];\r\n\t\tfor( int i=1; i<a.length; i++ )\r\n if( m > a[i] ) m = a[i];\r\n\t\treturn m;\r\n\t}", "public static <V extends Comparable<? super V>> V maxValueKey(List<V> list)\n\t{\n\t\tCollections.sort(list);\n\t\treturn list.get(list.size() - 1);\n\t}", "public static <Key> int firstIndexOf(Key[] a, Key key, Comparator<Key> comparator){\n\n if(a == null || key == null || comparator == null) throw new NullPointerException(\"one or multiple arguments null\");\n if(a.length == 0) return -1;\n\n int start = 0;\n int end = a.length - 1;\n\n //binary search - if key is in mid or less, set end = mid, otherwise\n //set start = mid. this will allow end to be set to the first\n //instance of the key, and start will converge to end until\n //they're next to each other\n while(start + 1 < end){\n int mid = start + (end - start) / 2;\n if(comparator.compare(key, a[mid]) <= 0) end = mid;\n else start = mid;\n }\n\n //return index\n if(comparator.compare(key, a[start]) == 0) return start;\n if(comparator.compare(key, a[end]) == 0) return end;\n\n //return if no such key\n return -1;\n }", "public static void main(String[] args) {\n int[] arr={24,34,56,98,2,59};\r\n int val =arr [0];\r\n for(int i=0;i<arr.length;i++){\r\n \t if(arr[i]>val){\r\n \t\t val=arr[i];\r\n \t }\r\n }\r\n System.out.println(\"largest value\"+ val);\r\n\t}", "public static int maxValue(int [] array){\n int hold = array[0];\n for(int i = 1; i < array.length; i++){\n if(array[i] > hold){\n hold = array[i];\n }\n }\n return hold;\n }", "public static void sort(int[] a,int key){\n\t\tint lo = 0;\n\t\tint hi = a.length - 1;\n\t\tint j;\n\t\tkey = key - 1;\n\t\tdo{\n\t\t\tj = partition(a,lo,hi);\n\t\t\tif (key < j)\n\t\t\t\thi = j - 1;\n\t\t\telse if (key > j)\n\t\t\t\tlo = j + 1;\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Found, \" + a[j]);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}while(true);\n\t\t\n\t}", "static double getMax(double a, double b) {\n\t\treturn (a > b) ? a : b;\n\t}", "ComparableExpression<T> max();", "public static <Key> int firstIndexOf(Key[] a, Key key, Comparator<Key> comparator) {\r\n if (a == null || key == null || comparator == null)\r\n throw new NullPointerException();\r\n\r\n return binarySearch(a, key, comparator, Direction.LOWER);\r\n }", "int minKey(float key[], Boolean mstSet[]){\n float min = Float.MAX_VALUE;\n int min_index = -1;\n \n for (int v = 0; v < V; v++)\n if (mstSet[v] == false && key[v] < min) {\n min = key[v];\n min_index = v;\n }\n \n return min_index;\n }", "public static <T extends Comparable<T>> T findMax(T[] arr) {\n if (arr.length == 0 || arr == null) {\n throw new IllegalArgumentException(\"Array null or empty.\");\n }\n\n T max = arr[0];\n for (int i = 1; i < arr.length; i++) {\n max = MathUtils.max(arr[i], max);\n }\n return max;\n }", "@Override\n public int compare(Integer a, Integer b) {\n if (base.get(a) >= base.get(b)) {\n return 1;\n } else {\n return -1;\n } // returning 0 would merge keys\n }", "public static int getMax(int[] inputArray){ \n int maxValue = inputArray[0]; \n for(int i=1;i < inputArray.length;i++){ \n if(inputArray[i] > maxValue){ \n maxValue = inputArray[i]; \n } \n } \n return maxValue; \n }", "private static int maxValue(int[] a) {\n\t\tint max_value =0;\r\n\t\tint current_max=0;\r\n\t\t\r\n\t\tfor(int i=0;i<a.length;i++)\r\n\t\t{\r\n\t\t\tcurrent_max += a[i];\r\n\t\t\tmax_value= Math.max(max_value, current_max);\r\n\t\t\tif(a[i]<0)\r\n\t\t\t\tcurrent_max=0;\r\n\t\t}\r\n\t\t\r\n\t\treturn max_value;\r\n\t}", "private static void findKLargestElementBad(List<Integer> a, int k) {\n PriorityQueue<Integer> maxHeap =\n new PriorityQueue<Integer>(a.size(), new MaxHeapComperator());\n for (Integer n : a) {\n maxHeap.add(n); // O(n)\n }\n int i = k + 1;\n while (i > 0) { // O(klogn)\n System.out.print(maxHeap.remove() + \" \");\n i--;\n }\n }", "public static int findLargest(int[] data){\n\t\tint lo=0, hi=data.length-1;\n\t\tint mid = (lo+hi)/2;\n\t\tint N = data.length-1;\n\t\twhile (lo <= hi){\n\t\t\tint val = data[mid];\n\t\t\tif(mid == 0 ) return (val > data[mid+1]) ? mid : -1;\n\t\t\telse if(mid == N) return (val > data[mid-1]) ? mid : -1;\n\t\t\telse{\n\t\t\t\tint prev = data[mid-1];\n\t\t\t\tint next = data[mid+1];\n\t\t\t\tif(prev < val && val < next) lo=mid+1;\n\t\t\t\telse if(prev > val && val > next) hi = mid-1;\n\t\t\t\telse return mid; // prev > val && val > next // is the only other case\n\t\t\t\tmid = (lo+hi)/2;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "private Integer maximum(Integer dataA, Integer dataB) {\n return dataA > dataB ? dataA : dataB;\n }", "public K max(Tree<K, V> t, K key) {\n\t\treturn right.max(right, this.key);\n\t}", "public static int getIndexOfMax(double[] array){\n\n int largest = 0;\n for ( int i = 1; i < array.length; i++ )\n {\n if ( array[i] > array[largest] ) largest = i;\n }\n return largest;\n\n }", "private static Key min(Key... ks) {\n\t\tif (ks == null || ks.length == 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tKey min = ks[0];\n\t\tfor (int i = 1; i < ks.length; i++) {\n\t\t\tif (ks[i].compareTo(min) < 0) {\n\t\t\t\tmin = ks[i];\n\t\t\t}\n\t\t}\n\t\treturn min;\n\t}", "private static int findKthSmallestElementUsingQuickSelect(int[] a, int low, int high, int k) {\n\n //CHECKS\n //In your original method check if array is null or empty\n //k is from 1 to n\n\n //If k is smaller than number of elements in array\n if (k > 0 && k <= a.length) {\n\n int pi = partition(a, low, high);\n\n if (pi == k - 1) {\n return a[pi];\n }\n if (pi > k - 1) {\n return findKthSmallestElementUsingQuickSelect(a, low, pi - 1, k);\n } else {\n return findKthSmallestElementUsingQuickSelect(a, pi + 1, high, k);\n }\n }\n return Integer.MAX_VALUE;\n }", "public String getMaxKey();", "private int gallop_right(PyObject key, PyObject[] aData, int localA, int localN,\n int hint)\n {\n //assert_(n > 0 && hint >= 0 && hint < n);\n localA += hint;\n int lastofs = 0;\n int ofs = 1;\n \n if (iflt(key, aData[localA])) {\n /* key < a[hint] -- gallop left, until\n * a[hint - ofs] <= key < a[hint - lastofs]\n */\n int maxofs = hint + 1; /* data[a] is lowest */\n while (ofs < maxofs) {\n if (iflt(key, aData[localA - ofs])) {\n lastofs = ofs;\n ofs = (ofs << 1) + 1;\n if (ofs <= 0) // int overflow\n ofs = maxofs;\n } else {\n /* a[hint - ofs] <= key */\n break;\n }\n }\n if (ofs > maxofs)\n ofs = maxofs;\n /* Translate back to positive offsets relative to &a[0]. */\n int k = lastofs;\n lastofs = hint - ofs;\n ofs = hint - k;\n } else {\n /* a[hint] <= key -- gallop right, until\n * a[hint + lastofs] <= key < a[hint + ofs]\n */\n int maxofs = localN - hint; /* data[a + n - 1] is highest */\n while (ofs < maxofs) {\n if (iflt(key, aData[localA + ofs]))\n break;\n /* a[hint + ofs] <= key */\n lastofs = ofs;\n ofs = (ofs << 1) + 1;\n if (ofs <= 0) /* int overflow */\n ofs = maxofs;\n }\n if (ofs > maxofs)\n ofs = maxofs;\n /* Translate back to offsets relative to &a[0]. */\n lastofs += hint;\n ofs += hint;\n }\n localA -= hint;\n \n //assert_(-1 <= lastofs && lastofs < ofs && ofs <= n);\n \n /* Now a[lastofs] <= key < a[ofs], so key belongs somewhere to the\n * right of lastofs but no farther right than ofs. Do a binary\n * search, with invariant a[lastofs-1] <= key < a[ofs].\n */\n ++lastofs;\n while (lastofs < ofs) {\n int m = lastofs + ((ofs - lastofs) >> 1);\n if (iflt(key, aData[localA + m]))\n ofs = m; // key < data[a + m]\n else\n lastofs = m+1; // data[a + m] <= key\n }\n //assert_(lastofs == ofs); // so data[a + ofs -1] <= key < data[a+ofs]\n return ofs;\n }", "public int BinarySearch(Object[] a, int size, Object key) {\n int start = 0;\n int end = size - 1;\n while (start < end) {\n int mid = (start + size) / 2;\n if (key.equals(a[mid])) {\n return mid;\n } else if (((Comparable) key).compareTo(a[mid]) > 0) {\n start = mid + 1;\n } else {\n end = mid - 1;\n }\n }\n return -1;\n }", "public Key ceiling(Key key)\t\t\t\t//smallest key greater than or equal to the given key\n\t{\n\t\tNode x=ceiling(root,key);\n\t\tif(x!=null)\n\t\t\treturn x.key;\n\t\telse return null;\n\t}", "Object getMaximumValue(Object elementID) throws Exception;", "public int compare(Key<Double, Double> a, Key<Double, Double> b){\n\t\t\tif (a.getFirst() < b.getFirst()){\n\t\t\t\treturn -1;\n\t\t\t} else if (a.getFirst() == b.getFirst()){\n\t\t\t\treturn 0;\n\t\t\t} else {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}", "private static Pair<Double, Integer> findMaxEntry(double[] array) {\n int index = 0;\n double max = array[0];\n for (int i = 1; i < array.length; i++) {\n if ( array[i] > max ) {\n max = array[i];\n index = i;\n }\n }\n return new Pair<Double, Integer>(max, index);\n }", "@Nullable\n protected abstract Map.Entry<K, V> onGetHighestEntry();", "public int GetMaxVal();", "int getMaxValue(AVLTreeNode node) {\n if (node == null) return Integer.MAX_VALUE;\r\n\r\n // if this is the left-most node\r\n if (node.right == null) return node.key;\r\n\r\n return getMinValue(node.right);\r\n }", "public int solution(int[] a) {\n int max = 0;\n int min = Integer.MIN_VALUE;\n for (int i=0;i<a.length;i++) {\n if (i == 0) {\n min = a[i];\n } else if (a[i] > min) {\n max = Math.max(a[i] - min, max);\n } else if (a[i] < min) {\n min = a[i];\n }\n }\n return max;\n }", "public Key floor(Key key)\t\t\t\t//largest key less than or equal to the given key\n\t{\n\t\tNode x=floor(root,key);\n\t\tif(x!=null)\n\t\t\treturn x.key;\n\t\telse return null;\n\t}", "public abstract Key getSmallest();", "E maxVal();", "public long max() {\n\t\tif (!this.isEmpty()) {\n\t\t\tlong result = theElements[0];\n\t\t\tfor (int i=1; i<numElements; i++) {\n\t\t\t\tif (theElements[i] > result) {\n\t\t\t\t\tresult = theElements[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\telse {\n\t\t\tthrow new RuntimeException(\"Attempted to find max of empty array\");\n\t\t}\n\t}", "private int gallop_left(PyObject key, PyObject[] localData, int localA, int localN,\n int hint)\n {\n //assert_(n > 0 && hint >= 0 && hint < n);\n localA += hint;\n int ofs = 1;\n int lastofs = 0;\n \n if (iflt(localData[localA], key)) {\n /* a[hint] < key -- gallop right, until\n * a[hint + lastofs] < key <= a[hint + ofs]\n */\n int maxofs = localN - hint; // data[a + n - 1] is highest\n while (ofs < maxofs) {\n if (iflt(localData[localA + ofs], key)) {\n lastofs = ofs;\n ofs = (ofs << 1) + 1;\n if (ofs <= 0) // int overflow\n ofs = maxofs;\n } else {\n // key < data[a + hint + ofs]\n break;\n }\n }\n if (ofs > maxofs)\n ofs = maxofs;\n // Translate back to offsets relative to a.\n lastofs += hint;\n ofs += hint;\n } else {\n /* key <= a[hint] -- gallop left, until\n * a[hint - ofs] < key <= a[hint - lastofs]\n */\n int maxofs = hint + 1; // data[a] is lowest\n while (ofs < maxofs) {\n if (iflt(localData[localA - ofs], key))\n break;\n // key <= data[a + hint - ofs]\n lastofs = ofs;\n ofs = (ofs << 1) + 1;\n if (ofs <= 0) // int overflow\n ofs = maxofs;\n }\n if (ofs > maxofs)\n ofs = maxofs;\n // Translate back to offsets relative to a.\n int k = lastofs;\n lastofs = hint - ofs;\n ofs = hint - k;\n }\n localA -= hint;\n //assert_(-1 <= lastofs && lastofs < ofs && ofs <= n);\n /* Now a[lastofs] < key <= a[ofs], so key belongs somewhere to the\n * right of lastofs but no farther right than ofs. Do a binary\n * search, with invariant a[lastofs-1] < key <= a[ofs].\n */\n ++lastofs;\n while (lastofs < ofs) {\n int m = lastofs + ((ofs - lastofs) >> 1);\n if (iflt(localData[localA + m], key))\n lastofs = m+1; // data[a + m] < key\n else\n ofs = m; // key <= data[a + m]\n }\n //assert_(lastofs == ofs); // so data[a + ofs -1] < key <= data[a+ofs]\n return ofs;\n }", "public static int getHighestInRow(int[][] numbers, int a) {\n int highest = numbers [a][0];\n for (int i = 0; i < numbers[a].length-1; i++){\n if (numbers[a][i] > highest){\n highest = numbers [a][i];\n }\n }\n return highest;\n }", "public Key floor(final Key key) {\n int rank = rank(key);\n if (rank == 0) {\n return null;\n }\n if (rank < size && key.compareTo(keys[rank]) == 0) {\n return keys[rank];\n } else {\n return keys[rank - 1];\n }\n }", "public static <T extends Comparable<T>> int findMaxIndex(T[] arr) {\n if (arr.length == 0 || arr == null) {\n throw new IllegalArgumentException(\"Array null or empty.\");\n }\n return findMaxIndexInRange(arr, arr.length);\n }", "include<stdio.h>\nint main()\n{\n int arr_size;\n scanf(\"%d\",&arr_size);\n int arr[10];\n // Get the array elements\n for(int idx = 0; idx <= arr_size - 1; idx++)\n {\n scanf(\"%d\",&arr[idx]);\n }\n // Get the searching element 1\n int max;\n if(arr[0]>arr[1])\n {\n max=arr[0];\n }\n else\n {\n max=arr[1];\n }\n \n for(int idx = 2; idx <= arr_size - 1; idx++)\n {\n if(max< arr[idx])\n {\n max= arr[idx];\n }\n }\n printf(\"%d\\n\",max);\n return 0;\n}", "private int max(int a, int b) {\n return (a > b) ? a : b;\n }", "public int maxValue( int[ ] n ) {\n int max = Integer.MIN_VALUE;\n for(int each: n){\n if(each > max){\n max = each;\n }\n }\n return max;\n }", "public static int ArrayMax(int[] A, int n){\r\n int temp,max;\r\n // Se guarda el ultimo valor del arreglo\r\n max = A[n];\r\n \r\n if (n != 0){\r\n // Se almacena la siguiente posicion en temp\r\n temp = ArrayMax(A,n-1);\r\n // Si temp es mayopr entonces es el actual maximo\r\n if (temp > max){\r\n max = temp;\r\n }\r\n }\r\n return max;\r\n }", "public static double max(double a, double... vals) {\n\t\tdouble maxVal = a;\n\t\tfor (double v : vals) {\n\t\t\tif (v > maxVal) {\n\t\t\t\tmaxVal = v;\n\t\t\t}\n\t\t}\n\t\treturn maxVal;\n\t}", "private int findNearestValue(final int i, final double key) {\n\n\t\tint low = 0;\n\t\tint high = m_NumValues[i];\n\t\tint middle = 0;\n\t\twhile (low < high) {\n\t\t\tmiddle = (low + high) / 2;\n\t\t\tdouble current = m_seenNumbers[i][middle];\n\t\t\tif (current == key) {\n\t\t\t\treturn middle;\n\t\t\t}\n\t\t\tif (current > key) {\n\t\t\t\thigh = middle;\n\t\t\t} else if (current < key) {\n\t\t\t\tlow = middle + 1;\n\t\t\t}\n\t\t}\n\t\treturn low;\n\t}", "private static List<Integer> findKLargestElement(List<Integer> a, int k) {\n PriorityQueue<Integer> minHeap = new PriorityQueue<Integer>(k);\n int i = 0;\n while (i <= k) {\n minHeap.add(a.get(i)); // O(k)\n i++;\n }\n\n // Not insert rest of the n-k elements .. slowly..\n // We are trying to store all k greatest numbers in heap..\n // with min heap telling us which is the smallest among the k largest.\n for (i = k; i < a.size(); i++) {\n if (a.get(i) > minHeap.peek()) {\n minHeap.remove();\n minHeap.add(a.get(i));\n }\n }\n return Arrays.asList(minHeap.toArray(new Integer[k]));\n }", "public static Location locateLargest(double[][] a){\n Location answer = new Location(a);\n return answer;\n }", "@Override\n\tpublic int compareTo(Key o) {\n\t\tint temp = 0;\n\t\t\t\t\n\t\tif (this.value > o.value) \t\ttemp = 1;\n\t\telse if (this.value < o.value) temp = -1;\n\t\telse \t\t\t\t\t\t\ttemp = 0;\n\t\t\n\t\treturn temp;\n\t}", "public int hashWorst(String key){\n int hashVal = 1;\n return hashVal;\n }", "private static int binarySearch0_BranchFreeUnrolledStatic16(int[] a, int key) {\n\t\tint low = 8;\n\t\tint midVal;\n\t\tint highMask;\n\n\t\tmidVal = a[low];\n\t\tlow += 4;\n\t\thighMask = (int) (((long) key - midVal) >> 63);\n\t\tlow -= 8 & highMask;\n\n\t\tmidVal = a[low];\n\t\tlow += 2;\n\t\thighMask = (int) (((long) key - midVal) >> 63);\n\t\tlow -= 4 & highMask;\n\n\t\tmidVal = a[low];\n\t\tlow += 1;\n\t\thighMask = (int) (((long) key - midVal) >> 63);\n\t\tlow -= 2 & highMask;\n\n\t\tmidVal = a[low];\n\t\thighMask = (int) (((long) key - midVal) >> 63);\n\t\tlow -= 1 & highMask;\n\n\t\treturn a[low] == key ? low : -(low + 1);\n\n\t}", "public int maxKeyValue() {\n\t\tIterator<Integer> it = this.data.keySet().iterator();\n\t\tint ret = 0;\n\t\twhile (it.hasNext()) {\n\t\t\tret = Math.max(ret, it.next());\n\t\t}\n\t\treturn ret;\n\t}", "int findKthSmallest(int[] a, int[] b, int aLength, int bLength, int k) {\n\tif(aLength > bLength)\n\t\treturn findKthSmallest(b,a,bLength,aLength,k);\n\t//Base cases.\n\tif(aLength ==0 && bLength >0)\n\t\treturn b[k-1];\n\tif (k ==1)\n\t\treturn Math.min(a[0],b[0]);\n\t\n\tint i = Math.min(k/2,aLength); // k is always less than length of array.\n\tint j= Math.min(k/2,bLength);\n\t\n\tif(a[i-1] >b[j-1])// slice b, find the k-jth element.\n\t\treturn findKthSmallest(a, Arrays.copyOfRange(b,j,b.length),aLength,bLength-j,k-j);\n\telse \n\t\treturn findKthSmallest(Arrays.copyOfRange(a,i,a.length),b,aLength-i,b,k-i);\n}", "protected int findIndexL(K key) {\n\t\tfor (int i = keyCount - 1; i >= 0; i--) {\n\t\t\tif (keys[i].compareTo(key) < 0)\n\t\t\t\treturn i;\n\t\t}\n\t\treturn -1;\n\t}", "@Test\n public void test_kmax_Integer_Collection1() {\n populate_i1();\n int actual = Selector.kmax(i1, 1, new CompareIntegerAscending());\n int expected = 8;\n Assert.assertEquals(\"1st maximum not found\", expected, actual);\n }", "public static int binSearch(int[] a, int first, int last, int key)\n\t{\t\n\t\tif(first <= last)\n\t\t{\n\t\t\tint mid = (first + last) / 2; //Divides the beginning of the array and the length of the array into 2\n\t\t\t\n\t\t\tif (a[mid] == key)\n\t\t\t{\n\t\t\t\treturn mid; \n\t\t\t}\n\t\t\t\n\t\t\telse if (a[mid] > key) //IF THE INDEX(WHICH IS THE MID) OF ARRAY A IS GREATER THAN THE KEY\n\t\t\t{\n\t\t\t\treturn last = mid - 1; //RETURNS THE LENGTH OF THE ARRAY WHICH IS THE DECREMENTED MID\n\t\t\t}\n\t\t\t\n\t\t\telse //IF THE INDEX(WHICH IS THE MID) OF ARRAY A IS LESS THAN THE KEY\n\t\t\t{\n\t\t\t\treturn first = mid + 1; //RETURNS THE FIRST = INCREMENTED MID\t\t\n\t\t\t}\n\t\t}\n\t\treturn -1;\t\n\t}", "public static void main(String[] args) {\nint arr[]=new int[] {10,20,36,50,30};\nint max=0,i;\nfor(i=0;i<arr.length;i++)\n{\n\tif(arr[i]>max)\n\t{\n\t\tmax=arr[i];\n\t}\n}\nSystem.out.println(max);\n\t}", "private PriorityQueue<Integer> get(Node x, int key) {\n while (x != null) {\n int cmp = key - x.key;\n if (cmp < 0)\n x = x.left;\n else if (cmp > 0)\n x = x.right;\n else\n return x.val;\n }\n return null;\n }", "public static float max(float a, float... vals) {\n\t\tfloat maxVal = a;\n\t\tfor (float v : vals) {\n\t\t\tif (v > maxVal) {\n\t\t\t\tmaxVal = v;\n\t\t\t}\n\t\t}\n\t\treturn maxVal;\n\t}", "public Value get(final Key key) {\n int r = rank(key);\n if (r < size && (keys[r].compareTo(key) == 0)) {\n return values[r];\n }\n return null;\n }", "static int maxMin(int k, int[] arr) {\n Arrays.sort(arr);\n return IntStream.range(0, arr.length - k + 1).map(i -> arr[i + k - 1] - arr[i]).min().getAsInt();\n }", "public static int max(int a, int... vals) {\n\t\tint maxVal = a;\n\t\tfor (int v : vals) {\n\t\t\tif (v > maxVal) {\n\t\t\t\tmaxVal = v;\n\t\t\t}\n\t\t}\n\t\treturn maxVal;\n\t}", "public static double max(double[] v) {\n double max = v[0];\n for (int ktr = 0; ktr < v.length; ktr++) {\n if (v[ktr] > max) {\n max = v[ktr];\n }\n }\n return max;\n}" ]
[ "0.6608963", "0.65940356", "0.6420717", "0.63737774", "0.6363791", "0.6322431", "0.630686", "0.6267443", "0.62583274", "0.62422633", "0.59481645", "0.5928498", "0.59196496", "0.58926445", "0.5822528", "0.5791181", "0.5787743", "0.5724375", "0.57197833", "0.56746024", "0.5671582", "0.560829", "0.5475602", "0.5473724", "0.54715323", "0.5452047", "0.5443981", "0.54361236", "0.53863055", "0.53813946", "0.5297768", "0.52947", "0.5284077", "0.5254258", "0.52539057", "0.52394056", "0.52381784", "0.5234046", "0.5204808", "0.5133096", "0.51211756", "0.5114201", "0.5113492", "0.510701", "0.50854695", "0.5081575", "0.5069393", "0.5066528", "0.50526845", "0.50397617", "0.503495", "0.50281936", "0.501822", "0.50148934", "0.5008421", "0.49973857", "0.49905112", "0.49902344", "0.4976969", "0.49736702", "0.49730816", "0.49709114", "0.49683687", "0.49622843", "0.49622244", "0.49485925", "0.49383855", "0.49381128", "0.49339485", "0.4922349", "0.49219862", "0.49087974", "0.49058834", "0.490315", "0.49009", "0.4895917", "0.48856112", "0.48771214", "0.48769355", "0.48760659", "0.487197", "0.48712543", "0.48702288", "0.4868209", "0.48582193", "0.48548967", "0.48529285", "0.4851926", "0.48472542", "0.48426878", "0.48409128", "0.48388788", "0.48352048", "0.48265418", "0.4824267", "0.4810718", "0.48045674", "0.48021156", "0.47994632", "0.479565", "0.47892478" ]
0.0
-1
Gets the chat header.
public short getHeader() { if (this == CHAT) { return Outgoing.ChatMessageComposer; } else if (this == SHOUT) { return Outgoing.ShoutMessageComposer; } else if (this == WHISPER) { return Outgoing.WhisperMessageComposer; } return -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getHeader();", "public String getHeader()\r\n\t{\r\n\t\treturn header;\r\n\t}", "public String getHeader() {\n\t\treturn _header;\n\t}", "public String getHeader() {\n return header;\n }", "public String getHeader() {\n return header;\n }", "public std_msgs.msg.dds.Header getHeader()\n {\n return header_;\n }", "java.lang.String getHeader();", "public String getHeader() {\n\t\t\treturn header;\n\t\t}", "public String getHeader() {\n\t\treturn header.toString();\n\t}", "public String getMessageHeaderAsString(){\n String header;\n switch(messageType){\n case DELETE:\n header = messageType + \" \" + version + \" \" + senderId + \" \" + fileId + \" \" + Utils.CRLF + Utils.CRLF;\n break;\n case PUTCHUNK:\n header = messageType + \" \" + version + \" \" + senderId + \" \" + fileId + \" \" + chunkNo + \" \" + replicationDegree + \" \" + Utils.CRLF + Utils.CRLF;\n break;\n case ENH_AWOKE:\n header = messageType + \" \" + version + \" \" + senderId + Utils.CRLF + Utils.CRLF;\n break;\n case ENH_DELETED:\n header = messageType + \" \" + fileId + \" \" + senderId + Utils.CRLF + Utils.CRLF;\n break;\n case GETCHUNK:\n if(version.equals(Utils.ENHANCEMENT_RESTORE) || version.equals(Utils.ENHANCEMENT_ALL))\n header = messageType + \" \" + version + \" \" + senderId + \" \" + fileId + \" \" + chunkNo + \" \" + sender_access + \" \"+ Utils.CRLF + Utils.CRLF;\n else header = messageType + \" \" + version + \" \" + senderId + \" \" + fileId + \" \" + chunkNo + \" \" + Utils.CRLF + Utils.CRLF;\n break;\n default:\n header = messageType + \" \" + version + \" \" + senderId + \" \" + fileId + \" \" + chunkNo + \" \" + Utils.CRLF + Utils.CRLF;\n }\n return header;\n }", "public String getHeader() {\n String header = FxSharedUtils.getHeader();\n if (header.indexOf(\"$user$\") > 0)\n header = header.replaceAll(\"\\\\$user\\\\$\", getRequest().getUserTicket().getUserName());\n return header;\n }", "public Object getHeader() {\n return header;\n }", "public String getHeaderLine() {\r\n\t\tif(header == null)return \"\";\r\n\t\treturn header;\r\n\t}", "com.didiyun.base.v1.Header getHeader();", "public Header getHeader() {\n\t\treturn this.header;\n\t}", "public String getHeaderName() {\n\tString value = getString(ATTR_HEADER_NAME, null);\n\treturn value;\n }", "public String getHeader() {\n\t\tString header = \"id\" + \",\" + \"chrId\" + \",\" + \"strand\" + \",\" + \"TSS\" + \",\" + \"PolyASite\"\n\t\t\t\t\t\t+ \",\" + \"5SSPos\" + \",\" + \"3SSPos\" + \",\" + \"intronLength\" + \",\" + \"terminalExonLength\"\n\t\t\t\t\t\t+ \",\" + \"BPS_3SS_distance\" + \",\" + \"PolyPyGCContent\" + \",\" + \"IntronGCContent\" + \",\" + \"terminalExonGCContent\"\n\t\t\t\t\t\t+ \",\" + \"5SS\" + \",\" + \"3SS\" + \",\" + \"BPS\"\n\t\t\t\t\t\t+ \",\" + \"5SSRank\" + \",\" + \"3SSRank\" + \",\" + \"BPSRank\"\n\t\t\t\t\t\t+ \",\" + \"5SSLevenshteinDistance\" + \",\" + \"3SSLevenshteinDistance\" + \",\" + \"BPSLevenshteinDistance\";\n\t\treturn header; \n\t}", "public String getHeader() {\n\t\tif (null != this.header) {\n\t\t\treturn this.header;\n\t\t}\n\t\tValueExpression _ve = getValueExpression(\"header\");\n\t\tif (_ve != null) {\n\t\t\treturn (String) _ve.getValue(getFacesContext().getELContext());\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "public byte[] getHeader() {\n\treturn header;\n }", "public String getPlayerListHeader ( ) {\n\t\treturn extract ( handle -> handle.getPlayerListHeader ( ) );\n\t}", "public NetFlowHeader getHeader() throws IOException {\n if (header == null) {\n header = prepareHeader();\n }\n\n return header;\n }", "ComponentHeaderType getHeader();", "public String getHeaderText(){\n\t\treturn headerText.toString();\n\t}", "public PHeader getHeader() {\n\t\treturn header;\n\t}", "@Override\n\tpublic Map<String, String> getHeader() {\n\t\treturn this.header;\n\t}", "public ChildMessage getHeader(){return header;}", "public java.lang.String getHeaderName() {\r\n return headerName;\r\n }", "protected ResponseHeader getHeader() {\n return this.header;\n }", "public HashMap<String, String> getHeader() {\n HashMap<String, String> header = new HashMap<String, String>();\n//\t\theader.put(\"Content-Type\", pref.getString(\"application/json\", \"application/json\"));\n /*header.put(\"authId\", pref.getString(KEY_USER_ID, KEY_USER_ID));\n header.put(\"authToken\", pref.getString(KEY_AUTH_TOKEN, KEY_AUTH_TOKEN));*/\n\n\n header.put(\"authId\", pref.getString(KEY_USER_ID, \"1\"));\n header.put(\"authToken\", pref.getString(KEY_AUTH_TOKEN, \"s4nbp5FibJpfEY9q\"));\n\n return header;\n }", "public VCFHeader getHeader();", "public String getHeader(final Header header) {\n return headers.get(header.toString());\n }", "public java.lang.String getSenderHeaderName()\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(SENDERHEADERNAME$24, 0);\n if (target == null)\n {\n return null;\n }\n return target.getStringValue();\n }\n }", "@Override\n public RaftNode getHeader() {\n return allNodes.getHeader();\n }", "public DnsHeader header() {\n return header;\n }", "String getHeader(String headerName);", "public String getHttpHeader() {\n return httpHeader;\n }", "public Class<?> header() {\n return header;\n }", "public String getbyHeader(){\n String byHed=driver.findElement(byHeader).getText();\n return byHed;\n }", "public String getHeader() {\n\t\tString item_text = getQuantityString(getCount());\n\t\tString header = getActivity().getString(R.string.browse_items_text, item_text, getCount());\n\t\treturn header;\n\t}", "com.didiyun.base.v1.HeaderOrBuilder getHeaderOrBuilder();", "public String headerLine() {\n return headerLine;\n }", "public static String getHeader() {\n return \"S I R\";\n }", "public String getHeader(String name, String delimiter) throws MessagingException {\n/* 382 */ if (this.headers == null)\n/* 383 */ loadHeaders(); \n/* 384 */ return this.headers.getHeader(name, delimiter);\n/* */ }", "TupleHeader getHeader() {\n return header;\n }", "public java.lang.String getHeaderName () {\n\t\treturn headerName;\n\t}", "public String getCustomHeader() {\n return this.customHeader;\n }", "public String getHeaderValue() {\n\treturn getString(ATTR_HEADER_VALUE, null);\n }", "public org.apache.xmlbeans.XmlString xgetSenderHeaderName()\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(SENDERHEADERNAME$24, 0);\n return target;\n }\n }", "@Override\n public StreamHeader getHeader() throws Exception {\n return header;\n }", "protected String getPageHeader()\n {\n if (this.pageHeader == null) {\n String title = (this.privateLabel != null)? this.privateLabel.getPageTitle() : \"\";\n StringBuffer sb = new StringBuffer();\n sb.append(\"<center>\");\n sb.append(\"<span style='font-size:14pt;'><b>\" + title + \"</b></span>\");\n sb.append(\"<hr>\");\n sb.append(\"</center>\");\n this.pageHeader = sb.toString();\n }\n return this.pageHeader;\n }", "org.apache.xmlbeans.XmlString xgetHeader();", "String getResponseHeader();", "@JsonIgnore\n public String getMessageHeaders() {\n try {\n ObjectMapper mapper = new ObjectMapper();\n ObjectNode root = mapper.createObjectNode();\n root.set(\"topic\", mapper.convertValue(getTopic(), JsonNode.class));\n return mapper.writer().writeValueAsString(root);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return \"\";\n }", "private String receiveHeaders (SelectionKey clientKey)\r\n {\r\n // Local Variable Declaration \r\n int bytesRead = 0; byte[] trimedHeader;\r\n String rawHeaders = null; SocketChannel clientSC; \r\n \r\n try \r\n {\r\n // Get the socket channel from the key passed \r\n clientSC = (SocketChannel)clientKey.channel();\r\n\r\n // Clear the buffer before each read\r\n headerBuff.clear();\r\n\r\n // Read the header in from the socket channel\r\n bytesRead = clientSC.read(headerBuff);\r\n\r\n // Initialize the header byte array to the amount of bytes read\r\n trimedHeader = new byte[bytesRead];\r\n\r\n // Trim off any white space \r\n System.arraycopy(headerBuff.array(), 0, trimedHeader, 0, bytesRead);\r\n\r\n // Convert bytes to String for parsing \r\n rawHeaders = new String(trimedHeader, Charset.forName(\"UTF-8\"));\r\n\r\n // Trim trailing whitespace \r\n rawHeaders = rawHeaders.trim();\r\n }\r\n catch(IOException ioe)\r\n {\r\n ioe.printStackTrace();\r\n }\r\n finally\r\n {\r\n return rawHeaders;\r\n }\r\n }", "public String getHeader1() {\n return header1;\n }", "public Chat getChatFrame() {\r\n return chatFrame;\r\n }", "public String[] composeHeader() {\n\t\treturn null;\n\t}", "public abstract String header();", "public String[] getHeader(String name) throws MessagingException {\n/* 363 */ if (this.headers == null)\n/* 364 */ loadHeaders(); \n/* 365 */ return this.headers.getHeader(name);\n/* */ }", "private String readHeader(RoutingContext ctx) {\n String tok = ctx.request().getHeader(XOkapiHeaders.TOKEN);\n if (tok != null && ! tok.isEmpty()) {\n return tok;\n }\n return null;\n }", "public String getGloHeaderStr() {\n return gloHeaderStr;\n }", "private HeaderMsg getBasicHeader(ClusterIdCheck ignoreClusterId, EpochCheck ignoreEpoch) {\n return getHeaderMsg(requestCounter.incrementAndGet(), PriorityLevel.NORMAL, 1L,\n getUuidMsg(DEFAULT_UUID), getUuidMsg(DEFAULT_UUID), ignoreClusterId, ignoreEpoch);\n }", "public RTCMHeader getRtcmHeader()\n {\n\treturn this.rtcmHeader;\n }", "public final Herochat getHerochat()\n\t{\n\t\treturn herochat;\n\t}", "public Number getHeaderId() {\n return (Number)getAttributeInternal(HEADERID);\n }", "public Number getHeaderId() {\n return (Number)getAttributeInternal(HEADERID);\n }", "public SecureMessageHeader getSecureMessageHeader() {\r\n\t\treturn this.secureMessageHeader;\r\n\t}", "public List<byte[]> getHeader() {\n\t\treturn this.fileHeader;\n\t}", "public String getResponseHeader(String key)\n\t{\n\t\treturn this.responseHeader.getOrDefault(key, \"\");\n\t}", "public ElementHeader getElementHeader()\n {\n return elementHeader;\n }", "public SAMFileHeader getFileHeader() {\n return dest.getFileHeader();\n }", "public Optional<String> header(String header) {\n return this.header.getHeader(header);\n }", "public String getRequestHeader(String key)\n\t{\n\t\treturn this.requestHeader.getOrDefault(key, \"\");\n\t}", "private org.gwtbootstrap3.client.ui.PanelHeader get_f_PanelHeader17() {\n return build_f_PanelHeader17();\n }", "public SSLHeadingWidgetComponent getHeading()\r\n\t{\r\n\t\treturn getHeading( getSession().getSessionContext() );\r\n\t}", "@Override\n\t\tpublic String getHeader(String name) {\n\t\t\treturn null;\n\t\t}", "public Header readFrame() throws IOException {\n //if (framesize == -1) {\n header.read_header(this);\n //}\n return header;\n }", "public String getHeader(final String name) {\n return headers.get(name);\n }", "public String get_nat46fragheader() throws Exception {\n\t\treturn this.nat46fragheader;\n\t}", "public WebElement headerDiv() {\r\n return driver.findElement(By.id(\"header\"));\r\n }", "private HorizontalLayout getHeader() {\n HorizontalLayout header = new HorizontalLayout();\n header.setWidth(\"100%\");\n header.setHeight(\"100px\");\n // TODO move this into a separate HeaderView class\n header.addComponent(new Label(\"Patient Management System Team Green\"));\n return header;\n }", "public String getAuthorizationHeader() {\n\t\tString auth = getUsername() + \":\" + getPassword();\n\t\tthis.debugAuthentcation();\n\t\tString header = \"Basic \"\n\t\t\t\t+ DatatypeConverter.printBase64Binary(auth.getBytes());\n\t\treturn header;\n\t}", "public boolean getHeader() {\n return isHeader;\n }", "public char first_message_offset_GET()\n { return (char)((char) get_bytes(data, 5, 1)); }", "public char first_message_offset_GET()\n { return (char)((char) get_bytes(data, 5, 1)); }", "Headers getHeaders();", "private org.gwtbootstrap3.client.ui.PanelHeader get_f_PanelHeader49() {\n return build_f_PanelHeader49();\n }", "public byte[] getBuffer() {\r\n return this.header;\r\n }", "private org.gwtbootstrap3.client.ui.PanelHeader get_f_PanelHeader29() {\n return build_f_PanelHeader29();\n }", "public String ChatName() {\n return \"\";\n }", "private org.gwtbootstrap3.client.ui.PanelHeader get_f_PanelHeader76() {\n return build_f_PanelHeader76();\n }", "private org.gwtbootstrap3.client.ui.PanelHeader get_f_PanelHeader39() {\n return build_f_PanelHeader39();\n }", "public byte getHeaderByte() {\n\t\treturn headerByte;\n\t}", "public String getHeaderNames(){return header.namesText;}", "public String getCallHeader(DatabasePlatform platform) {\r\n return platform.getFunctionCallHeader();\r\n }", "public Map<String, List<String>> getHeaders(){\n if (this.mResponseHeaders == null){\n this.mResponseHeaders = mConnection.getHeaderFields();\n }\n return this.mResponseHeaders;\n }", "public Header getHeaderByKey(String key);", "public String getFileHeaderInfo() {\n return this.fileHeaderInfo;\n }", "public String getHeader(final String name) {\n final Collection<String> strings = headers.get(name);\n return strings == null ? null : strings.iterator().next();\n }", "public String getDisplayName() {\n return chatRoom.getName();\n }" ]
[ "0.7115885", "0.70838654", "0.7049345", "0.7040697", "0.7040697", "0.70145345", "0.6954617", "0.69480217", "0.6923193", "0.6919025", "0.6828769", "0.67565197", "0.67357767", "0.6687672", "0.6680874", "0.6645429", "0.664131", "0.6628807", "0.6586816", "0.65365875", "0.6525148", "0.6493901", "0.6462623", "0.64247024", "0.6406243", "0.63866496", "0.6343196", "0.6297212", "0.6265034", "0.62493825", "0.6203896", "0.620197", "0.61905634", "0.6190532", "0.6180416", "0.6169041", "0.6159676", "0.6152383", "0.6147799", "0.6144198", "0.61161643", "0.61001074", "0.60828936", "0.6067038", "0.60617226", "0.6023932", "0.6014375", "0.6007011", "0.59957266", "0.5987072", "0.5977846", "0.59703416", "0.5948835", "0.5923431", "0.5906557", "0.5896864", "0.58889717", "0.588164", "0.58777136", "0.5853873", "0.58450514", "0.58357054", "0.58199644", "0.58189505", "0.5818777", "0.5818777", "0.5817007", "0.58134615", "0.5781263", "0.577746", "0.5771554", "0.5771544", "0.5767862", "0.57647216", "0.57293475", "0.5721618", "0.5720458", "0.5719528", "0.57109416", "0.5707475", "0.569991", "0.5699031", "0.56977", "0.5696123", "0.5696123", "0.56857604", "0.5685332", "0.5667082", "0.5663848", "0.56622386", "0.5661755", "0.5654732", "0.56257", "0.5622621", "0.5617167", "0.56164795", "0.56057566", "0.5603849", "0.55993724", "0.5595314" ]
0.681994
11
an identifier for an item Basic empty constructor
public AddItemViewParameters() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Item(){}", "public Item() {}", "public Item(){}", "public ItemInfo () {}", "@SuppressWarnings(\"unused\")\n public Item() {\n }", "public Item() {\n\t}", "public Item() {\n\t}", "public Item() {\n }", "public Item() {\n }", "public Item() \r\n\t{\r\n\t\tname = \"AbstractItem\";\r\n\t\tdescription = \"Example Item Generated\";\r\n\t\tprice = 0;\r\n\t}", "public Item()\n {\n super();\n }", "public Item_Record() {\n super(Item_.ITEM_);\n }", "public Item()\r\n {\r\n // Initialize instance variables\r\n \r\n }", "public DessertItem() {\n this(\"\");\n }", "private Object makeObj(final String item, final int ID) {\n return new Object() {\n\n @Override\n public String toString() {\n return item;\n }\n\n @Override\n public int hashCode() {\n return ID;\n }\n };\n }", "public Item() {\r\n this.name = \"\";\r\n this.description = \"\";\r\n this.price = 0F;\r\n this.type = \"\";\r\n this.available = 0;\r\n this.wholesaler = new Wholesaler();\r\n this.wholesalerId = 0;\r\n this.category = new Category();\r\n this.categoryId = 0; \r\n }", "public ItemRecord() {\n super(Item.ITEM);\n }", "public Item()\r\n\t{\r\n\t\tserialNum = 00000;\r\n\t\tweight = 0.0;\r\n\t}", "public Item(String itemName, String itemDescription){\n this.itemName = itemName;\n this.itemDescription = itemDescription;\n}", "public ModuleObjectAttributeItem() {}", "public Item(String input) {\n name = input;\n }", "ItemType(String itemCode) {\n code = itemCode;\n }", "protected Item() {\n }", "Item(){\r\n\t\tthis(0, new Weight(5), new DukatAmount(0));\r\n\t}", "public InventoryItem(String name) { \n\t\tthis(name, 1);\n\t}", "public Item(String id, int index) {\n this.id = id;\n this.itemIndex = index;\n this.dataBank = new DataBank();\n this.usersRatings = new SortedRatingList();\n }", "public NewItems() {\n super();\n }", "Item(int i, String n, String c, double p) {\n this.id = i;\n this.name = n;\n this.category = c;\n this.price = p;\n }", "@Test\r\n\tpublic void testIdItem() {\r\n\r\n\t\ttry {\r\n\t\t\tItem itemDes = new Item(idItem, \"elixir de Destreza\", 0, 0, 0, 0, 0, 0, null, null);\r\n\r\n\t\t\tAssert.assertEquals(12321, itemDes.getIdItem());\r\n\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}\t\t\r\n\r\n\t}", "public FinalMysteryItem() {\n int randomIndex = new Random().nextInt(7);\n item = new Item(listOfPossibleNames[randomIndex], PRICE_TO_BUY);\n }", "public ShoppingListItem() {}", "public BasketItemBuilder() {\n generateRandomId();\n }", "public Item(Integer itemSlot) {\n this.itemSlot = itemSlot;\n }", "@Test\n public void constructorInitializesAllItemsInUnknownState() {\n FirstAidItem firstAidItem = Tests.buildFirstAidItem(Point.pt(2.5, 3.5));\n WeaponItem weaponItem = Tests.buildWeaponItem(Point.pt(1.5, 0.5), Weapon.WeaponType.HANDGUN);\n\n Bot bot = Tests.mockBot();\n ItemMemory itemMemory = new ItemMemory(bot, asList(firstAidItem, weaponItem));\n\n assertThat(itemMemory.get(firstAidItem).getState(), is(ItemMemoryRecord.State.UNKNOWN));\n assertThat(itemMemory.get(weaponItem).getState(), is(ItemMemoryRecord.State.UNKNOWN));\n }", "public OrderItem() {}", "public Item(int weigth, String name, String description) {\n this.weigth = weigth;\n this.name = name;\n this.description = description;\n }", "Item(long ID, DukatAmount price){\r\n\t\tthis(ID, new Weight(5), price);\r\n\t}", "public Item(String name, ItemType type)\n {\n\tthis.name = name;\n\tthis.type = type;\n }", "public String getItemId(){\r\n\t\treturn \"\";\r\n\t}", "public Item(String initName, String itemDesc)\n {\n // initialise instance variables\n name = initName;\n desc = itemDesc;\n }", "public InventoryItem(){\r\n this.itemName = \"TBD\";\r\n this.sku = 0;\r\n this.price = 0.0;\r\n this.quantity = 0;\r\n nItems++;\r\n }", "id() {}", "public Item(int id, String name, int quantity, double price, Supplier supplier){\r\n toolId = id;\r\n toolName = name;\r\n toolQuantity = quantity;\r\n toolPrice = price;\r\n toolSupplier = supplier;\r\n }", "private UniqueIdentifier(){\n\t\t\n\t}", "public Bid() {}", "public EntityID() {\n }", "public PurchaseOrderItem () {\n\t\tsuper();\n\t}", "public Item()\r\n {\r\n gen = new Random();\r\n color = new Color(gen.nextInt());\r\n x = 200;\r\n w = 100;\r\n h = 18;\r\n }", "public LaPatilla()\n\t{\n\t\tsuper(TAG_ITEM_ITEMS,\n\t\t\t\tnew int[]{TAG_TITLE},\n\t\t\t\tnew int[]{TAG_LINK},\n\t\t\t\tnew int[]{TAG_DESCRIPTION},\n\t\t\t\tnew int[]{TAG_CONTENT_ENCODED},\n\t\t\t\tnew int[]{TAG_PUBDATE},\n\t\t\t\tnew int[]{TAG_CATEGORY},\n\t\t\t\tnew int[]{},\n\t\t\t\t\"\");\n\t}", "public EnterpriseBeansItem() {\n super();\n }", "AdapterItems(int ID, String product)\n {\n this.ID=ID;\n this.product=product;\n //this. Description=Description;\n }", "public Item(){\n description = \"No description avaible for this item\";\n weight = 0;\n }", "public Item(final int t, final int i, final int c) {\n\t\ttype = t;\n\t\tid = i;\n\t\tcount = c;\n\t\t//type = ItemType.BLOCK;\n\t}", "public Item(String itemName, String itemList, String itemNote, int itemNumStocks, String itemExpireDate, int itemID) {\n this.itemName = itemName;\n this.itemList = itemList;\n this.itemNote = itemNote;\n this.itemNumStocks = itemNumStocks;\n this.itemExpireDate = itemExpireDate;\n this.itemID = itemID;\n }", "public Item(String name, int id, int width, int height) {\r\n this.name = name;\r\n this.id = id;\r\n count = 1;\r\n \r\n bounds = new Rectangle(xpos, ypos, width, heigth);\r\n }", "@Override\n public int getId() {\n return 0;\n }", "private Item initItem() {\n String name = inputName.getText().toString();\n int quantityToBuy = -1;\n if (!inputQuantityToBuy.getText().toString().equals(\"\"))\n quantityToBuy = Integer.parseInt(inputQuantityToBuy.getText().toString());\n String units = inputUnits.getText().toString();\n double price = 0;\n if (!inputPrice.getText().toString().equals(\"\"))\n price = Double.parseDouble(inputPrice.getText().toString());\n int calories = 0;\n if (!inputCalories.getText().toString().equals(\"\"))\n calories = Integer.parseInt(inputCalories.getText().toString());\n ArrayList<String> allergies = allergyActions.getAllergies();\n return new Item(name, 0, units, quantityToBuy, 0, allergies, calories, price);\n }", "public ItemCommand() {\n }", "@Override\n\tpublic int getId() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic int getId() {\n\t\treturn 0;\n\t}", "Items(){\n}", "public BaseInventory (long id) {\r\n\t\tsuper(id);\r\n\t}", "public KeyedItem(int key,\n T item)\n {\n this(new Integer(key), item);\n }", "public Item() {\n\t\tmenu.add(new Item(\"Snickers\", 10, 1.50, \"1\"));\n\t\tmenu.add(new Item(\"Chips\", 10, .50, \"2\"));\n\t\tmenu.add(new Item(\"Coke\", 10, 1.75, \"3\"));\n\n\t}", "public Item createItem() {\n if(pickUpImplementation == null)\n {\n pickUpImplementation = new DefaultPickUp();\n }\n\n if(lookImplementation == null)\n {\n lookImplementation = new DefaultLook(R.string.default_look);\n }\n\n if(defaultItemInteraction == null)\n {\n throw new IllegalArgumentException(\"No default interaction specified!\");\n }\n\n\n return new Item(\n id,\n name,\n pickUpImplementation,\n lookImplementation,\n useImplementation,\n defaultItemInteraction\n );\n }", "public OrderItem_() {\n }", "public Item(String id, String description) {\r\n\t\tthis.id = id;\r\n\t\tthis.description = description;\r\n\t\r\n\t}", "@Test\n public void constructorId() {\n final String ID = \"ID\";\n final CourseType courseType = new CourseType(ID);\n\n assertSame(ID, courseType.getId());\n assertNull(courseType.getName());\n assertNull(courseType.getPicture());\n assertNull(courseType.getPosition());\n assertNull(courseType.getStatus());\n assertNull(courseType.getCourses());\n assertNull(courseType.getAllowedDishes());\n }", "ItemType(String code) {\n this.code = code;\n }", "ItemType(String code) {\n this.code = code;\n }", "@Override\n public ID createItem(@NotNull String uid) {\n final long startNs = myStats != null ? System.nanoTime() : 0;\n final ID result = createItemImpl(uid);\n if (myStats != null) {\n myStats.incrementCounter(StatsCounters.itemsCreationDurationNs, System.nanoTime() - startNs);\n }\n return result;\n }", "public ObjectID() {\n UUID u = UUID.randomUUID();\n data = storeData(u, IDVersion.SIMPLE);\n }", "public Rol(Integer id)\r\n/* */ {\r\n/* 82 */ this.id = id;\r\n/* */ }", "public Item(String id, String name, String desc) {\n this.id = id;\n this.name = name;\n this.desc = desc;\n }", "public ListItem(int id, String d, Timestamp time) {\n\t\tthis.id = id;\n\t\tdescription = d;\n\t\ttimestamp = time;\n\t}", "private Uniqueid() {\n\n }", "public WinningItem(int id){\n this.id = id;\n Manager.register(this);\n }", "public NBT_Tag(String name) {\nthis.id = 0; //overwritten\nthis.name = name;\n}", "public final ItemId getId() {\r\n return null;\r\n }", "protected abstract void makeItem();", "public Card(int x) {\n\t\tid = x;\n\t}", "Item(Weight weight){\r\n\t\tthis(0, weight, new DukatAmount(0));\r\n\t}", "IEquipableItem createDefault();", "public SimItem (String name, int color,long simID) {\n \tmName = name;\n \tmColor = color;\n \tmIsSim = false;\n \tmSimID = simID;\n }", "public Item(String name, int quantity, double price, String id) {\n\t\tthis.name = name;\n\t\tthis.quantity = quantity;\n\t\tthis.price = price;\n\t\tthis.id = id;\n\n\t}", "public SearchResultItem(AbstractIdentifier identifierA) {\n\t\tthis(identifierA, null);\n\t}", "private Asset() {\r\n super(IAsset.TYPE_ID);\r\n }", "id(int id) {}", "public QuestionPoolItemData(){\n }", "public RecentItem() {\n }", "public Items(String image, int y, int x) {\r\n\t\tsuper(image, y, x);\r\n\t}", "private TaskItem()\n {\n }", "public DiscoveryItem(String key) {\n this(key, null, 0, 0, null);\n }", "public Item(String itemName, double itemPrice, int numPurchased)\n {\n \tname = itemName;\n \tprice = itemPrice;\n \tquantity = numPurchased;\n }", "public OverlayListItem() {\n this.id = -1;\n }", "public CustomerCartItem(Long itemId, int quantity) {\n this.id = itemId;\n this.quantity = quantity;\n }", "Items(double cost){\n\tthis.cost=cost;\n\titemId++;\n\tcurrentID=itemId;\n}", "public ActiveSurveyQuestionItem() {\n }", "public TreeItem(String label ) {\r\n\t\tthis( label, null );\r\n\t}", "public JobID() {\n super();\n }", "@Override\n\t\tpublic long getId() {\n\t\t\treturn 0;\n\t\t}" ]
[ "0.7398773", "0.7398223", "0.7369483", "0.73280704", "0.722633", "0.7079901", "0.7079901", "0.6977137", "0.6977137", "0.69473135", "0.6934519", "0.68360144", "0.68259406", "0.6806602", "0.6781799", "0.6759984", "0.67568034", "0.67567855", "0.6684638", "0.6682281", "0.6654571", "0.66474015", "0.66087097", "0.6592055", "0.6588428", "0.650844", "0.6504489", "0.65034395", "0.64915395", "0.6478516", "0.6455068", "0.64322615", "0.6423249", "0.642064", "0.642046", "0.6395296", "0.63646424", "0.6356482", "0.63509005", "0.63440657", "0.6340003", "0.6323003", "0.6321877", "0.63032883", "0.6295761", "0.62848216", "0.6278863", "0.6273237", "0.62632984", "0.626052", "0.62571573", "0.6238506", "0.6191655", "0.61896074", "0.6184957", "0.6182392", "0.6180002", "0.6179484", "0.61591464", "0.61591464", "0.6157844", "0.6155622", "0.6155393", "0.61448616", "0.6143994", "0.61330014", "0.6126007", "0.612278", "0.6121112", "0.6121112", "0.61169314", "0.6114953", "0.6110197", "0.61071396", "0.61063266", "0.60945886", "0.60929805", "0.6078617", "0.60745674", "0.6061318", "0.6050633", "0.6049723", "0.6041775", "0.604001", "0.60362715", "0.60350144", "0.60124594", "0.5996587", "0.5992244", "0.59880096", "0.5985241", "0.5976821", "0.59720623", "0.5970114", "0.5963198", "0.59569836", "0.5950544", "0.59496343", "0.59490716", "0.594632", "0.5946074" ]
0.0
-1
Constructor for a ViewParameters object for Adding Items
public AddItemViewParameters(String viewID, Long id) { this.id = id; this.viewID = viewID; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public AddItemViewParameters() {\n\t}", "public NewItems() {\n super();\n }", "ParametersView(){\r\n\t\ttable.setWidget(0, 0,new Label(OpenXDataFacade.getOpenXDataConstants().label_name()));\r\n\t\ttable.setWidget(0, 1,new Label(OpenXDataFacade.getOpenXDataConstants().label_value()));\r\n\t\ttable.setWidget(0, 2,new Label(OpenXDataFacade.getOpenXDataConstants().label_action()));\r\n\r\n\t\tFlexCellFormatter cellFormatter = table.getFlexCellFormatter();\r\n\t\tcellFormatter.setWidth(0, 2, \"10%\");\r\n\t\ttable.setStyleName(\"cw-FlexTable\");\r\n\r\n\t\tpanel.add(table);\r\n\t\tpanel.add(btnAdd);\r\n\r\n\t\tbtnAdd.addClickHandler(this);\r\n\t\tbtnAdd.setEnabled(false);\r\n\t\t\r\n\t\tinitWidget(panel);\r\n\t}", "public PctItemMasterListParams()\n {\n super();\n }", "protected ParameterList(){\n //title = t;\n //cellWorld = cw;\n }", "public ViewHolder(View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n super(itemView);\n\n tvTitle = itemView.findViewById(R.id.tvTitle);\n tvBody = itemView.findViewById(R.id.tvDescription);\n tvDueDate = itemView.findViewById(R.id.tvDueDate);\n content = itemView.findViewById(R.id.cardViewToDo);\n details = itemView.findViewById(R.id.rlToDoDetails);\n ivDropDown = itemView.findViewById(R.id.ivDropDown);\n }", "public AddItem() {\n initComponents();\n }", "public ViewHolder(View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n super(itemView);\n\n nameTextView = (TextView) itemView.findViewById(R.id.user_name);\n startTextView = (TextView) itemView.findViewById(R.id.start_date);\n }", "public AddItems() {\n initComponents();\n \n }", "public ViewHolder(View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n super(itemView);\n\n nameTextView = (TextView) itemView.findViewById(R.id.torrent_name);\n movieImageView = (ImageView) itemView.findViewById(R.id.movie_image);\n }", "public CustomEntitiesTaskParameters() {}", "public ListParameter()\r\n\t{\r\n\t}", "public ViewHolder(View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n super(itemView);\n\n EmpirePortrait= (ImageView) itemView.findViewById(R.id.EmpirePortrait);\n nameTextView = (TextView) itemView.findViewById(R.id.EmpireName);\n deleteButton = (ImageButton) itemView.findViewById(R.id.EmpireDelete);\n FlagView = (ImageView) itemView.findViewById(R.id.EmpireFlag);\n ViewButton = (Button) itemView.findViewById(R.id.viewButton);\n }", "public ViewObject(ActivityInstance instance)\n {\n // Populate fields\n this.templateId = instance.getTemplate().getId();\n this.name = instance.getName();\n this.description = instance.getDescription();\n this.paramValues = instance.getParameterValues();\n }", "ViewHolder(View itemView) {\n super(itemView);\n\n //Finding the Views needed\n mEditTextAttrName = itemView.findViewById(R.id.edittext_item_product_config_attr_name);\n mEditTextAttrValue = itemView.findViewById(R.id.edittext_item_product_config_attr_value);\n mImageButtonRemoveAction = itemView.findViewById(R.id.imgbtn_item_product_config_attr_remove);\n\n //Registering Focus Change Listeners on TextInput Fields to capture the updated value\n mEditTextAttrName.setOnFocusChangeListener(this);\n mEditTextAttrValue.setOnFocusChangeListener(this);\n\n //Setting Click Listener on ImageButton\n mImageButtonRemoveAction.setOnClickListener(this);\n }", "static List<SubstantiveParametersParameterItem> createSubstantiveParametersParameterItem(List<String> collectionOfItems) {\n List<SubstantiveParametersParameterItem> substantiveParametersParameterItemList = new ArrayList<>();\n for (String item: collectionOfItems) {\n substantiveParametersParameterItemList.add(new SubstantiveParametersParameterItem(item));\n }\n return substantiveParametersParameterItemList;\n }", "public DDSViewCollectionForm() {\n\t}", "CollectionParameter createCollectionParameter();", "public ViewHolder(View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n super(itemView);\n\n /* designation_txt = (TextView) itemView.findViewById(R.id.designation_txt);\n name_txt = (TextView) itemView.findViewById(R.id.name_txt);\n number_txt = (TextView) itemView.findViewById(R.id.number_txt);*/\n\n }", "public ViewHolder(View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n super(itemView);\n }", "ExerciseAdapter(List<Programme.MyItems> items)\n {\n this.myItems = items;\n }", "public ViewHolder(View itemView) {\n super(itemView);\n\n listName = (TextView) itemView.findViewById(R.id.listName);\n remainingItems = (TextView) itemView.findViewById(R.id.remainingItems);\n listButtonLayout = (LinearLayout) itemView.findViewById(R.id.listButtonLayout);\n btnView = (Button) listButtonLayout.findViewById(R.id.btnEditList);\n btnDeleteList = (Button) listButtonLayout.findViewById(R.id.btnDeleteList);\n\n\n }", "public Parameters() {\n\t}", "public JParameterRecord(Long itemId, String key, String value) {\n super(JParameter.PARAMETER);\n\n set(0, itemId);\n set(1, key);\n set(2, value);\n }", "private Parameter(int key, String name, String value){\n this.key = key;\n this.name = name;\n this.value = value;\n }", "public void addToList(View view) {\n Items newItem = new Items();\n EditText ETNew = (EditText) findViewById(R.id.ETNew);\n newItem.todo = ETNew.getText().toString();\n newItem.done = false;\n helper.create(newItem);\n Toast.makeText(this, \"Item added\", Toast.LENGTH_SHORT).show();\n adaptList2();\n ETNew.setText(\"\");\n ETNew.setHint(\"my new to-do\");\n }", "public Item(String itemName, String itemDescription){\n this.itemName = itemName;\n this.itemDescription = itemDescription;\n}", "public ViewHolder(@NonNull View itemView) {\n super(itemView);\n txvNombreMascotaDesparasitante = itemView.findViewById(R.id.txvNombreMascotaDesparasitante);\n txvNombreDesparasitante = itemView.findViewById(R.id.txvNombreDesparasitante);\n txvPesoDesparasitante = itemView.findViewById(R.id.txvPesoDesparasitante);\n txvFechaAplicacionDesparasitante = itemView.findViewById(R.id.txvFechaAplicacionDesparasitante);\n \n }", "public SurveyAdapter(List<Object> items) {\n this.items = items;\n }", "public PartsViewImpl() {\n }", "public abstract void addParameter(String key, Object value);", "public AddendumValidationViewImpl() {\n }", "public AddOperationView() {\n super(\"add_operation.fxml\", \"Einsatz hinzufügen\");\n }", "public ModifyItem() {\n initComponents();\n }", "public View(Controller controller) {\n this.controller = controller;\n jCheckBoxArrayList = new ArrayList<>();\n }", "public void createItem(View view) {\n \t\n String[] temp = getCurrentItemTypes();\n \n Intent intent = new Intent(this, CreateItem.class);\n intent.putExtra(EDIT, \"no\");\n intent.putExtra(TYPES, temp);\n startActivityForResult(intent, 1);\n }", "public DepictionParameters() {\n this(200, 150, true, DEFAULT_BACKGROUND);\n }", "public NewsParamPanel() {\n initComponents();\n titleAnalyzer.setFieldName(\"TITLE\");\n dateAnalyzer.setFieldName(\"DATE\");\n sourceExtractor.setFieldName(\"SOURCENAME\");\n authorExtractor.setFieldName(\"AUTHOR\");\n commentsExtractor.setFieldName(\"COMMENT_COUNT\");\n clicksExtractor.setFieldName(\"CLICK_COUNT\");\n transmitExtractor.setFieldName(\"TRANSMIT_COUNT\");\n summaryExtractor.setFieldName(\"SUMMARY\");\n chnlExtractor.setFieldName(\"CHANNEL\");\n contentExtractor.setFieldName(\"CONTENT\");\n }", "public BaseParameters(){\r\n\t}", "public TaskViewHolder(View itemView) {\n super(itemView);\n\n taskDescriptionView = itemView.findViewById(R.id.taskDescription);\n updatedAtView = itemView.findViewById(R.id.taskUpdatedAt);\n priorityView = itemView.findViewById(R.id.priorityTextView);\n itemView.setOnClickListener(this);\n }", "public ViewHolder(View itemView) {\n super(itemView);\n tvNature = (TextView)itemView.findViewById(R.id.item_name);\n tvAmountNature = (TextView)itemView.findViewById(R.id.item_amount);\n }", "public ViewHolder(View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n super(itemView);\n\n breweryImage = (ImageView) itemView.findViewById(R.id.brewery_image);\n breweryName = (TextView) itemView.findViewById(R.id.brewery_name);\n }", "public MyViewHolder(View itemView) {\n super(itemView);\n\n // get the reference of item view's\n exercise = itemView.findViewById(R.id.exercise);\n }", "public ListItems() {\n itemList = new ArrayList();\n }", "public ViewHolder(View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n super(itemView);\n int position = getAdapterPosition();\n\n\n nameTextView = (TextView) itemView.findViewById(R.id.contact_name);\n messageButton = (Button) itemView.findViewById(R.id.message_button);\n messageButton.setOnClickListener(new ButtonClick(this));\n itemView.setOnClickListener(this);\n\n }", "@Override\n protected Map<String, String> getParams() {\n Map<String, String> params = new HashMap<String, String>();\n params.put(\"tag\", \"ViewList\");\n params.put(\"created_by\", created_by);\n params.put(\"created_for\",created_for);\n\n\n return params;\n }", "public CustomItemInOrderView(long customItemID, String type, float price, String color, String greetingCard,\n\t\t\tArrayList<Product> components) \n\t{\n\t\tsuper(customItemID, type, price, color, greetingCard, components);\n\t\tviewBtn = new Button(\"view\");\n\t\tviewBtn.setUserData(viewBtn);\n\t\tviewBtn.setOnAction(viewCustomProductAction);\n\t\t\n\t\tnameArea = new TextArea();\n\t\tnameArea.setText(\"Custom\");\n\t\tnameArea.setWrapText(true);\n\t\tnameArea.setPrefHeight(64);\n\t\tnameArea.setEditable(false);\n\t\tthis.greetingCard = new TextArea();\n\t\tthis.greetingCard.setWrapText(true);\n\t\tthis.greetingCard.setPrefHeight(64);\n\t\tthis.greetingCard.setText(greetingCard);\n\t\tthis.greetingCard.setEditable(false);\n\t}", "public AddParameterAction(Signature parentSignature) {\r\n this.parentSignature = parentSignature;\r\n this.editingDomain = TransactionUtil.getEditingDomain(parentSignature);\r\n }", "public ViewHolder(View itemView) {\n tvGrupo = (TextView) itemView.findViewById(R.id.tvGrupo);\n tvNCD = (TextView) itemView.findViewById(R.id.tvNCD);\n tvACD = (TextView) itemView.findViewById(R.id.tvACD);\n ivCD = (ImageView) itemView.findViewById(R.id.ivCD);\n }", "public ViewDetallesPagos () {\r\n\r\n }", "public ItemHolder(@NonNull View itemView) {\n super(itemView);\n /*tvNombre=itemView.findViewById(R.id.tvNombre);\n tvCiudad=itemView.findViewById(R.id.etCiudad);\n btBorrar=itemView.findViewById(R.id.btBorrar);\n btEditar=itemView.findViewById(R.id.btEditar);\n cl = itemView.findViewById(R.id.cl);\n ivImagen = itemView.findViewById(R.id.ivImagen);*/\n }", "private View setupView(View v)\n {\n\n TextView item_name = (TextView)v.findViewById(R.id.item_name);\n TextView item_price = (TextView)v.findViewById(R.id.item_price);\n TextView item_description = (TextView)v.findViewById(R.id.item_description);\n\n add = (Button) v.findViewById(R.id.fabCart);\n add.setOnClickListener(this);\n mlike = (ImageView) v.findViewById(R.id.btnLike);\n mlike.setOnClickListener(this);\n\n if(mDescription != null) {\n item_name.setText(mDescription[Data.UzaData.NAME.ordinal()] + \" | \" + mDescription[Data.UzaData.SELLER.ordinal()]);\n item_price.setText(mDescription[Data.UzaData.PRICE.ordinal()]);\n item_description.setText(mDescription[Data.UzaData.DESCRIPTION.ordinal()]);\n }\n\n initPager(v);\n\n //TODO \"Show more pictures\" button\n //TODO \"Message\" button\n\n return v;\n }", "public Builder addParameters(\n int index, com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter value) {\n if (parametersBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureParametersIsMutable();\n parameters_.add(index, value);\n onChanged();\n } else {\n parametersBuilder_.addMessage(index, value);\n }\n return this;\n }", "public void addItem(View view) {\n mainActivityPresenter.startEventEditActivity( this);\n }", "public ItemListFragment() {\n }", "AdapterItems(int ID, String product)\n {\n this.ID=ID;\n this.product=product;\n //this. Description=Description;\n }", "public ViewHolder(View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n super(itemView);\n imageView1 = itemView.findViewById(R.id.item_health_center_first_photo);\n imageView2 = itemView.findViewById(R.id.item_health_center_second_photo);\n imageView3 = itemView.findViewById(R.id.item_health_center_third_photo);\n imageView4 = itemView.findViewById(R.id.item_health_center_forth_photo);\n }", "public Map<String, AccessPoint> createParameters() {\r\n\t\tMap<String, AccessPoint> pm = new TreeMap<String, AccessPoint>();\r\n\t\tpm.put(\"vcNumber\", new MutableFieldAccessPoint(\"vcNumber\", this));\r\n\t\treturn pm;\r\n\t}", "public JsfVenda() {\r\n litem = new ArrayList();\r\n }", "public ServiceItemFragmentNew() {\n }", "public BaseViewHolder(@NotNull View view) {\n super(view);\n Intrinsics.checkParameterIsNotNull(view, \"itemView\");\n }", "public Viewholder(@NonNull View itemView)\n {\n super(itemView);\n btnReadMore = itemView.findViewById(R.id.btn_read_more);\n sqView = itemView.findViewById(R.id.sqView);\n title = itemView.findViewById(R.id.textTitle);\n body = itemView.findViewById(R.id.textBody);\n }", "public Builder addParameters(\n int index, com.google.cloud.dialogflow.cx.v3beta1.Intent.Parameter value) {\n if (parametersBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureParametersIsMutable();\n parameters_.add(index, value);\n onChanged();\n } else {\n parametersBuilder_.addMessage(index, value);\n }\n return this;\n }", "public STDataController(Context context) {\n personNames = new ArrayList<String>();\n personIds = new ArrayList<String>();\n personPhotos = new ArrayList<Bitmap>();\n personSelections = new ArrayList<HashSet<Integer>>();\n \n menuItemNames = new ArrayList<String>();\n menuItemPrices = new ArrayList<Double>();\n \n this.context = context;\n }", "public NewItemDlg(Bundle args) {\n this.setArguments(args);}", "public HttpPost() {\n super();\n parameters = new HashMap<>();\n }", "public TaskViewHolder(View itemView) {\n super(itemView);\n\n taskDescriptionView = (TextView) itemView.findViewById(R.id.taskDescription);\n\n }", "public void addParameter(ParmInfoEntry p){\n\t}", "public ViewProperty() {\n initComponents();\n }", "public View() {\n // (this constructor is here just for the javadoc tag)\n }", "public ItemInfo () {}", "public ItemsAdapter() {\n\n\n }", "public ModuleObjectAttributeItem() {}", "public ItemFragment() {\n }", "public EntrepriseHolder(@NonNull View itemView) {\n super(itemView);\n nom = itemView.findViewById(R.id.afficheNom);\n adresse = itemView.findViewById(R.id.afficheAdresse);\n ville = itemView.findViewById(R.id.afficheVille);\n nature = itemView.findViewById(R.id.afficheNature);\n }", "public PlaylistViewHolder(View itemView) {\n super(itemView);\n\n this.imageView1 = itemView.findViewById(R.id.imageView1);\n this.imageView2 = itemView.findViewById(R.id.imageView2);\n this.imageView3 = itemView.findViewById(R.id.imageView3);\n this.imageView4 = itemView.findViewById(R.id.imageView4);\n this.imageView5 = itemView.findViewById(R.id.imageView5);\n this.imageView6 = itemView.findViewById(R.id.imageView6);\n\n this.imageViews = new ImageView[] {imageView1, imageView2, imageView3, imageView4, imageView5, imageView6};\n\n this.playlistTitleTextView = itemView.findViewById(R.id.playlistTitleTextView);\n this.playlistDescriptionTextView = itemView.findViewById(R.id.playlistDescriptionTextView);\n }", "public ParamJson() {\n\t\n\t}", "public CollectionFragment() {\n }", "public OrderItem_ViewHolder(@NonNull View itemView) {\n super(itemView);\n itemsDate = itemView.findViewById(R.id.oh_date);\n itemsAddress = itemView.findViewById(R.id.address_id);\n itemsTotal = itemView.findViewById(R.id.total_id);\n NoItems = itemView.findViewById(R.id.NoItems_id);\n order_item = itemView.findViewById(R.id.orderTab);\n }", "public FoodHolder(@NonNull View itemView) {\n super(itemView);\n name = itemView.findViewById(R.id.textview_food_name);\n sugars = itemView.findViewById(R.id.textview_food_grams_sugar);\n foodType = itemView.findViewById(R.id.textview_food_foodtype);\n viewBackground = itemView.findViewById(R.id.layout_single_food_background);\n viewForeground = itemView.findViewById(R.id.layout_single_food_foreground);\n }", "ViewHolder(View itemView) {\n super(itemView);\n // Initialize the views.\n titleTemaText = itemView.findViewById(R.id.titleDetail);\n userTemaText = itemView.findViewById(R.id.userDetail);\n cuerpoTemaText = itemView.findViewById(R.id.cuerpoTema);\n userRespuestaText = itemView.findViewById(R.id.usuarioRespuesta);\n cuerpoRespuestaText = itemView.findViewById(R.id.cuerpoRespuesta);\n ctgBackground = itemView.findViewById(R.id.ctgBackground);\n fondoRespuesta = itemView.findViewById(R.id.fondoRespuesta);\n }", "public RecentItem() {\n }", "public MetaParameter() {\n m_aParams = new ArrayList();\n }", "public void initForAddNew() {\r\n\r\n\t}", "public ModuleParams()\n\t{\n\t}", "Items(){\n}", "public ViewHolder(Context context, View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n super(itemView);\n this.context = context;\n profilePicture = itemView.findViewById(R.id.person_picture);\n nameTextView = itemView.findViewById(R.id.person_name);\n itemView.setOnClickListener(this);\n }", "public EnterpriseBeansItem() {\n super();\n }", "public ToDoPane(Agenda agenda){\n super();\n this.agenda = agenda;\n add = true;\n setup = new HashMap<>();\n comboBox = new JComboBox();\n this.numberOfLists = agenda.getConnector().getNumberOfItems(agenda.getUsername(),\"list\");\n this.loadLists();\n }", "public SqlContainerCreateUpdateParameters() {\n }", "public MyHolder(View itemView) {\n super(itemView);\n item = itemView.findViewById(R.id.item);\n noofpices = itemView.findViewById(R.id.noofpices);\n cost = itemView.findViewById(R.id.cost);\n amount = itemView.findViewById(R.id.total);\n plus = itemView.findViewById(R.id.plus);\n// minus = (ImageButton)itemView.findViewById(R.id.minus);\n delete = itemView.findViewById(R.id.del);\n\n // id= (TextView)itemView.findViewById(R.id.id);\n }", "public ShoppingListItem() {}", "public a(RdsInputItemPresenterImpl rdsInputItemPresenterImpl, RdsInputItemView rdsInputItemView, ParameterElement.Input input) {\n super(1);\n this.a = rdsInputItemPresenterImpl;\n this.b = rdsInputItemView;\n this.c = input;\n }", "public Model(ItemContainer i) {//takes from the container\n\t\tinventory.addAll(i.getFilms());\n\t\tinventory.addAll(i.getTvseries());\n\t}", "public ViewHolder(@NonNull View view, Context ctx) {\n super(view);\n context = ctx;\n\n taskName = view.findViewById(R.id.item_name);\n taskDescription = itemView.findViewById(R.id.item_description);\n taskPriority = itemView.findViewById(R.id.item_priority);\n dateAdded = itemView.findViewById(R.id.item_date);\n\n editButton = itemView.findViewById(R.id.editButton);\n deleteButton = itemView.findViewById(R.id.deleteButton);\n\n editButton.setOnClickListener(this);\n deleteButton.setOnClickListener(this);\n\n }", "@Override\r\n\tpublic void createVisualizationParameters(\r\n\t\t\tParamCollection visualizationParameters) {\r\n\t\tvisualizationParameters.setName(\"Vector Field\");\r\n\t\tvisualizationParameters.add(sliceParam = new ParamInteger(\"Slice\", 1,\r\n\t\t\t\tslices, slice + 1));\r\n\t\tsliceParam.setInputView(new ParamIntegerSliderInputView(sliceParam, 4));\r\n\t\tvisualizationParameters.add(sampleRateParam = new ParamInteger(\r\n\t\t\t\t\"Sample Rate\", 1, 50, sampleRate));\r\n\t\tsampleRateParam.setInputView(new ParamIntegerSliderInputView(\r\n\t\t\t\tsampleRateParam, 4));\r\n\t\tvisualizationParameters.add(transparencyParam = new ParamFloat(\r\n\t\t\t\t\"Transparency\", -1, 1, transparency));\r\n\t\ttransparencyParam.setInputView(new ParamDoubleSliderInputView(\r\n\t\t\t\ttransparencyParam, 4, false));\r\n\t\tvisualizationParameters.add(arrowColorParam = new ParamColor(\r\n\t\t\t\t\"Arrow Color\", arrowColor));\r\n\t\tvisualizationParameters.add(arrowWidthParam = new ParamFloat(\r\n\t\t\t\t\"Arrow Width\", 0, 1, arrowWidth));\r\n\t\tarrowWidthParam.setInputView(new ParamDoubleSliderInputView(\r\n\t\t\t\tarrowWidthParam, 4, false));\r\n\t\tvisualizationParameters.add(arrowHeadWidthParam = new ParamFloat(\r\n\t\t\t\t\"Arrow Head Width\", 0, 1, arrowHeadWidth));\r\n\t\tarrowHeadWidthParam.setInputView(new ParamDoubleSliderInputView(\r\n\t\t\t\tarrowHeadWidthParam, 4, false));\r\n\r\n\t\tvisualizationParameters.add(arrowHeadHeightParam = new ParamFloat(\r\n\t\t\t\t\"Arrow Head Height\", 0, 1, arrowHeadHeight));\r\n\t\tarrowHeadHeightParam.setInputView(new ParamDoubleSliderInputView(\r\n\t\t\t\tarrowHeadHeightParam, 4, false));\r\n\t\tvisualizationParameters.add(visibleParam = new ParamBoolean(\"Visible\",\r\n\t\t\t\tvisible));\r\n\t}", "public DessertItem() {\n this(\"\");\n }", "CollectionItem createCollectionItem();", "public ResultJsonView() {\r\n }", "private Item(){}" ]
[ "0.8200053", "0.61370003", "0.6058557", "0.6018438", "0.5869737", "0.5806606", "0.57680976", "0.57251453", "0.5656233", "0.5649702", "0.56271535", "0.56251514", "0.56050956", "0.5601799", "0.56007284", "0.5581302", "0.5566501", "0.55626357", "0.5542474", "0.5514264", "0.5497238", "0.5460828", "0.54397476", "0.5409253", "0.54017603", "0.53915215", "0.538747", "0.5378824", "0.5355151", "0.53528535", "0.53363293", "0.5318534", "0.53158313", "0.53073895", "0.53022903", "0.5301007", "0.52986056", "0.5290301", "0.5288803", "0.5287242", "0.5278928", "0.52650124", "0.5260916", "0.5253978", "0.5249059", "0.52419853", "0.5238745", "0.5232602", "0.5232147", "0.52238536", "0.52160203", "0.521492", "0.5210685", "0.52092", "0.520569", "0.52007395", "0.51965034", "0.51897305", "0.51823187", "0.5177829", "0.5171517", "0.51683277", "0.5167703", "0.5163974", "0.5158525", "0.51580536", "0.51532066", "0.5147519", "0.51426613", "0.51407015", "0.51326704", "0.51289093", "0.51281446", "0.51240164", "0.51217353", "0.5119543", "0.5115669", "0.5111037", "0.51048785", "0.509492", "0.5094667", "0.5093077", "0.5091112", "0.5090301", "0.50884295", "0.50861937", "0.50805193", "0.5073914", "0.5072582", "0.50709283", "0.5070306", "0.5067671", "0.50627965", "0.5062512", "0.50591415", "0.5054935", "0.50547", "0.50527096", "0.5052124", "0.5045611" ]
0.6857638
1
Created by Vitalii on 21.08.18.
public interface CustomerRepository extends MongoRepository<Customer, String> { Customer findByFirstName(String firstName); List<Customer> findByLastName(String lastName); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "private stendhal() {\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "private void poetries() {\n\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n public void init() {\n\n }", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n public void memoria() {\n \n }", "@Override\n\tpublic void einkaufen() {\n\t}", "public void mo38117a() {\n }", "private void strin() {\n\n\t}", "@Override\n protected void getExras() {\n }", "@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 protected void initialize() {\n\n \n }", "public final void mo51373a() {\n }", "public void mo4359a() {\n }", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "private void init() {\n\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "private void kk12() {\n\n\t}", "Petunia() {\r\n\t\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n public void init() {\n }", "private Rekenhulp()\n\t{\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\n void init() {\n }", "@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}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\n protected void initialize() \n {\n \n }", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\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 jugar() {\n\t\t\n\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "public void mo6081a() {\n }", "@Override\n public int describeContents() { return 0; }", "@Override\n\tprotected void initialize() {\n\n\t}", "public void Tyre() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "public void mo55254a() {\n }", "@Override\n\tpublic void init()\n\t{\n\n\t}", "void berechneFlaeche() {\n\t}", "@Override\n public void init() {}", "protected boolean func_70814_o() { return true; }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tpublic void verkaufen() {\n\t}", "@Override\n protected void init() {\n }", "@Override\r\n\tpublic void init() {}", "private void init() {\n\n\n\n }", "private void m50366E() {\n }" ]
[ "0.6105517", "0.59973997", "0.5951058", "0.59289193", "0.5850682", "0.58443516", "0.58443516", "0.5834063", "0.58309954", "0.5805833", "0.578384", "0.5779991", "0.5772055", "0.5761399", "0.57536405", "0.5752797", "0.5749305", "0.5664639", "0.5640975", "0.56241804", "0.5621397", "0.55864275", "0.5560596", "0.5554811", "0.55491173", "0.5548358", "0.5542881", "0.5540961", "0.5537028", "0.5532287", "0.55281377", "0.55281377", "0.55281377", "0.55281377", "0.55281377", "0.55271065", "0.55206716", "0.55182403", "0.550521", "0.549723", "0.54853576", "0.54853576", "0.54680765", "0.5462517", "0.5450183", "0.5437292", "0.5435714", "0.5433185", "0.5433185", "0.5433185", "0.5433185", "0.5433185", "0.5433185", "0.5433185", "0.542609", "0.5421519", "0.5418701", "0.5418701", "0.54154414", "0.5407604", "0.5406602", "0.5399661", "0.5399036", "0.5399036", "0.5399036", "0.5396603", "0.5396603", "0.5396603", "0.5395833", "0.53875947", "0.53869736", "0.53869736", "0.5379876", "0.5375454", "0.53733957", "0.53659236", "0.53659236", "0.53659236", "0.5357709", "0.5346702", "0.5346702", "0.5346702", "0.5346702", "0.5346702", "0.5346702", "0.5337928", "0.533529", "0.53324795", "0.53319705", "0.53276235", "0.5327547", "0.53244436", "0.5323025", "0.5316319", "0.5314105", "0.53100896", "0.5302604", "0.5296762", "0.5292858", "0.5290668", "0.52817065" ]
0.0
-1
This function takes a positive integer, n, and returns the corresponding Fibonacci number, fib(N), where fib(0) = 0, fib(1) = 1, and fib(N) = fib(N1) + fib(N2) for all N > 1. for example: if n = 1 the result will be 1, and if n = 3 the result will be 2 because 2 = 1 + 1, and if n = 5 the result will be 5 because 5 = 3 + 2
public static int fib(int n) { if (n == 0) { return 0; } else if (n == 1) { return 1; } else { return fib(n-1) + fib(n-2); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int fib(int n) {\n int retVal = 0;\n if (n == 1) {\n retVal = 1;\n } else if (n == 2) {\n retVal = 1;\n } else {\n \n int nextfib = fib(n-2) + fib(n-1);\n retVal = nextfib;\n }\n \n return retVal;\n }", "public static int fib(int n) {\n\t\tif (n <= 1) {\n\t\t\treturn n;\n\t\t} else {\n\t\t\treturn fib(n - 1) + fib(n - 2);\n\t\t}\n\t}", "public static int getFibonacciNumber(int n) {\r\n\t\tif (n < 2)\r\n\t\t\treturn n;\r\n\t\treturn getFibonacciNumber(n - 1) + getFibonacciNumber(n - 2);\r\n\t}", "public static int fib(int n) {\n\t\tif (n <= 1)\n\t\t\treturn n;\n\t\treturn fib(n - 1) + fib(n - 2);\n\t}", "public static int fibonacci(int n) {\n\t\tif(n == 0) \n\t\t\treturn 0;\n\t\tif(n == 1) \n\t\t\treturn 1;\n\t\t\n\t\treturn fibonacci(n - 1) + fibonacci(n - 2);\n\t}", "public int fib(int n) {\n if (n < 2) {\n return n;\n }\n\n int n1 = 1;\n int n2 = 0;\n\n for (int i = 2; i < n; i++) {\n int current = n1 + n2;\n n2 = n1;\n n1 = current;\n }\n return n1 + n2;\n }", "public static int fibonacci(int n) {\n\n\t\tif (n == 0 || n == 1) {\n\t\t\treturn n;\n\t\t}\n\n\t\tint fnm1 = fibonacci(n - 1);\n\t\tint fnm2 = fibonacci(n - 2);\n\n\t\tint fn = fnm1 + fnm2;\n\n\t\treturn fn;\n\n\t}", "public static int fibonacci(int n){\n if (n==0 || n==1)\n return n;\n else {\n return fibonacci(n-1)+fibonacci(n-2);\n }\n }", "private static int fibonacci(int n) {\n if (n == 1 || n == 2)\n return 1;\n else\n return fibonacci(n - 1) + fibonacci(n - 2);\n }", "public long fibonacci(int n){\n global_count++;\n if(n<=1){\n return n;\n }else {\n return fibonacci(n-1) + fibonacci(n-2);\n }\n }", "public static long getFibonacciNumberAt(int n) {\n\n try {\n\n if (n < 1) {\n\n throw new IllegalArgumentException(\"no fibonacci numbers at n < 1\");\n\n } else if (n == 1 || n == 2) {\n\n return 1;\n\n }\n\n } catch (IllegalArgumentException iae) {\n\n System.out.println(iae.getMessage());\n\n }\n\n return getFibonacciNumberAt(n - 1) + getFibonacciNumberAt(n - 2);\n\n }", "public static int recursiveFibonacci(int n) {\n\t\t// calculate nth fibonacci number recursively\n\t\treturn n == 0 ? 0 : n == 1 ? 1 : recursiveFibonacci(n-1) + recursiveFibonacci(n-2);\n\t}", "public int fibNum(int n) {\n\n //base case\n if ((n == 0) || (n == 1)) {\n logger.info(\"Fibonacci number successfully computed\");\n return n;\n } else if (n > 1) { //recursive case\n logger.info(\"Fibonacci number successfully computed\");\n return fibNum(n - 1) + fibNum(n - 2);\n } else {\n throw new IllegalArgumentException(\"Invalid argument, input is less than 0\");\n }\n }", "private long fibonacci(long n) {\n if (n <= 1) {\n return n;\n } else {\n return fibonacci(n - 1) + fibonacci(n - 2);\n }\n }", "public static long fibonacci(int n) {\r\n if (n <= 1){\r\n return n;\r\n }\r\n else return fibonacci(n-1) + fibonacci(n-2);\r\n }", "public static int dynamicFibonacci(int n) {\n\t\t// calculate each fibonacci number as the sum of the previous two\n\t\treturn n == 0 ? 0 : Stream.iterate(new int[]{0, 1}, i -> new int[]{i[1], i[0]+i[1]}).limit(n).reduce((a, b) -> b).orElse(null)[1];\n\t}", "public int calculaFibonacci(int n) {\n\t\t//condição de parada, vai sair quando n for 1\n\t\tif (n < 2) {\n\t\t\treturn n;\n\t\t}\n\t\t// retorno chamando a própria função\n\t\treturn calculaFibonacci(n - 1) + calculaFibonacci(n - 2); \n\t}", "public static BigInteger fibonacci(int n) {\n\t\t// Use best algorithm to compute\t\t\n\t\treturn ABFind.fibonacciLoop(n);\n\t}", "int fibonacciNumberFinder(int n){\n if (n <= 1){\n return n;\n }\n return fibonacciNumberFinder(n - 1) + fibonacciNumberFinder(n - 2);\n }", "private static int getFibonacci(int n) {\n\t\tdouble f1 = Math.pow(((1 + Math.sqrt(5)) / 2.0), n);\n\t\tdouble f2 = Math.pow(((1 - Math.sqrt(5)) / 2.0), n);\n\t\treturn (int)(Math.floor((f1 - f2) / Math.sqrt(5)));\n\t}", "public static int fibonacci(int n) throws Exception\n {\n if (n < 0)\n {\n throw new Exception(\n \"Fibonacci Series for \" + n + \" not possible for negative numbers\" );\n }\n\n if (n == 0 || n == 1)\n {\n return n;\n }\n else\n {\n return fibonacci(n - 1) + fibonacci(n - 2);\n }\n }", "public int fibo1(int n){\r\n if(n == 1 || n == 2){\r\n return 1;\r\n }\r\n return fibo1(n-1)+fibo1(n-2);\r\n }", "public static int fibonacciRecursion(int n) {\r\n if (n == 0) {\r\n return 0;\r\n }\r\n if (n == 1 || n == 2) {\r\n return 1;\r\n }\r\n return fibonacciRecursion(n - 2) + fibonacciRecursion(n - 1);\r\n }", "public static int fibonacci(int n) {\n if (n == 1){\n map.put(1,0);\n }\n if (n == 2)\n map.put(2,1);\n if (map.containsKey(n))\n return map.get(n);\n map.put(n,fibonacci(n-1)+fibonacci(n-2));\n return map.get(n);\n\n }", "public int fibo2(int n){\r\n int[] f = new int[n];\r\n f[0] = 1;\r\n f[1] = 1;\r\n for(int i=2; i<n; i++){\r\n f[i] = f[i-1] + f[i-2];\r\n }\r\n return f[n-1];\r\n }", "public static int fibonacciBUSE(int n) {\n\n\t\tint[] strg = new int[2];\n\t\tstrg[0] = 0;\n\t\tstrg[1] = 1;\n\n\t\tfor (int slide = 1; slide <= n - 1; slide++) {\n\n\t\t\tint sum = strg[0] + strg[1];\n\t\t\tstrg[0] = strg[1];\n\t\t\tstrg[1] = sum;\n\n\t\t}\n\n\t\treturn strg[1];\n\n\t}", "public int fibonacci(int n){\n int f[] = new int[n+2]; // 1 extra to handle case, n = 0\n int i;\n\n /* 0th and 1st number of the series are 0 and 1*/\n f[0] = 0;\n System.out.print(f[0]+\" \");\n f[1] = 1;\n System.out.print(f[1]+\" \");\n\n for (i = 2; i <= n; i++)\n {\n /* Add the previous 2 numbers in the series\n and store it */\n f[i] = f[i-1] + f[i-2];\n System.out.print(f[i]+\" \");\n }\n\n return f[n];\n }", "public static long fibonacci(int n) {\n return fibonacciMemoization(n, new HashMap<>());\n }", "static int fib(int n, int a, int b)\n {\n if (n == 0) {\n return 0;}\n// elseif(n==1){\n// \treturn 1;}\n else{\n for (int i = 2; i <= n; i++) \n { \n int \ttemp = a + b; \n a = b; \n temp = b;\n } \n return b; \n }\n }", "private int recursiveFib(int n) {\r\n if (n <= 2) {\r\n return 1;\r\n }\r\n \r\n return recursiveFib(n - 2) + recursiveFib(n - 1);\r\n }", "public static int BinaryFib (int n) {\n\t\tif (n <= 1) {\n\t\t\treturn n;\n\t\t}\n\t\telse {\n\t\t\treturn BinaryFib(n-1) + BinaryFib(n-2);\n\t\t}\n\t}", "public static int fibo_iterative(final int n) {\n if (n < 0) {\n return -1; // Error condition.\n }\n if (n == 0) {\n return 0;\n }\n int a = 1, b = 1;\n for (int i = 3; i <= n; i++) {\n final int c = a + b;\n a = b;\n b = c;\n }\n return b;\n }", "private static int fib(int a, int b, int n) {\n\t\tint arr[] = new int[n + 1];\n\t\tarr[0] = a;\n\t\tarr[1] = b;\n\t\tfor (int i = 2; i < n; i++) {\n\t\t\tarr[i] = arr[i - 1] + arr[i - 2];\n\t\t}\n\t\treturn arr[n - 1];\n\t}", "public static int fib(int N) {\n if (N == 1)\n return 1;\n if (N == 0)\n return 0;\n return fib(N-1) + fib(N-2);\n }", "public int badFibonacci(int n){\n if (n <= 1){\n return (n);\n }\n return (badFibonacci(n-2) + badFibonacci(n-1));\n }", "public int fibNaive(int n) {\n int f;\n if (n == 0 || n == 1) f = 1;\n else f = fibNaive(n - 1) + fibNaive(n - 2);\n return f;\n }", "public static int fibonacci(int number){\n\t\tif(number <= NumberUtils.INTEGER_ONE){ \n\t\t\treturn number; \n\t\t} \n\t\t//recursive call\n\t\treturn fibonacci(number - NumberUtils.INTEGER_ONE) + fibonacci(number - INTEGER_TWO); \n\t}", "private int fibCache(int n) {\n if (n == 1) {\n //System.out.print (1 + \" \");\n return 1;\n } else if (n == 2) {\n //System.out.print (1 + \" \");\n return 1;\n } else {\n \n Integer fibn2 = fibCache.get(n-2);\n if (fibn2 == null) {\n fibCache.put(n-2, fib(n-2));\n fibn2 = fibCache.get(n-2);\n }\n\n Integer fibn1 = fibCache.get(n-1);\n if (fibn1 == null) {\n fibCache.put(n-1, fib(n-1));\n fibn1 = fibCache.get(n-1);\n } \n \n //System.out.print(nextfib + \" \");\n \n int nextfib = fibn2 + fibn1;\n return nextfib;\n }\n }", "public static int fibboDP(int n){\n int[] mem = new int[n+1];\n if(n==0 || n==1){\n return mem[n]=n;\n }\n if(mem[n]!=0){\n return mem[n];\n }\n int fib1 = fibboDP(n-1);\n int fib2 = fibboDP(n-2);\n return mem[n] = fib1+fib2;\n }", "public int fibonacci(int n, int i, int a, int b) {\n if (i == n) return a;\n return fibonacci(n, i + 1, a + b, a);\n }", "public static int fibonacciBU(int n) {\n\n\t\tint[] strg = new int[n + 1];\n\n\t\tstrg[0] = 0;\n\t\tstrg[1] = 1;\n\n\t\tfor (int i = 2; i < strg.length; i++) {\n\t\t\tstrg[i] = strg[i - 1] + strg[i - 2];\n\t\t}\n\n\t\treturn strg[n];\n\n\t}", "public static int fibonaci(int number) {\n if(number <= 0) return 0;\n if (number == 1 || number == 2) {\n return 1;\n }\n\n return fibonaci(number - 1) + fibonaci(number - 2);\n }", "public static List<Integer> fibonacci(int n) {\n\t\tList<Integer> Lista = new ArrayList<Integer>();\n\t\tInteger primero=1;\n\t\tInteger segundo=1;\n\t\tswitch(n){\n\t\t\tcase 1: Lista.add(primero);\n\t\t\tcase 2: Lista.add(primero); Lista.add(segundo);\n\t\t\tdefault:\n\t\t\t\tLista.add(primero); Lista.add(segundo);\n\t\t\t\tfor(int i=2; i<n;i++){\n\t\t\t\t\tLista.add(Lista.get(i-2)+Lista.get(i-1));\n\t\t\t\t}\n\t\t}\n\t\treturn Lista;\n\t}", "public int fib(int n) {\n// // 法一:记忆化递归\n// if (n <= 1) {\n// return n;\n// }\n// if (cache[n] != 0) {\n// return cache[n];\n// }\n// cache[n] = (fib(n - 1) + fib(n - 2)) % 1000000007;\n// return cache[n];\n// // 法二:动态规划\n// if (n == 0 || n == 1) {\n// return n;\n// }\n// int[] dp = new int[n + 1];\n// dp[0] = 0; dp[1] = 1;\n// for (int i = 2; i <= n; i++) {\n// dp[i] = dp[i - 1] + dp[i - 2];\n// dp[i] = dp[i] % 1000000007;\n// }\n// return dp[n];\n // 动态规划,优化空间\n if (n == 0 || n == 1) {\n return n;\n }\n int a = 0, b = 1, sum = 0;\n for (int i = 2; i <= n; i++) {\n sum = (a + b) % 1000000007;\n a = b;\n b = sum;\n }\n return sum;\n }", "public static int fib(int index) {\r\n\t\t// default values for fibonacci and f0, f1\r\n\t\tint fibonacci = 0;\r\n\t\tint f0 = 0;\r\n\t\tint f1 = 1;\r\n\r\n\t\t// if index is not 0 or 1 calculate fibonacci\r\n\t\tif (index != 0 && index != 1) {\r\n\r\n\t\t\t// loop starts from 2 (fib on index 2 is 1)\r\n\t\t\tfor (int i = 2; i <= index; i++) {\r\n\t\t\t\tfibonacci = f0 + f1;\r\n\t\t\t\tf0 = f1;\r\n\t\t\t\tf1 = fibonacci;\r\n\t\t\t}\r\n\t\t\t// else fibonacci is index\r\n\t\t} else {\r\n\t\t\tfibonacci = index;\r\n\t\t}\r\n\t\treturn fibonacci;\r\n\t}", "public static long optimisedFib(long n){\n\n if(memo.containsKey(n)){\n return memo.get(n);\n }\n\n if(n < 2){\n memo.put(n, n);\n return n;\n }\n\n long f = optimisedFib(n-1) + optimisedFib(n-2);\n memo.put(n, f);\n\n return f ;\n\n }", "private int fibonacci(int n, int acc1, int acc2) {\n\t\tif (n < 2) {\n\t\t\treturn n == 0 ? 0 : acc1;\n\t\t}\n\t\treturn fibonacci(n - 1, acc2, acc1 + acc2);// time complexity: O(n)\n\t}", "public int printFibonacciSeries(int n) {\n if (n <= 1) {\n return n;\n }\n return printFibonacciSeries(n - 1) + printFibonacciSeries(n - 2);\n }", "private int calculateFibonacciUsingTopDownMemorization(int n) {\n int[] memory = new int[n+1];\n if (n < 2) {\n return n;\n }\n if(memory[n] != 0){\n return memory[n];\n }\n memory[n] = calculateFibonacciUsingTopDownMemorization(memory, n - 1) + calculateFibonacciUsingTopDownMemorization(memory, n - 2);\n return memory[n];\n\n }", "public static int fibSum(int n) {\n int sum = 0;\n int fib1 = 1;\n int fib2 = 1;\n for (int i = 3; fib2 < n; i++) {\n int x = fib1 + fib2;\n fib1 = fib2;\n fib2 = x;\n if (fib2 % 2 == 0) sum += fib2;\n }\n return sum;\n }", "public int fibonacciIterative(int n) {\n\t\tint prev = 0;\n\t\tint next = 1;\n\n\t\tfor (int j = 0; j < n; j++) {\n\t\t\tint tmp = next;\n\t\t\tnext = next + prev;\n\t\t\tprev = tmp;\n\t\t}\n\t\treturn prev;\n\t}", "public static int efficientOne(int n) {\r\n\t\tif (n < 2)\r\n\t\t\treturn n;\r\n\t\tint prevPrev = 0;\r\n\t\tint prev = 1;\r\n\t\tint fib = 0;\r\n\t\tfor (int i = 2; i <= n; i++) {\r\n\t\t\tfib = prev + prevPrev;\r\n\t\t\tprevPrev = prev;\r\n\t\t\tprev = fib;\r\n\t\t}\r\n\t\treturn fib;\r\n\t}", "public static int calculateFibonacciNumber(int i)\n {\n if(i==1||i==2)return 1;\n else\n {\n return calculateFibonacciNumber(i-1)+calculateFibonacciNumber(i-2);\n }\n }", "private static int fibRaw(int n) {\n if (n < 2) {\n return n;\n } else {\n return fibRaw(n - 1) + fibRaw(n - 2);\n }\n }", "public long fibonacci(long number) {\n\t\tif (number == 0 || number == 1)\n\t\t\treturn number;\n\t\telse\n\t\t\treturn fibonacci(number - 1) + fibonacci(number - 2);\n\t}", "public BigDecimal getFibonacci(Integer number) throws Exception;", "private int fibonacciHelper (int fibCurrent, int fibPrevious, int n) {\n\t\tcounter ++;\n\t\tif (n==1) \n\t\t\treturn fibCurrent;\n\t\t\telse \n\t\t\t\treturn fibonacciHelper ( fibCurrent+ fibPrevious, fibCurrent, n-1);\n\t}", "private static int naiveFib(int n) {\n if (n == 0) return 0;\n if (n == 1) return 1;\n\n return naiveFib(n-1) + naiveFib(n-2);\n }", "public static long fib(long index) {\n if (index == 0) // Base case\n return 0;\n else if (index == 1) //base case)\n return 1;\n else //reducting and recursive calls\n return fib(index - 1) + fib(index - 2); \n }", "private static int fibonacci(int num) {\n if (num <= 1) {\n return num;\n }\n int number1 = fibonacci(num - 1);\n int number2 = fibonacci(num - 2);\n return number1 + number2;\n }", "public int fibonacci(int num) {\r\n\r\n if (num == 0) {\r\n return 0;\r\n }\r\n else if(num == 1)\r\n {\r\n return 1;\r\n }\r\n \r\n return fibonacci(num-1) + fibonacci(num-2);\r\n }", "static public Integer fib (Integer num){\n\t\tif (num == 0) {\n\t\t\treturn 0;\n\t\t} else if (num == 1) {\n\n\t\t\treturn 1;\n\n\t\t} else {\n\n\t\t return fib(num -1) + fib(num -2);\n\n }\n\t}", "public int fibBottomUp(int n) {\n int[] fib = new int[n + 1];\n for (int i = 0; i <= n; i++) {\n int f;\n if (i == 0 || i == 1) f = 1;\n else f = fib[i - 1] + fib[i - 2];\n fib[i] = f;\n }\n return fib[n];\n }", "public int fib_solution1(int N) {\n if (N <= 0) {\n return 0;\n }\n if (N == 1) {\n return 1;\n }\n return fib_solution1(N - 1) + fib_solution1(N - 2);\n }", "public long findNthFibonacci(int number)\n {\n // Your Code Here\n \n long dp[] = new long[number+1];\n \n dp[0]=0L;\n dp[1]=1L;\n \n for(int i=2;i<=number;i++){\n dp[i]=dp[i-1]+dp[i-2];\n }\n return dp[number];\n }", "public static BigInteger calculateModifiedFib(int a, int b, int n) {\n \n BigInteger[] fib_of_all = new BigInteger[n+2];\n fib_of_all[0] = BigInteger.valueOf(a);\n fib_of_all[1] = BigInteger.valueOf(b);\n\n\n\n BigInteger fib_of_n = BigInteger.valueOf(0);\n\n //fib_of_n = (fib_of_n+2) - (fib_of_n+1)2;\n\n for(int c = 2; c < n+2; c++) {\n \tfib_of_all[c] = fib_of_all[c-2].add(fib_of_all[c-1].pow(2));\n }\n\n return fib_of_all[n-1];\n }", "private int iterativeFib(int n) {\r\n int backVal = 0, frontVal = 1;\r\n \r\n for (int i = 1; i < n - 1; i++) {\r\n int temp = frontVal + backVal;\r\n backVal = frontVal;\r\n frontVal = temp;\r\n }\r\n \r\n return frontVal + backVal;\r\n }", "public static int fib(int index){\n int num1 = 0;\n int num2 = 1;\n int temp;\n\n for(int i = 0; i < index-1; i++){\n temp = num2;\n num2 += num1;\n num1 = temp;\n }\n\n return num2;\n }", "private int fibonacci(int x) {\n int a = 0;\n int b = 1;\n\n for (int i = 0; i < x; i++) {\n int c = a + b;\n a = b;\n b = c;\n }\n\n return a;\n }", "public static int efficient_fibonacci(int num) {\n\t\tDouble temp=(Math.sqrt(5)+1)/2.0;\n\t\tDouble result=Math.pow(temp,num)/Math.sqrt(5);\n\t\treturn (int)Math.round(result);\n\t}", "public static int fastFib(int n) {\n\t\t\n\t\tint a = 1;\n\t\tint b = 0;\n\t\t\n\t\tint temp = 0;\n\t\tfor(int i=0; i<n-1; i++){\n\t\t\ttemp = a;\n\t\t\ta += b;\n\t\t\tb = temp;\n\t\t\tif(a<0){\n\t\t\t\tSystem.out.println(\"Int overflow\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n return a; \n \n\t}", "private static int fibByMemoization(int n, int[] questionBank){\n //Base Case\n if(n == 0 || n == 1){\n return n;\n }\n\n if(questionBank[n] != 0){\n return questionBank[n];\n }\n\n //faith\n int ans1 = fibByMemoization(n - 1, questionBank);\n int ans2 = fibByMemoization(n - 2, questionBank);\n int answer = ans1 + ans2;\n //faith * expectation\n questionBank[n] = answer;\n return answer;\n }", "private static int recursiveFibDP(int n) {\n\n Integer[] table = new Integer[n + 1];\n if(table[n]==null){\n if (n <= 1) {\n table[n] = n;\n }\n else {\n table[n] =recursiveFibDP(n-1)+recursiveFibDP(n-2);\n }\n }\n return table[n];\n }", "public BigInteger fib(long i) {\n Map<Long, BigInteger> cache = new HashMap<>();\n if (i == 0) return BigInteger.ZERO;\n if (i == 1) return BigInteger.ONE;\n\n //The complete signature for the computIfAbsent method is:\n //V computeIfAbsent(K key, Function<? super K, ? extends V> mappingFunction)\n //This method is particularly useful when creating a cache of the results of method calls.\n return cache.computeIfAbsent(i, n -> fib(n - 2).add(fib(n - 1)));\n }", "public long fibonacci_with_dp(int n){\n global_dp_count++;\n if(lookup[n] ==0) {\n if (n <= 1) {\n lookup[n] = n;\n } else {\n lookup[n] = fibonacci_with_dp(n - 1) + fibonacci_with_dp(n - 2);\n }\n }\n return lookup[n];\n }", "public static double fibonacci(int number) throws IOException {\n\t\tif (number == 0 || number == 1) {\n\t\t\treturn 1;\n\t\t} else {\n\t\t\treturn fibonacci(number - 2) + fibonacci(number - 1);\n\t\t}\n\t}", "private static long fib(long n, long m) {\n if (n == 0 || n == 1) {\n return n;\n }\n \n long temp;\n long first = 0;\n long second = 1;\n \n for (int i = 2; i < n + 1; i++) {\n temp = first;\n first = second;\n second = (second + temp) % m;\n }\n return second;\n }", "public int fib_solution2(int N) {\n if (N <= 1) {\n return N;\n }\n int[] cache = new int[N + 1];\n cache[1] = 1;\n\n for (int i = 2; i <= N; i++) {\n cache[i] = cache[i-1] + cache[i-2];\n }\n return cache[N];\n }", "public BigInteger nextFibonacci() {\n if (this.data.size() == 0) {\n // Base case: zero.\n this.data.add(new BigInteger(\"0\"));\n } else if (this.data.size() == 1) {\n // Base case: one.\n this.data.add(new BigInteger(\"1\"));\n } else {\n this.data.add( this.data.get(this.data.size()-1).add(this.data.get(this.data.size()-2)) );\n }\n return this.data.get(this.data.size()-1);\n }", "public static long fibonacciTabulation(int n) {\n\n long[] table = new long[n + 1]; \n for (int i = 0; i <= n; i++) {\n table[i] = 0;\n }\n table[1] = 1;\n\n for (int i = 2; i <= n; i++) {\n table[i] = table[i - 1] + table[i - 2];\n }\n\n return table[n];\n }", "static void fibonacciSeries(int n) {\n\n\t\tint i = 1, t1 = 0, t2 = 1;\n\n\t\twhile (i < n) {\n\n\t\t\tSystem.out.print(t1 + \" \");\n\t\t\tint sum = t1 + t2; // 1\n\n\t\t\tt1 = t2;\n\t\t\tt2 = sum;\n\t\t\ti++;\n\n\t\t}\n\n\t}", "int main()\n{\n int n;\n cin>>n;\n printf(\"The term %d in the fibonacci series is %d\",n,fib(n-1));\n}", "public static int fibTD(int n) {\n\t\tint[] dp = new int[n + 1];\n\t\tArrays.fill(dp, -1);\n\t\treturn fibTD(n, dp);\n\t}", "public void printFibonacciSeriesWithLoop(int n) {\n int[] arr = new int[n];\n for (int i = 0; i < n; i++) {\n if (i <= 1) {\n arr[i] = i;\n } else {\n arr[i] = arr[i-1] + arr[i-2];\n }\n }\n Arrays.stream(arr).forEach(System.out::println);\n }", "public static int fibonacciMemoization(int n ,int[] memo){\n if (n==0 || n==1) return n;\n //strong logic\n if(memo[n]==0)\n memo[n]=fibonacciMemoization(n-1,memo)+fibonacciMemoization(n-2,memo);\n return memo[n];\n }", "int main()\n{\n int n;\n cin>>n;\n fibo(n);\n return 0;\n}", "public static long FiboRec (int n) {\n if (n < 0) {\n return -1;\n } \n if (n == 0 || n == 1) {\n return n;\n }\n return FiboRec(n-1) + FiboRec(n-2);\n }", "public static void printFibonacci(int number) {\n\t\tint number1 = 1, number2=2;\n\t\t//and print the numbers since they are part of fib series\n\t\tSystem.out.print(number1+\" \"+number2+\" \");\n\t\t//to find the fib numbers up to a number, use for loop\n\t\tfor(int i=0; i<=number; i++) {\n\t\t\tint fibNumber = number1+number2;\n\t\t\tnumber1 = number2;//after each loop number1 should increase to number2\n\t\t\tnumber2 = fibNumber;//and number2 should be the total which is fibNumber\n\t\t\t//if fibNumber is equal to or bigger then given number break the loop\n\t\t\tif(fibNumber==number || fibNumber>number) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t//print the fibnumbers\n\t\t\tSystem.out.print(fibNumber+\" \");\n\t\t}\n\t}", "public static void fibonacci(int fibo) {\n }", "public int fibonacciNum (int index){\n int firsnum = 0;\n int secnum = 1;\n int allSum = 0;\n\n for (int i = 0; i < index ; i ++){\n allSum = firsnum + secnum;\n firsnum = secnum;\n secnum = allSum;\n\n\n }\n\n\n return allSum;\n }", "public static int revFibonacci(int f1, int f2, int c, int n) {\n\t\tif (c < n) {\n\t\t\treturn revFibonacci(f2, f1+f2, c+1, n);\n\t\t} else\n\t\t\treturn f2;\n\t}", "@Override\r\n\tpublic int fib(int x) {\n\t\treturn 0;\r\n\t}", "public BigInteger calculateFibDP (BigInteger n){\n\t\t\n\t\tif (fibHashMap.containsKey(n))\n\t\t\treturn fibHashMap.get(n);\n\t\t\n\t\tBigInteger low = new BigInteger(\"3\");\n\t\tint compareValue=n.compareTo(low);\n\t\tif(compareValue==-1)\n\t\t\treturn new BigInteger(\"1\");\n\t\telse{\n\t\t\t\n\t\t\tBigInteger num = calculateFibDP ( n.subtract(new BigInteger(\"1\")) ).add(calculateFibDP ( n.subtract(new BigInteger(\"2\")))); \n\t\t\tfibHashMap.put(n, num);\n\t\t\treturn num;\n\t\t}\n\t}", "private static int fibonacciWithLoop(int num) {\n\n if (num <= 0) {\n return 0;\n }\n\n /**\n * first and second case are pre-computed\n */\n /*\n * first case\n */\n int number1 = 0;\n /*\n * second case\n */\n int number2 = 1;\n\n int sum = 0;\n\n for (int i = 2; i <= num; i++) {\n\n sum = number1 + number2;\n\n System.out.println(number1 + \"+\" + number2 + \" = \" + sum);\n\n number1 = number2;\n number2 = sum;\n\n }\n\n return sum;\n }", "public static BigInteger[] fibonacciSeriesRecursive(int n) {\n\t\treturn null;\n\t}", "public void Fibonacciseries()\r\n\t{\r\n\t\tint firstNo=0,secondNo=1,sum;\r\n\t\tint count;\r\n\t\t\r\n\t\tSystem.out.println(\"Enter the Number\");\r\n\t\tcount = sc.nextInt();//Read the number to calculate fibonacci\r\n\t\t\r\n\t\tSystem.out.println(firstNo);\r\n\t\tSystem.out.println(secondNo);\r\n\t\t\r\n\t\tfor(int i=2;i<count;i++) //loop start from 2nd value \r\n\t\t{\r\n\t\t\tsum=firstNo+secondNo;\r\n\t\t\tSystem.out.println(+sum);\r\n\t\t\tfirstNo=secondNo;\r\n\t\t\tsecondNo=sum;\r\n\t\t\t\r\n\t\t}\r\n\t}", "public int fib_solution4(int N) {\n int[] result = new int[]{0, 1};\n if (N <= 1) {\n return result[N];\n }\n int fibN = 0, prevOne = result[1], prevTwo = result[0];\n\n for (int i = 2; i <= N; i++) {\n fibN = prevOne + prevTwo;\n\n prevTwo = prevOne;\n prevOne = fibN;\n }\n return fibN;\n }", "public ArrayList<Integer> Fibonacci(int num) {\n\t\tArrayList<Integer> fibonacciNums = new ArrayList<Integer>();\n//\t\tinitialization\n\t\tint firstNum = 1;\n\t\tint secondNum = 1;\n\t\tint fibNum = 0;\n//\t\tn - 2 value\n\t\tfibonacciNums.add(firstNum);\n//\t\tn - 1 value\n\t\tfibonacciNums.add(secondNum);\n//\t\tbecause our assumption is n has a lowest possible value of 3\n\t\tfor (int i = 3; i <= num; i++) {\n\t\t\tfibNum = firstNum + secondNum;\n\t\t\tfibonacciNums.add(fibNum);\n\t\t\tfirstNum = secondNum;\n\t\t\tsecondNum = fibNum;\n\t\t}\n\t\treturn fibonacciNums;\n\t}", "public static long longFastFib(int n) {\n\t\tlong a = 1;\n\t\tlong b = 0;\n\t\t\n\t\tlong temp = 0;\n\t\tfor(int i=0; i<n-1; i++){\n\t\t\ttemp = a;\n\t\t\ta += b;\n\t\t\tb = temp;\n\t\t\tif(a<0){\n\t\t\t\tSystem.out.println(\"Int overflow\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n return a; \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n \n }", "public static int fibonacciDP(int n,int[] array){\n if (array[n] == -1 ){\n int res = 0;\n if (n==0 || n == 1)\n res = n;\n else\n res = fibonacciDP(n - 1, array) + fibonacciDP(n - 2, array);\n\n array[n] = res;\n }\n return array[n];\n }" ]
[ "0.8952555", "0.89313084", "0.89166886", "0.88863224", "0.8868657", "0.8853242", "0.88485706", "0.8787673", "0.8752418", "0.8696998", "0.86332554", "0.8610085", "0.859204", "0.85852426", "0.85652566", "0.855588", "0.85406595", "0.8538361", "0.84628546", "0.84200525", "0.8397325", "0.8388006", "0.83591735", "0.8285157", "0.81390977", "0.8137212", "0.8082614", "0.804884", "0.8042231", "0.80119115", "0.7986151", "0.7942752", "0.79299784", "0.78805584", "0.78575903", "0.78517723", "0.7845636", "0.7808193", "0.7793723", "0.7779999", "0.7746353", "0.7742406", "0.769525", "0.7671239", "0.7656524", "0.7620651", "0.7618076", "0.7613361", "0.7596898", "0.7592893", "0.7590177", "0.75363076", "0.7533422", "0.7501181", "0.74857265", "0.7474931", "0.7437189", "0.74023664", "0.73556656", "0.7343053", "0.7327108", "0.7276612", "0.72701156", "0.725703", "0.7223584", "0.72109824", "0.7198756", "0.7135009", "0.71162283", "0.71140236", "0.7073817", "0.70387644", "0.6997146", "0.6983592", "0.6974421", "0.6965193", "0.6937862", "0.6931878", "0.6921255", "0.69136137", "0.68817395", "0.68800086", "0.68634796", "0.6861743", "0.6832326", "0.6832172", "0.6765919", "0.6707761", "0.66848177", "0.6640518", "0.6637682", "0.6626017", "0.6619275", "0.6616107", "0.6584041", "0.6542665", "0.65029895", "0.64797187", "0.6470926", "0.645799" ]
0.9014081
0
Authentication.log(req.getCookies()[0].getValue() + " ."); System.out.println("START ADMIN Edit SERVLET IS DONE! (GET)");
@Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { if (Authentication.isAdminInDbByCookies(req)) { // Authentication.log(req.getCookies()[0].getValue() + " - redirect to /admin/registration/registration.html"); req.getRequestDispatcher("/admin/registration/registration.html") .forward(req, resp); } else { // Authentication.log(req.getCookies()[0].getValue() + " - redirect to / . Error Authorization."); resp.sendRedirect("/"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void doPost(HttpServletRequest r, HttpServletResponse s) throws ServletException, IOException {\n Cookie ck=new Cookie(\"auth\",\"\"); \n ck.setMaxAge(0);\n s.addCookie(ck); \n RequestDispatcher rd = r.getRequestDispatcher(\"index.jsp\");\n rd.forward(r, s);\n \n }", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tresp.setContentType(\"type=text/html; charset=utf-8\");\r\n\t\tPrintWriter out = resp.getWriter();\r\n\t\tString username = req.getParameter(\"username\");\r\n\t\tString password = req.getParameter(\"password\");\r\n\t\tout.print(username+\"===\"+password);\r\n\t\treq.getSession().setAttribute(\"remoteusername\", username);\r\n\t\treq.getSession().setAttribute(\"remotepassword\", password);\r\n\t\t\r\n\t\tCookie c1 = new Cookie(\"cooUserName\", username);\r\n\t\tCookie c2 = new Cookie(\"cooPassword\", password);\r\n\t\tc1.setPath(\"/\");\r\n\t\tc2.setPath(\"/\");\r\n\t\tresp.addCookie(c1);\r\n\t\tresp.addCookie(c2);\r\n\t\tc1.setMaxAge(60 * 60 * 24 * 14);\r\n\t\tc2.setMaxAge(60 * 60 * 24 * 14);\r\n\t\tRequestDispatcher dispatcher = req.getRequestDispatcher(\"/main.jsp\");\r\n\r\n\t\tdispatcher .forward(req, resp);\r\n\t\t//super.doPost(req, resp);\r\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tCookie[] cookies = req.getCookies();\n\t\tif (cookies != null) {\n\t\t\tfor (Cookie cookie : cookies) {\n\t\t\t\tif (cookie.getName().equals(\"hello-cookie\")) {\n\t\t\t\t\t// cookie has already been created\n\t\t\t\t\tSystem.out.println(\"Replacing old cookie value: \" + cookie.getValue());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Cookie cookie = req.getCookie(\"hello-cookie\"); // Java EE 7\n\n\t\t// creating cookies\n\t\tCookie cook = new Cookie(\"hello-cookie\", req.getParameter(\"cookie\"));\n\t\tcook.setMaxAge(2_000_000_000); // expiry\n\t\tresp.addCookie(cook);\n\n\t}", "@Override\n protected void doPost(HttpServletRequest req,\n HttpServletResponse resp)\n throws ServletException, IOException {\n\n String requestBody = \"\";\n requestBody = IOUtils.toString(req.getReader());\n String[] usernameAndPassword = requestBody.split(\"&\");\n String username = usernameAndPassword[0].substring(9);\n String password = usernameAndPassword[1].substring(9);\n LoginDAO loginDAO = new LoginDAO();\n JsonCredential credential = loginDAO.login(username,password);\n if(credential == null) {\n // send invalid login response\n log.info(\"LoginServlet, Invalid Username/Password\");\n String invalidLoginURL = String.format(\"%s/\", req.getContextPath());\n resp.setStatus(401);\n }\n else{\n // login user, maybe with a redirect\n String credentialAsString = credential.makeJsonString();\n if(!credentialAsString.equals(\"\")) {\n // encoding prevents issue where Tomcat sees Cookie as invalid\n credentialAsString = URLEncoder.encode(credentialAsString,\"UTF-8\");\n Cookie cookie = new Cookie(\"expenseapp_authenticationcookie\",credentialAsString);\n cookie.setMaxAge(1200000); //roughly 2 weeks before expiration\n if(credential.getPermissionName().equals(\"Employee\")) {\n resp.addCookie(cookie);\n String employeeHomeScreen = String.format(\"%s/employeehomescreen.html\", req.getContextPath());\n resp.sendRedirect(employeeHomeScreen);\n }\n else if(credential.getPermissionName().equals(\"Manager\")) {\n resp.addCookie(cookie);\n String managerHomeScreen = String.format(\"%s/managerhomescreen.html\", req.getContextPath());\n resp.sendRedirect(managerHomeScreen);\n }\n else{\n log.error(\"LoginServlet, Invalid Permission Name - 500 error\");\n resp.setStatus(500);\n String errorUrl = String.format(\"%s/500Error.html\", req.getContextPath());\n req.getRequestDispatcher(errorUrl).forward(req,resp);\n }\n }\n }\n\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String name = request.getParameter(\"name\");\n String password = request.getParameter(\"password\");\n Cookie firstName = new Cookie(\"name\", request.getParameter(\"name\"));\n Cookie passWord = new Cookie(\"password\", request.getParameter(\"password\"));\n firstName.setMaxAge(60 * 60 * 24);\n response.addCookie(passWord);\n response.addCookie(firstName);\n response.setContentType(\"text/html\");\n\n try {\n Request(request, response, name, password);\n } catch (Exception ex) {\n Logger.getLogger(dbServlet.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\n\t\t\r\n\t\t\r\n\t\tString id = \"방그리\";\r\n\t\t\r\n\t\tid = URLEncoder.encode(id, \"utf-8\");\r\n\t\t\r\n\t\tCookie cookie = new Cookie(\"loginId\", id);\r\n\t\tcookie.setMaxAge(60*60*24*30); // 단위는 초단위 \r\n\t\t//cookie.setDomain(\"http://www.naver.com\");\r\n//\t\tcookie.setPath(\"/\");\r\n\t\t\r\n\t\t//쿠키를 헤더에 밀어넣는 작업\r\n//\t\tresponse.setHeader(\"Set-Cookie\",\".......\");\r\n\t\t//밀어넣고~\r\n\t\tresponse.addCookie(cookie);\r\n\t\t// 보내주고~\r\n\t\tresponse.sendRedirect(\"hello2\");\r\n\t\t\r\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n RequestDispatcher view = request.getRequestDispatcher(\"/board/boardLogin.jsp\");\n Cookie[] cookies = request.getCookies();\n String userId=null;\n for(int i = 0; i< cookies.length;i++){\n Cookie cookie = cookies[i];\n if(cookie.getName().equals(\"userId\")){\n userId = cookie.getValue();\n break;\n }\n }\n if(request.getServletContext().getAttribute(\"connect\")==null){\n request.getServletContext().setAttribute(\"connect\",new Integer(0));\n }\n\n// int a[]={1,2,3,4,7,8,11,12,16,19,20,22,24,34,40,41};\n//\n// for(int j=0 ; j< a.length;j++){\n// if(Math.random()*10+1>5){\n// System.out.println(a[j]);\n// }\n//\n// }\n\n int connect = (Integer)request.getServletContext().getAttribute(\"connect\");\n\n request.getServletContext().setAttribute(\"connect\",new Integer(connect));\n\n request.setAttribute(\"userId\",userId);\n\n request.setAttribute(\"connect\",new Integer(connect));\n view.forward(request, response);\n\n }", "@Override\n protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n resp.setContentType(\"text/html; charset=utf-8\");\n PrintWriter printWriter = resp.getWriter();\n if (req.getCookies() != null)\n for (int i = 0; i < req.getCookies().length; i++) {\n Cookie cookie = req.getCookies()[i];\n if (cookie.getName().equals(\"name\")) {\n printWriter.println(\"Hello \" + cookie.getValue());\n return;\n }\n printWriter.println(\"<html><head><title>My Servlet</title></head>\");\n printWriter.println(\"<body>\");\n printWriter.println(\"<p><h2>This is simple</h></p>\");\n printWriter.println(\"<p><h3>Servlet example.</h3></p>\");\n printWriter.println(\"<form method=\\\"post\\\">\");\n printWriter.println(\"<p>Give Name:<p><input name=\\\"name\\\"/><input type=\\\"submit\\\" value=\\\"OK\\\"/>\");\n printWriter.println(\"</form>\");\n printWriter.println(\"</body></html>\");\n }\n }", "public void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\t\tresponse.setContentType(\"text/html;charset=utf-8\");\n\t\tString value1 = \"\",value2 = \"\";\n\t\tCookie cookie = null;\n\t\tCookie[] cookies = request.getCookies();\n\t\tif (cookies != null) {\n\t\t\tfor (int i = 0; i < cookies.length; i++) {\n\t\t\t\tcookie = cookies[i];\n//\t\t\t\tSystem.out.println(cookie.getName());\n\t\t\t\tif (cookie.getName().equals(\"username\")) {\n\t\t\t\t\tvalue1 = cookie.getValue();\n\t\t\t\t}\n\t\t\t\tif (cookie.getName().equals(\"password\")) {\n\t\t\t\t\tvalue2 = cookie.getValue();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (value1.equals(\"admin\") && value2.equals(\"admin\")) {\n\t\t\t\tmessage = \"欢迎您!\" + value1 + \"再次登录该页面!\";\n\t\t\t\trequest.getSession().setAttribute(\"message\", message);\n\t\t\t\tresponse.sendRedirect(\"ch3/welcome.jsp\");\n\t\t\t} else {\n\t\t\t\tresponse.sendRedirect(\"ch3/Login.jsp\");\n\t\t\t}\n\t\t} else {\n\t\t\tresponse.sendRedirect(\"ch3/Login.jsp\");\n\t\t}\n\t}", "private void loginAdmin(HttpServletRequest request, HttpServletResponse response) throws IOException, SQLException {\n\t\tString username = request.getParameter(\"username\");\n\t\tString pass = request.getParameter(\"password\");\n\t\tCookie[] theCookieLoop=request.getCookies();\n\t\t\n\t\tif(username.equals(\"admin\") && pass.equals(\"123456\")) {\n\t\t\tif(theCookieLoop !=null) {\n\t\t\t\tfor(Cookie tempCookie:theCookieLoop) {\n\t\t\t\t\tif(\"checkLoginPageAdmin\".equals(tempCookie.getName())) {\n\t\t\t\t\t\ttempCookie.setValue(\"true\");\n\t\t\t\t\t\tresponse.addCookie(tempCookie);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor(Cookie tempCookie:theCookieLoop) {\n\t\t\t\t\tif(\"UserLoginAdmin\".equals(tempCookie.getName())) {\n\t\t\t\t\t\ttempCookie.setValue(request.getParameter(\"username\"));\n\t\t\t\t\t\tresponse.addCookie(tempCookie);\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\tresponse.sendRedirect(\"/WebBuyPhone/admin/darkboard.jsp\");\n\t\t}\n\t\tboolean check;\n\t\tcheck=daoPageAdmin.LoginPageAdmin(request.getParameter(\"username\"),MD5Encrypt.hashPass(request.getParameter(\"password\")));\n\t\tif(check) {\n\t\t\ttheCookieLoop=request.getCookies();\n\t\t\tif(theCookieLoop !=null) {\n\t\t\t\tfor(Cookie tempCookie:theCookieLoop) {\n\t\t\t\t\tif(\"checkLoginPageAdmin\".equals(tempCookie.getName())) {\n\t\t\t\t\t\ttempCookie.setValue(\"true\");\n\t\t\t\t\t\tresponse.addCookie(tempCookie);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor(Cookie tempCookie:theCookieLoop) {\n\t\t\t\t\tif(\"UserLoginAdmin\".equals(tempCookie.getName())) {\n\t\t\t\t\t\ttempCookie.setValue(request.getParameter(\"username\"));\n\t\t\t\t\t\tresponse.addCookie(tempCookie);\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\ttheCookie =new Cookie(\"userLoginPageAdmin\",request.getParameter(\"username\"));\n\t\t\ttheCookie.setMaxAge(60*60*24*365);\n\t\t\tresponse.addCookie(theCookie);\n\t\t\tresponse.sendRedirect(\"/WebBuyPhone/admin/darkboard.jsp\");\n\t\t}\n\t}", "@Override\r\nprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\tPrintWriter a=resp.getWriter();\r\n\tint aid=Integer.parseInt(req.getParameter(\"aid\"));\r\n\tString name=req.getParameter(\"anames\");\r\n\ta.println(\"welcome \"+name);\r\n}", "public void doGet(HttpServletRequest req,HttpServletResponse res) throws IOException {\n\tint k=0;\n\tCookie cook[]=req.getCookies();\n\tfor(Cookie c:cook) {\n\t\tif(c.getName().equals(\"k\")) {\n\t\t\tk=Integer.parseInt(c.getValue());\n\t\t}\n\t}\n\t\tk=k*k;\n\t\t// prints data on web page\n\t\tPrintWriter out= res.getWriter();\n\t\t\n\t\tout.println(\"Squaring Servlet \"+k);\n\t\t\n\tSystem.out.println(\"Sentt\");\n\t}", "@Override\r\n public void getCookie(String name)\r\n {\n\r\n }", "public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException\n\t\t\t {\n\n\t\tresponse.setContentType(\"text/html;charset=UTF-8\");\n\t\trequest.setCharacterEncoding(\"UTF-8\");\n\t\tHttpSession session=request.getSession();\n\t\tString id=request.getParameter(\"id\");\n\t\tString pwd=request.getParameter(\"pwd\");\n\t\tString rand = (String)session.getAttribute(\"rand\");\n\t\tString input = request.getParameter(\"rand\");\n\t\tString[] rem=request.getParameterValues(\"remember\");\n\t\tSystem.out.println(\"记住密码=\"+rem[0]);\n\t\tif (rand.equals(input)) {\n\t\t\tWebLoginDAO t=new WebLoginDAO();\n\t\t \tSystem.out.println(id+\"+\"+pwd);\n\t\t\tint ss=0;\n\t\t \ttry {\n\t\t\t\tss=t.checkid(id, pwd);\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\n\t\t\t\te.printStackTrace();\n\t\t\t\tthrow new ServletException(e);\n\t\t\t}\n\t\t \tSystem.out.println(\"check=\"+ss);\n\t\t\tif(ss==1){\n\t\t\t\t//存入登陆的用户logname\n\t\t\t\tRegistUser ee=new RegistUser();\n\t\t\t\tee.setLogname(id);\n\t\t\t\t//登陆成功后根据ID取出用户全部信息,以方便用户修改界面预显示信息\n\t\t\t\ttry {\n\t\t\t\t\tee.get(id);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tsession.setAttribute(\"user\", ee);\n<<<<<<< HEAD\n\t\t\t\tsession.setAttribute(\"logname\",id);\n\t\t\t\t\n=======\n\t\t\t\tsession.setAttribute(\"username\", id);\n>>>>>>> origin/master\n\t\t\t\t//检查“记住我”是否勾选;\n\t\t\t\tif(rem[0].equals(\"remember\")){\n\t\t\t\t//新建cookie对象\n\t\t \t\tCookie idcookie=new Cookie(\"id\", URLEncoder.encode(id, \"UTF-8\"));\n\t\t \t\tCookie pwdcookie=new Cookie(\"pwd\",pwd);\n\t\t \t\t//设置cookie的生命周期\n\t\t \t\tidcookie.setMaxAge(300);\n\t\t \t\tpwdcookie.setMaxAge(300);\n\t\t \t\t//将cookie写入客户端浏览器\n\t\t \t\tresponse.addCookie(idcookie);\n\t\t \t\tresponse.addCookie(pwdcookie);\n\t\t \t\tSystem.out.println(\"已记住\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\trequest.getRequestDispatcher(\"index2.jsp\").forward(request, response);\n\t\t\t}\n\t\t\telse if(ss==2){\n\t\t\t\tthrow new ServletException(\"密码错误!\");\n\t\t\t}\n\t\t\telse if(ss==3){\n\t\t\t\tthrow new ServletException(\"账号不存在!\");\n\t\t\t}\n\t\t}\n\t\telse{\n\n\t\t\t\tthrow new ServletException(\"验证码错误!\");\n\n\t\t\n\t\t}\n\t\t\n\t\t\n\t}", "@Override\n protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n // if request has language parameter save cookie\n String cookieLang = req.getParameter(\"lang\");\n if (cookieLang != null) {\n // request from changing the language, save cookie\n Cookie theCookie = new Cookie(\"MyDictionaryLanguage\", cookieLang);\n theCookie.setMaxAge(9999999 * 99);\n resp.addCookie(theCookie);\n RequestDispatcher dispatcher = req.getRequestDispatcher(\"/input.jsp\");\n dispatcher.forward(req, resp);\n }\n\n }", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n String userId = request.getParameter(\"username\");\r\n String password = request.getParameter(\"pass\");\r\n String remember = request.getParameter(\"remember\");\r\n \r\n HttpSession session = request.getSession();\r\n User user = new UserDAO().login(userId, password);\r\n \r\n if(user != null){//dang nhap thang cong\r\n if(remember != null){\r\n Cookie uCookie = new Cookie(\"username\", userId);\r\n uCookie.setMaxAge(24 * 3600);//hạn 1 ngày\r\n Cookie pCookie = new Cookie(\"password\", password);\r\n pCookie.setMaxAge(24 * 3600);//hạn 1 ngày\r\n response.addCookie(uCookie);\r\n response.addCookie(pCookie);\r\n }\r\n if(user.getRoleId() == 1) {\r\n response.sendRedirect(\"admin\");\r\n session.setAttribute(\"user\", user);\r\n }\r\n else if(user.getStatus() != 1) {//chua active code \r\n response.sendRedirect(\"active\");\r\n request.getSession().setAttribute(\"user\", user);\r\n \r\n } \r\n else {\r\n response.sendRedirect(\"home\"); \r\n session.setAttribute(\"user\", user);\r\n }\r\n }else{\r\n request.setAttribute(\"err\", \"Incorrect Id or Password\");\r\n request.getRequestDispatcher(\"login.jsp\").forward(request, response);\r\n }\r\n \r\n }", "public void eatCookie(){\n}", "public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n\t\tHttpSession session = request.getSession();\n\t\tPrintWriter writer = prepareResponse(response);\n\t\tString username = (String) session.getAttribute(USERNAME);\n\t\tif(!isLoggedIn(request, response, session)) {\n\t\t\tresponse.sendRedirect(response.encodeRedirectURL(\"/login?\" + STATUS + \"=\" + NOT_LOGGED_IN));\n\t\t\treturn;\n\t\t}\n\t\t\n//\t\tfor (Cookie cookies : request.getCookies()) {\n//\t\t\tif(cookies.getName().compareTo(\"date\") == 0) {\n//\t\t\t\twriter.println(\"<h3><font color=\\\"red\\\">Last Login is: \" + cookies.getValue() + \"!</font></h3>\");\n//\t\t\t}\n//\t\t}\n\t\t\n\t\tString status = getParameterValue(request, STATUS);\n\t\tboolean loginSuccess = status != null && status.equals(VERIFIEDUSERNAME)?true:false;\n\t\tboolean passchange = status != null && status.endsWith(PASSCHANGE)?true:false;\n\t\tboolean isAdmin = status != null && status.endsWith(ADMIN)?true:false;\n\t\tboolean adminFail = status != null && status.endsWith(ADMINFAIL)?true:false;\n\t\t//boolean shutdownFail = status != null && status.endsWith(SHUTDOWNFAIL)?true:false;\n\t\t\n\t\tString responseHtml = responseFormatSearch();\n\t\tString suggested = \"<html>\" + \n\t\t\t\t\"<center><a href=\\\"/suggested\\\">Want to see the most popular searches?</a><center>\" + \n\t\t\t\t\"</html>\";\n\t\tString footer = footerSearch();\n\t\tString admin = \"<html>\" + \n\t\t\t\t\t\t\"<center><a href=\\\"/admin\\\">Want to be an Admin?</a><center>\" + \n\t\t\t\t\t\t\"</html>\";\n\t\tString shutdown = \"<html>\" + \n\t\t\t\t\"<center><a href=\\\"/shutdown\\\">Shutdown Server</a><center>\" + \n\t\t\t\t\"</html>\";\n\t\tString finalResponse = \"\";\n\t\tif (DBHelper.isAdmin(username)) {\n\t\t\tfinalResponse = responseHtml + suggested + footer + shutdown;\n\t\t}\n\t\telse {\n\t\t\tfinalResponse = responseHtml + suggested + admin + footer + shutdown;\n\t\t}\n\t\t\n\t\t\n\t\tif(loginSuccess) {\n\t\t\twriter.println(\"<h3><font color=\\\"red\\\">Login Successful!</font></h3>\");\n\t\t} else if(passchange) {\n\t\t\twriter.println(\"<h3><font color=\\\"red\\\">Password Changed Successfully!</font></h3>\");\n\t\t} else if(isAdmin) {\n\t\t\twriter.println(\"<h3><font color=\\\"red\\\">You are now an Admin!</font></h3>\");\n\t\t} else if(adminFail) {\n\t\t\twriter.println(\"<h3><font color=\\\"red\\\">You are not an Admin!</font></h3>\");\n\t\t} \n//\t\telse if(shutdownFail) { \n//\t\t\tSystem.out.println(\"here\");\n//\t\t\twriter.println(\"<h3><font color=\\\"red\\\">You cannot shutdown because you are not an Admin!</font></h3>\");\n//\t\t}\n\t\twriter.println(finalResponse);\n\t}", "public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n response.setContentType(\"text/html\");\n // Actual logic goes here.\n PrintWriter out = response.getWriter();\n out.println(\"<h1> hello ... servlet </h1>\");\n shiro_signin();\n\n logger.info(\"this is log4j info\");\n }", "public void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n response.setContentType(\"text/html;charset=UTF-8\");\n \n try(PrintWriter out = response.getWriter()){\n \n String user = request.getParameter(\"text\");\n String pass = request.getParameter(\"password\");\n \n Cookie ck = new Cookie(\"auth\", user);\n ck.setMaxAge(600);\n \n DbConnect dbCon = new DbConnect();\n Connection connect = dbCon.getCon();\n \n PreparedStatement pst = connect.prepareStatement\n (\"SELECT Username, UserSecretCode FROM break.Users where Username=? and UserSecretCode=?\");\n \n pst.setString(1, user);\n pst.setString(2, pass);\n \n ResultSet rs = pst.executeQuery();\n \n if (rs.next()) {\n response.addCookie(ck);\n response.sendRedirect(\"index.html\");\n } else {\n RequestDispatcher rd = request.getRequestDispatcher(\"login.html\");\n rd.include(request, response);\n }\n } catch (SQLException ex) {\n \n Logger.getLogger(LoginServlet.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\n response.setContentType(\"text/html\");\r\n PrintWriter writer = response.getWriter();\r\n String userName = request.getParameter(\"userName\");\r\n HttpSession session = request.getSession();\r\n if (userName != \"\" && userName != null){\r\n \r\n session.setAttribute(\"savedUserName\", userName);\r\n }\r\n \r\n writer.println(\" Request parameter has username as \" + userName);\r\n writer.println(\" Session parameter has username \" + (String) session.getAttribute(\"savedUserName\"));\r\n //out.println(\"Hello \" + userName);\r\n \r\n }", "private void userLogin(HttpServletRequest request, HttpServletResponse response) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tString homeUrl= \"http://localhost/upload/login.php\";\r\n\t\tString loginUrl= \"http://localhost/upload/login.php?\";\r\n\t\tString postData= \"forward=&jumpurl=http%3A%2F%2Flocalhost%2Fupload%2Fthread.php%3Ffid%3D10&step=2&lgt=0&pwuser=admin&pwpwd=admin&hideid=0&cktime=31536000\";\r\n\t\t//String ResponseByLogin= new CommonHandler().sendPost(loginUrl, postData);\r\n\t\tnew HttpRequestor().sendGet(homeUrl);\r\n\t\tSystem.out.println(new HttpRequestor().mycookie);\r\n\t\tnew HttpRequestor().sendPost(loginUrl, postData);\r\n\t\tSystem.out.println(\"==============================\");\r\n\t\tSystem.out.println(new HttpRequestor().mycookie);\r\n\t\t\r\n\r\n\t}", "@Override\n protected void doGet(HttpServletRequest req, HttpServletResponse resp)\n throws ServletException, IOException {\n resp.setContentType(\"text/html;charset=UTF-8\");\n out = resp.getWriter();\n mPrintWriter = out;\n\n String authString =\n req.getHeader(CommonParamString.PARAM_HEADER_USERNAME_PASSWORD);\n //Get the UserName and Password\n parseAuthString(authString);\n getAccountInfo(getUserName());\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n response.setContentType(\"text/html\");\n PrintWriter out = response.getWriter();\n \n HttpSession session=request.getSession();\n String remoteUser = request.getRemoteUser();\n \n if (remoteUser == null) {\n out.println(\"HTTP 401 Unauthorized\");\n session.invalidate();\n }\n \n \n }", "private void authorize(){\n\t\t\n\t\tURL authURL = null;\n\t\tURL homeURL = null;\n\t\tURLConnection homeCon = null;\n\t\t\n\t\tString loginPage = GG.GG_LOGIN+\"?ACCOUNT=\"+GG.GG_UID\n\t\t\t+\"&PASSWORD=\"+GG.GG_PASS;\n\t\tString cookieString = \"\";\n\t\tString cookieString1 = \"\";\n\t\t\n\t\ttry{\n\t\t\thomeURL = new URL(GG.GG_HOME);\n\t\t\thomeCon = homeURL.openConnection();\n\t\t\t\n\t\t\t// Look At the headers\n\t\t\tMap headerMap = homeCon.getHeaderFields();\n\t\t\t\n\t\t\t// Look for the Cookie\n\t\t\tif(headerMap.containsKey(\"Set-Cookie\")){\n\t\t\t\t\n\t\t\t\t// this gets the exact value of the header\n\t\t\t\t// otherwise gets some formatted string\n\t\t\t\tcookieString = homeCon.getHeaderField(\"Set-Cookie\");\n\t\t\t\t//log.finest(\"cookie1: \"+cookieString);\n\t\t\t\t\n\t\t\t\tauthURL = new URL(loginPage);\n\t\t\t\tHttpURLConnection.setFollowRedirects(false);\n\t\t\t\tHttpURLConnection loginCon = (HttpURLConnection) authURL.openConnection();\n\t\t\t\t\n\t\t\t\t// doOutput must be set before connecting\n\t\t\t\tloginCon.setAllowUserInteraction(true);\n\t\t\t\tloginCon.setUseCaches(false);\n\t\t\t\tloginCon.setDoOutput(true);\n\t\t\t\tloginCon.setRequestProperty(\"Cookie\", cookieString);\n\t\t\t\tloginCon.connect();\n\t\t\t\t\n\t\t\t\t// Look At the headers\n\t\t\t\tMap headerMap1 = loginCon.getHeaderFields();\n\t\t\t\t\n\t\t\t\tcookieString1 = loginCon.getHeaderField(\"Set-Cookie\");\n\t\t\t\t//log.finest(\"cookie2: \"+cookieString1);\n\t\t\t\tif(!Pattern.matches(\".*\\\\.\"+GG.GG_UID+\"\\\\.\\\\d+.*\", cookieString1)){\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tString location = loginCon.getHeaderField(\"Location\");\n\t\t\t\tURL gotURL = new URL(location);\n\t\t\t\tHttpURLConnection gotCon = (HttpURLConnection) gotURL.openConnection();\n\t\t\t\t// doOutput must be set before connecting\n\t\t\t\tgotCon.setAllowUserInteraction(true);\n\t\t\t\tgotCon.setUseCaches(false);\n\t\t\t\tgotCon.setDoOutput(true);\n\t\t\t\tgotCon.setRequestProperty(\"Cookie\", cookieString);\n\t\t\t\tgotCon.setRequestProperty(\"Cookie\", cookieString1);\n\t\t\t\t\n\t\t\t\tgotCon.connect();\n\t\t\t\t\n\t\t\t\t// Got the Cookies\n\t\t\t\tcookies[0] = cookieString;\n\t\t\t\tcookies[1] = cookieString1;\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\tlog.info(\"Unable to find the Cookie\");\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\t\t\n\t\tauthorized = true;\n\t}", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n String login = req.getParameter(\"login\");\n String password = req.getParameter(\"password\");\n if (logic.isExisting(login, password)) {\n HttpSession session = req.getSession();\n session.setAttribute(\"login\", login);\n if (logic.isAdmin(login)) {\n session.setAttribute(\"role\", \"admin\");\n }\n resp.sendRedirect(String.format(\"%s/\", req.getContextPath()));\n } else {\n req.setAttribute(\"error\", \"Credentional is invalid\");\n doGet(req, resp);\n }\n }", "public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {\n\n\t\tresponse.setContentType(\"text/html\");\n\t\tCookie loginCookie = null;\n\t\tCookie[] cookies = request.getCookies();\n\t\tif (cookies != null) {\n\t\t\tfor (Cookie cookie : cookies) {\n\t\t\t\tif (cookie.getName().equals(\"uname\")|| cookie.getName().equals(\"JSESSIONID\")) {\n\t\t\t\t\tcookie.setMaxAge(0);\n\t\t\t\t\tcookie.setValue(null);\n\t\t\t\t\tresponse.addCookie(cookie);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n//\n//\t\tif (loginCookie != null) {\n//\t\t\tloginCookie.setMaxAge(0);\n//\t\t\tresponse.addCookie(loginCookie);\n//\t\t}\n\t\tHttpSession session = request.getSession(false);\n// \tSystem.out.println(\"User=\"+session.getAttribute(\"name\"));\n \tif(session != null){\n \t\tsession.removeAttribute(\"name\");\n \t\tsession.invalidate();\n \t\tresponse.sendRedirect(\"index.jsp\");\n \t}\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t HttpSession session=request.getSession(); \n\t\tString username=request.getParameter(\"uname\");\n\t\t\n\t\tString password=request.getParameter(\"password\");\n\t\t\n\t\tString ip=request.getLocalAddr();\n\t\t\n\tSystem.out.println(\">>\"+username+\" \"+password+\" \"+ip);\n\t\n\tLoginService login=new LoginService();\n\tAdminLogin al=new AdminLogin();\n\tal.setName(username);\n\tal.setPassword(password);\n\tString resp=\"\";\n\ttry {\n\t\t resp=login.checkLogin(username,password,ip,session);\n\t}catch(Exception e) {\n\t\te.printStackTrace();\n\t}\n\tif(!resp.contains(\"NOK\")) {\n\t\t\n\t\t\n\t\tSystem.out.println(\"succefully login\");\n\t\t\n\t\tRandom rand = new Random(); \n\t\t \n \n session.setAttribute(\"uname\", username);\n int rand_int1 = rand.nextInt(1000);\n LinkedHashMap<String,Integer> lhm=new LinkedHashMap<String,Integer>();\n lhm.put(\"\"+rand_int1,rand_int1);\n System.out.println(lhm);\n //out.print(\"<a href='/CardDistributedSystem/test'>visit</a>\"); \n session.setAttribute(\"obj\", al);\n response.sendRedirect(\"/CardDistributedSystem/home.jsp\"); \n\t \n\t}\n\telse if(resp.contains(\"Invalid credentials\")) {\n\t\tSystem.out.println(\"not succefully login\");\n\t\trequest.setAttribute(\"StatusCode\",\"300\");\n\t\trequest.setAttribute(\"StatusMessage\",\"NOK\");\n\t\trequest.setAttribute(\"ErrorMessage\",\"Login with proper username and password!\");\n\t\trequest.getRequestDispatcher(\"index.jsp\").forward(request, response); \n\t}\n\telse {\n\t\tSystem.out.println(\"not succefully login\");\n\t\trequest.setAttribute(\"StatusCode\",\"300\");\n\t\trequest.setAttribute(\"StatusMessage\",\"NOK\");\n\t\trequest.setAttribute(\"ErrorMessage\",resp.split(\",\")[1]);\n\t\trequest.getRequestDispatcher(\"index.jsp\").forward(request, response); \n //response.sendRedirect(\"/CardDistributedSystem/index.jsp\"); \n\n\t}\n\t\t\n\n\t}", "private static void logedIn(Request req, Response res, CloudService cloud) {\r\n\t\t\tif (cloud.getKorisnici().get(req.cookie(\"userID\")) == null) {\r\n\t\t\t\tString[] params = req.splat();\r\n\t\t\t\tString path;\r\n\t\t\t\tif(params.length == 0)\r\n\t\t\t\t\tpath = \"\";\r\n\t\t\t\telse\r\n\t\t\t\t\tpath = params[0];\r\n\t\t\t\tif(path.equals(\"checkLogin\") || path.equals(\"favicon.ico\"))\r\n\t\t\t\t\treturn;\r\n\t\t\t\tres.redirect(\"/login.html\");\r\n\t\t\t\thalt(302);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif(req.session().attribute(\"user\") == null) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tKorisnik k = cloud.getKorisnici().get(req.cookie(\"userID\"));\r\n\t\t\t\t\treq.session().attribute(\"user\", k); // postavi mu korisnika za sesiju\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}", "public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tSystem.out.println(\"<<<<<<<<<<<<<<<<<<< LogOutProc 실행 >>>>>>>>>>>>>>>>>>>>>\");\n\n\t\t\n\t\tresponse.setHeader(\"Cache-Control\",\"no-store\"); \n\t\tresponse.setHeader(\"Pragma\",\"no-cache\"); \n\t\n\t\tString logout = \"success\";\n\t\tHttpSession session = request.getSession();\n\t\tsession.invalidate();\n\t\tSystem.out.println(\"<<<<<<<<<<<<<<<<<<< LogOutProc 완료 >>>>>>>>>>>>>>>>>>>>>\");\n\t\tresponse.sendRedirect(\"main.jsp?logout=\"+logout);\n\t\tSystem.out.println(\"main.jsp로 이동합니다....\\n\");\n\t}", "@Override\r\n public void getAllCookies()\r\n {\n\r\n }", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tif(req.getCookies()==null) {\n\t\t\treq.getRequestDispatcher(\"CookiesDisabled.html\").include(req, resp);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tint empId=Integer.parseInt(req.getParameter(\"id\"));\n\t\tString empPass=req.getParameter(\"password\");\n\t\tSession session=HibernateUtil.openSession();\n\t\tServletContext ctx=getServletContext();\n\t\tEmployeeInfoBean emp=session.get(EmployeeInfoBean.class,empId);\n\t\tPrintWriter out=resp.getWriter();\n\t\tRequestDispatcher dispatcher=null;\n\t\tif((emp==null)&&(emp.getPassword().equals(empPass))) {\n\t\t\t//valid credentials; create a session\n\t\t\tHttpSession httpSession=req.getSession(true);\n\t\t\t\n\t\t\tresp.sendRedirect(\"search.jsp\");\n\t\t\thttpSession.setAttribute(\"data\", emp);\n\t\t\thttpSession.setAttribute(\"eid\",empId);\n\t\t\t\n\t\t}else {\n\t\t\tString url=\"/loginFail?msg=Invalid Credentials!!! please try again\";\n\t\t\tdispatcher=req.getRequestDispatcher(url);\n\t\t\tdispatcher.forward(req,resp);\n\t\t\n\t\t}\n\t\t\n\t\tctx.setAttribute(\"Eid\", empId);\n\t\t\n\t\t\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\t_logger.debug(\"Page requested from IP: \" + req.getRemoteAddr());\n\n\t\tHttpSession session = req.getSession(false);\n\n\t\tif (session != null && session.getAttribute(Commons.ReqAttribs.LOGIN_ID) != null) {\n\t\t\treq.setAttribute(Commons.ReqAttribs.LOGIN_ID, session.getAttribute(Commons.ReqAttribs.LOGIN_ID));\n\t\t\treq.getRequestDispatcher(Commons.Redirect.Servlet.CHAT).forward(req, resp);\n\t\t\treturn;\n\t\t}\n\n\t\tCookie[] cookies = req.getCookies();\n\t\tif (cookies != null)\n\t\t\tfor (int i = 0; i < cookies.length; i++) {\n\t\t\t\tif (Commons.Cookies.AUTO_LOGIN.equals(cookies[i].getName())) {\n\t\t\t\t\treq.setAttribute(Commons.ReqAttribs.LOGIN_TOKEN, cookies[i].getValue());\n\t\t\t\t\treq.getRequestDispatcher(Commons.Redirect.Servlet.LOGIN).forward(req, resp);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\treq.getRequestDispatcher(Commons.Redirect.Page.LOGIN_PAGE).forward(req, resp);\n\t}", "@Override\n public void onAuthenticationSuccess(HttpServletRequest httpServletRequest,\n HttpServletResponse httpServletResponse,\n Authentication authentication)\n throws IOException, ServletException {\n HttpSession httpSession = httpServletRequest.getSession();\n httpSession.setMaxInactiveInterval(50000);\n\n\n\n\n System.out.println(\"Jab Ban: \" + httpServletRequest.getSession().getAttribute(\"EHAN_REDIRECT_URI\"));\n\n\n String redirectURI = (String) httpServletRequest.getSession().getAttribute(\"EHAN_REDIRECT_URI\");\n\n if (redirectURI == null)\n redirectURI = \"/\";\n\n\n for (GrantedAuthority grantedAuthority:\n authentication.getAuthorities()) {\n\n System.out.println(grantedAuthority.getAuthority());\n\n System.out.println(\"==============getDetails================\");\n System.out.println(authentication.getDetails());\n System.out.println(\"==============getPrincipal================\");\n System.out.println(authentication.getPrincipal());\n System.out.println(\"==============getCredentials================\");\n System.out.println(authentication.getCredentials());\n System.out.println(\"===============getAuthorities===============\");\n System.out.println(authentication.getAuthorities());\n System.out.println(\"===============getName===============\");\n System.out.println(authentication.getName());\n\n\n if (grantedAuthority.getAuthority().equals(\"ROLE_ADMIN\")) {\n redirectURI = \"/admin\";\n break;\n }\n else if (grantedAuthority.getAuthority().equals(\"ROLE_DBA\")) {\n redirectURI = \"/dba\";\n break;\n }\n else if (grantedAuthority.getAuthority().equals(\"ROLE_USER\")) {\n redirectURI = \"/user\";\n break;\n }\n \n }\n\n httpServletResponse.sendRedirect(redirectURI);\n\n }", "@Override\r\n protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n HttpSession session = req.getSession(true);\r\n //get session creation time\r\n Date createTime = new Date(session.getCreationTime());\r\n //get last access time of this web page \r\n Date lastAccessTime = new Date(session.getLastAccessedTime());\r\n\r\n String title = \"Welcome back to my website\";\r\n Integer visitCount = new Integer(0);\r\n String VistCountKey = new String(\"visitCount\");\r\n String userIDKey = new String(\"userID\");\r\n String userID = new String(\"ABCD\");\r\n //check if this is new comer on your web page \r\n if (session.isNew()) {\r\n title = \"welcoem to my website\";\r\n \r\n //set key and value like Cookie(key, value)\r\n session.setAttribute(userIDKey, userID);\r\n } else {\r\n visitCount = (Integer) session.getAttribute(VistCountKey);\r\n visitCount = visitCount + 1;\r\n userID = (String) session.getAttribute(userIDKey);\r\n }\r\n session.setAttribute(VistCountKey, visitCount);\r\n\r\n resp.setContentType(\"text/html\");\r\n PrintWriter out = resp.getWriter();\r\n out.println(\"<!DOCTYPE html>\");\r\n out.println(\"<html>\");\r\n out.println(\"<head>\"\r\n + \"<link href=\\\"resource/css/bootstrap.css\\\" rel=\\\"stylesheet\\\">\");\r\n out.println(\"<title>\" + title + \"</title>\");\r\n out.println(\"</head>\");\r\n out.println(\"<body>\");\r\n out.println(\"<h1 align = \\\"center\\\" >\" + title + \"</h1>\\n\");\r\n out.println(\"<h2 align = \\\"center\\\" > Session Information </h2>\\n\");\r\n out.println(\"<table align =\\\"center\\\" class=\\\"table table-bordered table-hover\\\">\\n\"\r\n + \"<tr>\"\r\n + \"<th>Session Info</th><th>value</th></tr>\\n\"\r\n + \"</tr>\\n\"\r\n + \"<tr>\\n\"\r\n + \"<td>id</td>\"\r\n + \"<td>\" + session.getId() + \"</td>\"\r\n + \"</tr>\\n\"\r\n + \"<tr>\\n\"\r\n + \"<td>Creation time</td>\"\r\n + \"<td>\" + createTime + \"</td>\"\r\n + \"</tr>\\n\"\r\n + \"<tr>\\n\"\r\n + \"<td>Time of last access</td>\"\r\n + \"<td>\" + lastAccessTime + \"</td>\"\r\n + \"</tr>\\n\"\r\n + \"<tr>\\n\"\r\n + \"<td>ID</td>\"\r\n + \"<td>\" + userID + \"</td>\"\r\n + \"</tr>\\n\"\r\n + \"<tr>\\n\"\r\n + \"<td>Number of visits</td>\"\r\n + \"<td>\" + visitCount + \"</td>\"\r\n + \"</tr>\\n\"\r\n + \"</tbale>\");\r\n out.println(\"<body>\");\r\n out.println(\"</body>\");\r\n out.println(\"</html>\");\r\n }", "@Override\n\tpublic void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)\n\t\t\tthrows IOException, ServletException {\n\t\tHttpServletRequest req=(HttpServletRequest) request;\n\t\tHttpServletResponse resp=(HttpServletResponse) response;\n\t\tCookie[] Cookies=req.getCookies();\n\t\t//System.out.println(\"jump\");\n\t\t\tboolean name=false;\n\t\t\tboolean pass=false;\n\t\t\tif(Cookies!=null){\n\t\t\tfor(Cookie c:Cookies){\n\t\t\t\tif(c.getName().equals(\"name\")){\n\t\t\t\t\tif(c.getValue().equals(\"user\")){\n\t\t\t\t\t\tname=true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(Cookie c:Cookies){\n\t\t\t\tif(c.getName().equals(\"pass\")){\n\t\t\t\t\tif(c.getValue().equals(\"pass\")){\n\t\t\t\t\t\tpass=true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t}\n\t\t\tif(name&&pass){\n\t\t\t resp.sendRedirect(\"autosuccess.html\");\n\t\t }\n\t\t\t\n\t\t System.out.println(\"not\");\n\t\t chain.doFilter(request, response);\n\t\t //req.getRequestDispatcher(\"autologin.html\").forward(request, response);\n\t\t\t\n\t}", "@Override\r\n\tprotected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tString uri = req.getRequestURI();\r\n\t\tString action = uri.substring(uri.lastIndexOf('/') + 1);\r\n\t\tsession = req.getSession();\r\n\t\tpath = req.getContextPath();\r\n\t\tpw = resp.getWriter();\r\n\t\tSystem.out.println(uri);\r\n\t\tswitch (action) {\r\n\t\tcase \"check\":\r\n\t\t\ttry {\r\n\t\t\t\tthis.checkAction(req,resp);\r\n\t\t\t} catch (SQLException 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\tbreak;\r\n\t\tcase \"index\":\r\n\t\t\tthis.checkSessionAction(req,resp);\r\n\t\t\tbreak;\r\n\t\tcase \"logout\":\r\n\t\t\tthis.logoutAction(req,resp);\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\r\n\t\t}\r\n\t\treturn;\r\n\t}", "private static void cookieMonster (HTTPRequest request)\n\t{\n\t /*if (!request.isCookiesParsed ())\n\t {\n\t \t retVal = request.cookieMonster ();\n\t }*/\n\t \n\t}", "@Override\n public void addCookie(Cookie arg0) {\n\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n doGet(request, response);\n HttpSession session = request.getSession(true);\n String name=\"User\";\n Usuario user= new Usuario(request.getParameter(\"name\"),request.getParameter(\"email\"),request.getParameter(\"password\"));\n session.setAttribute(name, user);\n Cookie idsession= new Cookie(\"idsession\",session.getId());\n response.addCookie(idsession);\n \n \n \n PrintWriter out=response.getWriter();\n \n out.println(\"<html>\");\n out.println(\"<head>\");\n out.println(\"<title>Registro</title>\");\n out.println(\"<meta charset='UTF-8'>\");\n out.println(\"<meta name='viewport' content='width=device-width, initial-scale=1.0'>\");\n out.println(\"<link href='css.css' rel='stylesheet' type='text/css'/>\");\n out.println(\"</head>\");\n out.println(\"<body>\");\n out.println(\"<div>\");\n out.println(\"<a href='login.html'>Ir a login</a>\");\n out.println(\"</div>\");\n out.println(\"</body>\");\n out.println(\"</html>\");\n \n \n }", "public void part2(){\n Cookie c1 = new Cookie(\"uid\", \"2018\", 1800,false);\n Cookie c2 = new Cookie(\"PICK_KEY\", \"ahmd13ldsws8cw\",10800,true);\n Cookie c3 = new Cookie(\"REMEMBER_ME\",\"true\",10800,true);\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n\r\n //LEER INSTRUCCIÓN QUE LLEGA DESDE JSP \r\n String instruccion = request.getParameter(\"instruccion\");\r\n\r\n //EJECUTAR LOGIN SI LA INSTRUCCIÓN ADD ES NULL\r\n if (instruccion == null) {\r\n instruccion = \"cargalogin\";\r\n }\r\n\r\n System.out.println(\"INSTRUCCION : \" + instruccion);\r\n //SELECTOR DE EJECUCIÓN\r\n\r\n switch (instruccion) {\r\n case \"cargalogin\":\r\n cargaVistaLogin(request, response);\r\n break;\r\n case \"credenciales\":\r\n \r\n System.out.println(\"ENTRA EN INSTRUCCION LOGIN USER\");\r\n {\r\n try {\r\n login(request,response);\r\n } catch (SQLException ex) {\r\n Logger.getLogger(ControllerLogin.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }\r\n break;\r\n default:\r\n cargaVistaLogin(request, response);\r\n }\r\n\r\n if (instruccion == \"loginUser\") {\r\n try {\r\n login(request, response);\r\n } catch (SQLException ex) {\r\n Logger.getLogger(ControllerLogin.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }\r\n\r\n }", "public final void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {\n\t\n\t// if false will not create new cookie\n\t// HttpSession session = request.getSession(false);\n\t// session stores in cookies or in response.encodeURL in the form action\n\n\t// cookie in localhost name is Cookie: (name/value) JSESSIONID=79648B6603709388645FDF61F374469C\n\t// get value from firefox or w3m M-k\n\n\t// in tomcat/logs will view the log data \n\t//context.log(\"ahmad session id is = \"+ session.getId());\n\n\tresponse.setContentType(\"text/html\");\n\tPrintWriter out = response.getWriter();\n\n\tHttpSession session = request.getSession(false);// true default\n\t////////\tHttpSession session = request.getSession(false);\n\tString name = \"ali\";\n\n\t// because the session always not null, so i need to check something is null or not\n\t//\tString myName=(String) session.getAttribute(\"name\");\n\t///////\t if (session == null) {\n\t if (session==null) {\n\t out.println(\" session attribue is new , so new user \");\t \n \t session = request.getSession(true);\n \t } else {\n\t out.println(\"old session ,so welcome back user \");\t \n\t }\n\t session.setAttribute(\"name\",name);\n\n\t// if ((session.isNew())) {\n\t// //\tif ((session == null)) {\n\t// //\tif ((getName == null)) {\n // //\tout.println(\" session is new, welcome \");\n\t// out.println(\" session == new \");\n\t// //\tout.println(\" session == null \");\n\t// }else {\n\t// session.setAttribute(\"name\",name);\n\t// //\tgetName =(String) session.getAttribute(\"name\");\n\t// String getName =(String) session.getAttribute(\"name\");\n\t// out.println(\" session scope attribute = \"+ getName +\" <br/>\");\n\t// out.println(\" test session \"+ session.getId()+\" <br/>\");\n\t// out.println(\" <br/> ============ <br/>\" );\n\t// out.println(\" int x = \"+ (x++));\n\t// }\n\n\n\n\t// work only if the cookies are disabled\n // out.println(response.encodeURL(\"hi\"));\n\t out.println(\" <br/> ========== <br/> \");\n\t out.println(response.encodeURL(\"encodeURL\")); //\n\t out.println(\" <br/> ========== <br/> \");\n\t //\t out.println(response.encodeRedirectURL(\"encodeRedirectURL\"));\n\t out.println(\"<a href=\"+ response.encodeURL(\"http://www.sosox2.com\") +\">click me1</a>\");\n\t out.println(\"<a href=\"+ response.encodeRedirectURL(\"http://www.sosox2.com\") +\">click me2</a>\");\n\t response.sendRedirect(\"/aaa/bbb\");\n\t response.encodeRedirectURL(\"aaa/bbb\");\n }", "private String getAppCookieValue(HttpServletRequest request) {\n Cookie[] cookies = request.getCookies();\n if (cookies != null) {\n for (Cookie cookie : cookies) {\n if(cookie.getName().equals(\"costsManager\"))\n return cookie.getValue();\n }\n }\n return \"\";\n }", "@Override\n\tpublic void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tboolean isAuthenticated = false;\n\t\tString userName = request.getParameter(\"user\");\n\t\tString password = request.getParameter(\"password\");\n\t\tisAuthenticated = (userName .equals( \"demo\") && password .equals( \"demo\"));\n\n\t\t/**\n\t\t * If authentication succeeds, redirect to user page servlet\n\t\t */\n\t\tif (isAuthenticated) {\n\t\t\t/**\n\t\t\t * Create a new session each time user login successfully a secure page\n\t\t\t */\n\t\t\tHttpSession session = ((HttpServletRequest)request).getSession(true);\n\t\t\tsession.setMaxInactiveInterval(20);\n\t\t\tSystem.out.println(session.getId() + \" \" + session.isNew() + \" \" + session.getCreationTime() + \" \" + session.getLastAccessedTime() + \" \" + session.getMaxInactiveInterval());\n\n\t\t\tCookie authCookie = new Cookie(\"user\", userName);\n\t\t\tauthCookie.setMaxAge(cookie_expire_time);\n\t\t\tresponse.addCookie(authCookie);\n\t\t\ttry {\n\t\t\t\tsession.setAttribute(\"myname\", userName);\n\t\t\t}\n\t\t\tcatch(IllegalStateException ise) {\n\t\t\t\tise.printStackTrace();\n\t\t\t}\n\t\t\tresponse.sendRedirect(authenticated_redirect);\n\t\t\t//TODO: Redirect to the page user requested before forced to login\n\t\t}\n\t\telse {\n\t\t\trequest.getRequestDispatcher(noauthenticated_forward).forward(request, response);\n\t\t}\n\t}", "String setRememberToken(HttpServletRequest request, HttpServletResponse response, String password, int maxAge, String domain, String path);", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n String action = request.getParameter(\"action\");\n String email=request.getParameter(\"email\");\n String password=request.getParameter(\"password\");\n HttpSession session = request.getSession();\n \n AccountService as = new AccountService();\n User user = as.login(email, password);\n String message=\"\";\n if (email.isEmpty() || email==null || password.isEmpty() || password == null){\n message=\"empty\";\n session.setAttribute(\"message\",message);\n response.sendRedirect(\"login\");\n return;\n }\n \n if (action!= null){\n session.setAttribute(\"email\", email);\n switch(action)\n {\n case \"signin\":\n if (user==null){\n message = \"notfound\";\n session.setAttribute(\"message\", message);\n response.sendRedirect(\"login\");\n return;\n }\n\n else if (user.getActive()){\n session.setAttribute(\"user\",user);\n if (user.getRole().getRoleId()==1){ \n response.sendRedirect(\"admin\");\n return;\n }\n else {\n response.sendRedirect(\"inventory\"); \n return;\n }\n }\n else{\n message=\"inactive\";\n session.setAttribute(\"message\", message);\n response.sendRedirect(\"login\");\n return;\n }\n \n case \"register\":\n response.sendRedirect(\"registration\");\n return;\n }\n }\n \n getServletContext().getRequestDispatcher(\"/WEB-INF/login.jsp\").\n forward(request, response); \n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n boolean logado =Boolean.parseBoolean(request.getParameter(\"logado\")); \n request.setAttribute(\"logado\", logado);\n request.setAttribute(\"id\", Integer.parseInt(request.getParameter(\"id\")));\n processRequest(request, response);\n }", "@Override\n public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n if (request.getParameter(\"loginAttempt\") != null) {\n PrintWriter out = response.getWriter();\n //Check to see there is a username and password in case of corruption.\n if (request.getParameter(\"username\") != null && request.getParameter(\"password\") != null) {\n //Grab each\n String username = request.getParameter(\"username\");\n String password = request.getParameter(\"password\");\n\n try {\n //Always assume the worst.\n boolean exists = false;\n //Check to see if the user is valid\n String sql = \"SELECT * FROM admin\";\n String userName = username;\n PreparedStatement stmt = conn.prepareStatement(sql);\n\n rs = stmt.executeQuery();\n //Execute the query.\n while (rs.next()) {\n //Compare the username and password input to the database version.\n if (BCrypt.checkpw(password, rs.getString(\"password\")) && BCrypt.checkpw(userName, rs.getString(\"username\"))) {\n //There is a user!\n exists = true;\n \n }\n }\n //user is validated here\n if (exists == true) {\n //Create a key for the user to gain permission to index.jsp\n Cookie validateAdmin = new Cookie(\"validated\", \"true\");\n //Logs out after one hour.\n //This is just an autolog out feature. The user only needs to shut the window and it'll log itself out\n validateAdmin.setMaxAge(60 * 60 * 1);\n //Add the cookie\n response.addCookie(validateAdmin);\n //Send the user to index.jsp\n /*\n NOTE: If the server does not use virtual hosts or SSL you only need request.getContextPath()\n for some odd reason if you are using VH's and SSL you need request.getContextPath() + \"/\"\n + request.getContextPath()\n */\n response.sendRedirect(request.getContextPath());\n\n //If the user is not valid, send them an error page.\n } else {\n String logonTable = \"<html>\\n\"\n + \" <head>\\n\"\n + \" <title>Log into Admin Portal</title>\\n\"\n + \" <meta charset=\\\"UTF-8\\\">\\n\"\n + \" <meta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1.0\\\">\\n\"\n + \" <link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"css/loginStyle.css\\\" />\\n\"\n + \" </head>\\n\"\n + \" <body>\\n\"\n + \" <h1> Administrator Log In</h1>\\n\"\n + \" <h1> Bad password!</h1>\\n\"\n + \" <div class='left'></div>\\n\"\n + \" <div class='right'></div>\\n\"\n + \" <div class=\\\"SignIn fadeInRight\\\">\\n\"\n + \"\\n\"\n + \" <form action='LoginAdmin' method='POST'>\\n\"\n + \" <h2 style='padding-left: 175px;'> name</h2> \\n\"\n + \" <label>\\n\"\n + \" <input type='text' name='username'/>\\n\"\n + \" </label>\\n\"\n + \" <br>\\n\"\n + \" <h2 style='padding-left: 160px;'>password</h2> \\n\"\n + \" <label>\\n\"\n + \" <input type='password' name='password'/> \\n\"\n + \" </label>\\n\"\n + \" <label>\\n\"\n + \" <input type='hidden' name='loginAttempt' value ='loginAttempt'/>\\n\"\n + \" </label>\\n\"\n + \" <br><br>\\n\"\n + \" <div class='submit'>\\n\"\n + \" <input type='submit' />\\n\"\n + \" </div>\\n\"\n + \"\\n\"\n + \" </form>\\n\"\n + \" </div>\\n\"\n + \"\\n\"\n + \"\\n\"\n + \" </body>\\n\"\n + \"</html>\";\n out.println(logonTable);\n }\n } catch (SQLException ex) {\n Logger.getLogger(Login.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n //If there no parameters something weird happened, send them to doGet to resolve it.\n } else {\n doGet(request, response);\n }\n }", "private void logout(HttpServletRequest request, HttpServletResponse response) throws IOException {\n\tCookie[] theCookieLoop=request.getCookies();\n\t\t\tif(theCookieLoop !=null) {\n\t\t\t\tfor(Cookie tempCookie:theCookieLoop) {\n\t\t\t\t\tif(\"checkLoginPageAdmin\".equals(tempCookie.getName())) {\n\t\t\t\t\t\ttempCookie.setValue(\"false\");\n\t\t\t\t\t\tresponse.addCookie(tempCookie);\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\tresponse.sendRedirect(\"admin/loginPageAdmin.jsp\");\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\n\t\tString uname = request.getParameter(\"unamelog\");\n\t\tString pwd = request.getParameter(\"pwdlog\");\n\t\t\n\t\tif(uname==null||pwd==null) {\n\t\t\tloginFailure(request,response);\n\t\t\treturn;\n\t\t}\n\t\ttry(Connection con = dbRes.getConnection();\n\t\t\tPreparedStatement ps = con.prepareStatement(\"SELECT * FROM USERS WHERE USERNAME=? OR EMAIL=?\");){\n\t\t\tps.setString(1,uname);\n\t\t\tps.setString(2,uname);\n\t\t\ttry(ResultSet rs = ps.executeQuery();){\n\t\t\t\tif(rs.next()){\n\t\t\t\t\tif(BCrypt.checkpw(pwd, rs.getString(\"PWD_HASH\"))) {\n\t\t\t\t\t\trequest.getSession().setAttribute(\"user_id\", rs.getInt(\"USER_ID\"));\n\t\t\t\t\t\tif(rs.getString(\"HOTP_SERIAL\")!=null) {\n\t\t\t\t\t\t\tgetServletContext().getRequestDispatcher(\"/twoFA.jsp\").forward(request, response);;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\trequest.getSession().setAttribute(\"logged\", true);\n\t\t\t\t\t\t//request.setAttribute(\"message\",\"Succes\");\n\t\t\t\t\t\t//getServletContext().getRequestDispatcher(\"index.jsp\").forward(request, response);\n\t\t\t\t\t\t\tgetServletContext().getRequestDispatcher(\"/transactions\").forward(request, response);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//TO DO Forward to dashboard page\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tloginFailure(request,response);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tloginFailure(request,response);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tresponse.getWriter().append(e.getMessage());\t\t}\n\t}", "public void handlePost( HttpExchange exchange ) throws IOException {\n switch( exchange.getRequestURI().toString().replace(\"%20\", \" \") ) {\n // the web client wants to submit a log in request\n case \"/log-in\":\n // get the body of the HttpExchange\n String body = getBody(exchange);\n print(\"BODY: \\n\" + body);\n if ( body.equals(\"-1\") == true) { // if the body is empty\n sendResponse(exchange, new byte[0], 204);\n // HTTP Response code 204 - no content\n } else {\n\n String[] content = body.split(\"&\");\n //pos 0 : username=<content>; pos 1 : password=<content>; pos 2 : <submit type>\n\n String username = content[0].split(\"=\")[1];\n String password = content[1].split(\"=\")[1];\n\n //check database\n if( username.equals(\"james\") && password.equals(\"123\")) {\n print(\"Username and Password Match\");\n sendResponse(exchange, getHTMLPage(\"/home.html\"), 200); // this will be changed to a redirect notice\n // set client as logged in\n logged_in = true;\n\n// sendResponse(exchange, getPanel(exchange, \"home.html\"), 200);\n } else {\n sendResponse(exchange, new byte[0], 406);\n // send HTTP Response code 406 - Not acceptable\n }\n }\n\n break;\n case \"/home\":\n\n default:\n print(\"Body:\");\n print( getBody(exchange) );\n sendResponse(exchange, htmlBuilder( \"Not Implemented\", \"Http Error 501: Not Implemented\").getBytes(), 501);\n break;\n }\n // got body response .. check form sending to - if form is login then get username and password combo\n }", "@Override\n public void endRequest(HttpServletResponse httpServletResponse) {\n if (wasModified.get()) {\n Cookie newCookie = new Cookie(COOKIE_NAME, sessionId.get());\n newCookie.setPath(\"/\");\n httpServletResponse.addCookie(newCookie);\n }\n\n // -- Clear the threadlocals since we are now exiting this session --\n wasModified.remove();\n sessionId.remove();\n }", "@Override\n\t\t\t\t\tpublic void commence(HttpServletRequest request, HttpServletResponse response,\n\t\t\t\t\t\t\torg.springframework.security.core.AuthenticationException authException)\n\t\t\t\t\t\t\tthrows IOException, ServletException {\n\t\t\t\t\t\tresponse.setCharacterEncoding(\"UTF-8\");\n\t\t\t\t\t\tresponse.setContentType(\"application/json\");\n\t\t\t\t\t\tresponse.getWriter()\n\t\t\t\t\t\t\t\t.println(new ObjectMapper().createObjectNode().put(\"msg\", \"请先登录!\").toString());\n\t\t\t\t\t\tresponse.getWriter().flush();\n\t\t\t\t\t\tresponse.getWriter().close();\n\t\t\t\t\t}", "public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException \n\t{\n\t\tString username=request.getParameter(\"username\");\n\t\tString password=request.getParameter(\"password\");\n\t\tString SQL=\"select * from DS_user where username='\"+username+\"';\";\n\t\tUser temp=new User();\n\t\ttemp=DataBaseUtils.queryForBean(SQL,User.class);\n\t\tJSONObject obj=new JSONObject();\n\t\tPrintWriter pw=response.getWriter();\n\t\tif(temp==null) {\n\t\t\ttry {\n\t\t\t\tobj.put(\"message\", 0);\n\t\t\t} catch (JSONException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t//seesion.setAttribute(\"The user is not exits\",message);\n\t\t}\n\t\telse \n\t\t{\n\t\t\tif(!username.equals(temp.getUsername())||!password.equals(temp.getPassword())) \n\t\t\t{\n\t\t\t\tSystem.out.println(\"Username or password is not match\");\n\t\t\t\ttry {\n\t\t\t\t\tobj.put(\"message\", 1);\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\t//request.setAttribute(\"message\",\"Username or password is not match\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//Saving cookies\n\t\t\t\tHttpSession session=request.getSession();\n\t\t\t\tsession.setAttribute(\"userbean\", temp);\n\t\t\t\t\n\t\t\t\tif(temp.getIsAdmin().equals(\"yes\")) \n\t\t\t\t{\n\t\t\t\t\ttry {\n\t\t\t\t\t\tobj.put(\"message\", 2);\n\t\t\t\t\t} catch (JSONException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\t//request.getRequestDispatcher(\"/servlet/ListUserService\").forward(request, response);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttry {\n\t\t\t\t\t\tobj.put(\"message\", 3);\n\t\t\t\t\t} catch (JSONException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\t//request.getRequestDispatcher(\"/servlet/ListExperimentService\").forward(request, response);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tpw.println(obj);\n\t\tpw.close();\n\t\t\n\t}", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n try (PrintWriter out = response.getWriter()) {\n\n HttpSession session = request.getSession(); //create session\n String userid = request.getParameter(\"userid\"); //get user input\n String passwordinput = request.getParameter(\"passwordinput\");\n \n Cookie cookie = new Cookie(\"userid\",userid); //add cookie\n cookie.setMaxAge(20*60); //cookie age is (number) * 60 seconds\n response.addCookie(cookie); //send cookie to client\n \n User userInput = new User(); //new user object\n userInput.setID(userid); //set user ID to User object\n userInput.setPassword(passwordinput); //set user password to User object\n \n LoginDao loginDao = new LoginDao(); //new login DAO \n String loginDaoReturn = loginDao.authenticateUser(userInput); //authenticate user\n\n MemberDAO member = new MemberDAO();\n\n PaymentDAO payments = new PaymentDAO();\n ClaimDAO claims = new ClaimDAO();\n \n boolean isAdmin = false;\n isAdmin = (boolean) session.getAttribute(\"isAdmin\");\n\n \n if(loginDaoReturn.equals(\"SUCCESS\")){ //if password and username matches\n User user = (User)member.getSingleById(userid);\n session.setAttribute(\"user\", user); //set User object as session wide attribute\n session.setAttribute(\"paymentlist\", payments.getRecordsById(user));\n session.setAttribute(\"claimlist\", claims.getClaimsById(user));\n \n response.sendRedirect(\"dashboard.jsp\");\n } \n else if(isAdmin){ //if user is an Admin\n \n session.setAttribute(\"claimlist\", claims.getAllClaims());\n session.setAttribute(\"userlist\", member.getAllRecords());\n session.setAttribute(\"paymentlist\", payments.getAllRecords());\n \n //set the tab view upon return\n session.setAttribute(\"home\", true);\n session.setAttribute(\"users\", false);\n session.setAttribute(\"claims\", false);\n session.setAttribute(\"search\", false);\n response.sendRedirect(\"admin/dashboard.jsp\");\n } \n else \n {\n session.setAttribute(\"error\", \"It appears that the username and password is wrong. Try again.\"); //set error message to be sent to index.jsp\n response.sendRedirect(\"/UWE_ESD\"); //redirect back to main page\n }\n }\n }", "@Test\n\t //Extracting a string from the response\n\t public void getBasicAuthTestResultCookies() {\n\t Cookies cookies = given ()\n\t \t.spec(requestSpec)\n\t .when()\n\t .get (\"/maps/api/place/textsearch/json\")\n\t .detailedCookies();\n\t System.out.println(\"Cookies\"+cookies.size());\n\t System.out.println(\"CookiesList\"+cookies.getList(\"cookie1\").size());\n\t //System.out.println(\"Cookies\"+cookies.values().toString());\n\t //Assert.assertEquals(statusCode.toString(), \"200\");\n\t }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tresp.setContentType(\"text/html\");\n\t\tPrintWriter out = resp.getWriter();\n\t\t\n\t\tString username = req.getParameter(\"user\");\n\t\tString password = req.getParameter(\"pass\");\n\t\t\n\t\tif(username.equals(\"admin\") && password.equals(\"123\")) {\n\t\t\tout.println(\"Xin chào: \"+ username);\n\t\t}else {\n\t\t\tout.println(\"Vui lòng đăng nhập lại\");\n\t\t}\n\t\tout.close();\n\t}", "public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{\r\n\t\t//cookie variables\r\n\t\tString userName = null;\r\n\t\tString language = null;\r\n\r\n\t\t/****************** COOKIE LOGIC ****************/\r\n\r\n\t\t//get the cookie list\r\n\t\tCookie[] cookies = request.getCookies();\r\n\r\n\t\t//if there are cookies then set userName and language to the cookie values if they exist\r\n\t\tif (cookies != null) {\r\n\t\t\tfor (Cookie cookie : cookies) {\r\n\t\t\t\tif (cookie.getName().equals(\"username\"))\r\n\t\t\t\t\tuserName = cookie.getValue();\r\n\t\t\t\telse if (cookie.getName().equals(\"language\"))\r\n\t\t\t\t\tlanguage = cookie.getValue();\r\n\t\t\t}\r\n\t\t}\r\n\t\t//if there is no cookies and the language has not been set then create the cookie with English as default language\r\n\t\tif(language == null) {\r\n\t\t\tCookie cookieLanguage = new Cookie(\"language\", \"en\");\r\n\t\t\tcookieLanguage.setMaxAge(60 * 60 * 60 * 30);\r\n\t\t\tresponse.addCookie(cookieLanguage);\r\n\t\t}\r\n\t\telse {\r\n\r\n\t\t\t//get the current website language\r\n\t\t\tlanguage = request.getParameter(\"language\");\r\n\t\t\t//get all the cookies on the website\r\n\t\t\tCookie[] theCookies = request.getCookies();\r\n\r\n\t\t\t//loop through the cookies and look for the language cookie\r\n\t\t\tfor (Cookie tempCookie : theCookies) {\r\n\t\t\t\tif (\"language\".equals(tempCookie.getName())) {\r\n\t\t\t\t\t//if the language cookie exists then update the language with the websites language if it exists\r\n\t\t\t\t\tif (language != null)\r\n\t\t\t\t\t\ttempCookie.setValue(language);\r\n\t\t\t\t\t//add the cookie back to the response headers\r\n\t\t\t\t\tresponse.addCookie(tempCookie);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tresponse.setContentType(\"text/html\");\r\n\r\n\t\t\t//gets any servlet error exceptions\r\n\t\t\tThrowable throwable = (Throwable) request.getAttribute(\"javax.servlet.error.exception\");\r\n\t\t\t//gets the http status code to be displayed on the website\r\n\t\t\tInteger statusCode = (Integer) request.getAttribute(\"javax.servlet.error.status_code\");\r\n\t\t\t//gets the servlet name where the error occurred\r\n\t\t\tString servletName = (String) request.getAttribute(\"javax.servlet.error.servlet_name\");\r\n\r\n\t\t\t//if servlet name is null set it to say Not Available\r\n\t\t\tif(servletName == null)\r\n\t\t\t\tservletName = \"Not Available\";\r\n\r\n\t\t\t//gets the page where the request happened (for 404 errors)\r\n\t\t\tString requestUri = (String) request.getAttribute(\"javax.servlet.error.request_uri\");\r\n\r\n\t\t\t//if 404 error (page not found) occurs then say page not found\r\n\t\t\tif(statusCode == 404) {\r\n\t\t\t\trequest.setAttribute(\"error\", \"The specified page: \" + requestUri + \" could not be found.\");\r\n\t\t\t\trequest.setAttribute(\"error_fr\", \"La page sp�cifi�e: \" + requestUri + \" ne peut �tre trouv�.\");\r\n\t\t\t}\r\n\t\t\t//if 405 error (method not supported) occurs then say the page does not support request method\r\n\t\t\telse if(statusCode == 405) {\r\n\t\t\t\trequest.setAttribute(\"error\", requestUri + \" does not support this request method.\");\r\n\t\t\t\trequest.setAttribute(\"error_fr\", requestUri + \" ne supporte pas cette m�thode de requ�te.\");\r\n\t\t\t}\r\n\t\t\t//if 500 (internal server error) then display the class and the message of the error\r\n\t\t\t//This will be changed when the website goes live to a generic error message\r\n\t\t\telse {\r\n\t\t\t\trequest.setAttribute(\"error\", servletName + \" has encountered error: \" + throwable.getClass().getName()\r\n\t\t\t\t\t\t+ \" with error message: \" + throwable.getMessage());\r\n\t\t\t\trequest.setAttribute(\"error_fr\", servletName + \" avec un message d'erreur: \" + throwable.getClass().getName()\r\n\t\t\t\t\t\t+ \" with error message: \" + throwable.getMessage());\r\n\t\t\t}\r\n\r\n\t\t\t// Set leagues for navbar\r\n\t\t\tList<LeagueBean> llb = new ArrayList<LeagueBean>();\r\n\t\t\tLeague.getAllLeagues(llb);\r\n\t\t\trequest.setAttribute(\"league\", llb);\r\n\r\n\t\t\t//set request attributes\r\n\t\t\trequest.setAttribute(\"errorcode\", statusCode);\r\n\t\t\trequest.setAttribute(\"userName\", userName);\r\n\t\t\t//redirect to the error page\r\n\t\t\tRequestDispatcher rd = request.getRequestDispatcher(\"/error.jsp\"); \r\n\t\t\trd.forward(request, response);\t\t\r\n\t\t}\r\n\t}", "Login.Req getLoginReq();", "private static void postLoginPage() {\n post(\"/login\", \"application/json\", (req, res) -> {\n HomerAccount loggedInAccount = homerAuth.login(req.body());\n if(loggedInAccount != null) {\n req.session().attribute(\"account\", loggedInAccount);\n res.redirect(\"/team\");\n } else {\n res.redirect(\"/login\");\n }\n return null;\n });\n }", "@Override\r\n\tprotected void doGet(HttpServletRequest request,\r\n\t\t\tHttpServletResponse response)\r\n\t\t\t\t\tthrows ServletException, IOException\r\n\t\t\t\t\t{\n\t\tHttpSession session = request.getSession(true);\r\n\r\n\t\tServletContext context = getServletContext();\r\n\r\n\t\tsession.setMaxInactiveInterval(60); // in seconds\r\n\r\n\t\t// Get session creation time.\r\n\t\tDate createTime = new Date(session.getCreationTime());\r\n\t\t// Get last access time of this web page.\r\n\t\tDate lastAccessTime = \r\n\t\t\t\tnew Date(session.getLastAccessedTime());\r\n\r\n\t\tString title =\"\";\r\n\t\tInteger visitCount = new Integer(0);\r\n\t\tInteger requestCount = new Integer(0);\r\n\t\tString visitCountKey = new String(\"visitCount\");\r\n\t\tString userIDKey = new String(\"userID\");\r\n\t\tString userID = new String(\"ABCD\");\r\n\r\n\t\t// Check if this is new comer on your web page.\r\n\t\tif (session.isNew()){\r\n\r\n\t\t\ttitle = \"Welcome to my website\";\r\n\t\t\tsession.setAttribute(userIDKey, userID);\r\n\r\n\t\t\trequestCount = (Integer)context.getAttribute(\"totalRequestServed\");\r\n\t\t\trequestCount = (requestCount != null ? requestCount : 0) + 1;\r\n\t\t\t//RequestDispatcher\r\n\t\t} else {\r\n\t\t\ttitle = \"You are in the same Session !!!\";\r\n\t\t\tvisitCount = (Integer)session.getAttribute(visitCountKey);\r\n\t\t\tvisitCount = (visitCount != null ? visitCount : 0) + 1;\r\n\t\t\tuserID = (String)session.getAttribute(userIDKey);\r\n\r\n\t\t\trequestCount = (Integer)context.getAttribute(\"totalRequestServed\");\r\n\t\t\trequestCount = (requestCount != null ? requestCount : 0) + 1;\r\n\r\n\r\n\t\t}\r\n\t\tsession.setAttribute(visitCountKey, visitCount); // 1\r\n\t\tcontext.setAttribute(\"totalRequestServed\", requestCount);\r\n\r\n\t\tString logoutRequest = request.getParameter(\"logout\");\r\n\t\tSystem.out.println(\"SessionServlet.doGet() logoutRequest :: \"+ logoutRequest);\r\n\r\n\t\tif(\"logout\".equals(logoutRequest)){\r\n\t\t\ttitle = \"Good Bye\";\r\n\t\t\tSystem.out.println(\"Logging Out\");\r\n\t\t\tsession.invalidate();\r\n\t\t\t//\t\t\tsession.removeAttribute(arg0);\r\n\t\t\t//\t\t\tcontext.removeAttribute(\"totalRequestServed\");\r\n\r\n\t\t\t//\t\t\tsession.setAttribute(visitCountKey, new Integer(0));\r\n\t\t\tvisitCount = new Integer(0);\r\n\t\t}\r\n\r\n\r\n\t\t// Set response content type\r\n\t\tresponse.setContentType(\"text/html\");\r\n\t\tPrintWriter out = response.getWriter();\r\n\r\n\t\tString docType =\r\n\t\t\t\t\"<!doctype html public \\\"-//w3c//dtd html 4.0 \" +\r\n\t\t\t\t\t\t\"transitional//en\\\">\\n\";\r\n\t\tString logout = \"<form action='SessionServlet' method='POST'> \" +\r\n\t\t\t\t\"<input type='submit' name ='logout' value='logout' /> \" +\r\n\t\t\t\t\"</form>\";\r\n\r\n\t\tout.println(docType +\r\n\t\t\t\t\"<html>\\n\" +\r\n\t\t\t\t\"<head><title>\" + title + \"</title></head>\\n\" +\r\n\t\t\t\t\"<body bgcolor=\\\"#f0f0f0\\\">\\n\" +\r\n\t\t\t\t\"<h1 align=\\\"center\\\">\" + title + \"</h1>\\n\" +\r\n\t\t\t\t\"<h2 align=\\\"center\\\">Session Infomation</h2>\\n\" +\r\n\t\t\t\t\"<table border=\\\"1\\\" align=\\\"center\\\">\\n\" +\r\n\t\t\t\t\"<tr bgcolor=\\\"#949494\\\">\\n\" +\r\n\t\t\t\t\" <th>Session info</th><th>value</th></tr>\\n\" +\r\n\t\t\t\t\"<tr>\\n\" +\r\n\t\t\t\t\" <td>id</td>\\n\" +\r\n\t\t\t\t\" <td>\" + session.getId() + \"</td></tr>\\n\" +\r\n\t\t\t\t\"<tr>\\n\" +\r\n\t\t\t\t\" <td>Creation Time</td>\\n\" +\r\n\t\t\t\t\" <td>\" + createTime + \r\n\t\t\t\t\" </td></tr>\\n\" +\r\n\t\t\t\t\"<tr>\\n\" +\r\n\t\t\t\t\" <td>Time of Last Access</td>\\n\" +\r\n\t\t\t\t\" <td>\" + lastAccessTime + \r\n\t\t\t\t\" </td></tr>\\n\" +\r\n\t\t\t\t\"<tr>\\n\" +\r\n\t\t\t\t\" <td>User ID</td>\\n\" +\r\n\t\t\t\t\" <td>\" + userID + \r\n\t\t\t\t\" </td></tr>\\n\" +\r\n\t\t\t\t\"<tr>\\n\" +\r\n\t\t\t\t\" <td>Number of visits</td>\\n\" +\r\n\t\t\t\t\" <td>\" + visitCount + \"</td></tr>\\n\" +\r\n\t\t\t\t\"<tr>\\n\" +\r\n\t\t\t\t\" <td>Total Request Served</td>\\n\" +\r\n\t\t\t\t\" <td>\" + requestCount + \"</td></tr>\\n\" +\r\n\t\t\t\t\"</table>\\n\" +\r\n\t\t\t\tlogout+\r\n\t\t\t\t\"</body></html>\");\r\n\t\t\t\t\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tString code = req.getParameter(\"code\");\n\t\t\n\t\t//temporary code\n\t\tif(code.equals(\"jpoweradm\")) {\n\t\t\treq.getSession().setAttribute(\"STATUS\", \"AUTHENTICATED\");\n\t\t\t//production\n\t\t\tresp.sendRedirect(\"/upload.jsp\");\n\t\t\t//testing development\n//\t\t\tresp.sendRedirect(\"/jpower/upload.jsp\");\n\t\t} else {\n\t\t\treq.getSession().setAttribute(\"ERROR\", \"invalid security code\");\n\t\t\t//production\n\t\t\tresp.sendRedirect(\"/admin.jsp\");\n\t\t\t//testing development\n//\t\t\tresp.sendRedirect(\"/jpower/admin.jsp\");\n\t\t}\n\t}", "public void logincredentials() {\n\t\tutil.entertext(prop.getValue(\"locators.text.uname\"), \"admin\");\n\t\tutil.entertext(prop.getValue(\"locators.text.password\"), \"Admin123\");\n\t\tutil.ClickElement(prop.getValue(\"locators.button.regdesk\"));\n\t\tutil.ClickElement(prop.getValue(\"locators.button.login\"));\n\t\tlogreport.info(\"logged into the application\");\n\n\t}", "HttpClientRequest addCookie(Cookie cookie);", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tresponse.setContentType(\"text/html\");\r\n\t\tusername=request.getParameter(\"username\");\r\n\t\tpass=request.getParameter(\"password\");\r\n\t\tRequestDispatcher rd=null;\r\n\t\t\r\n\t\tif (username!=\"\" && username!=null && pass!=\"\" && pass!=null ) {\r\n\t\t\tif (username.equals(\"jahid\") && pass.equals(\"12345\")) {\r\n\t\t\t\t \r\n\t\t\t\t request.setAttribute(\"username\",\"jahid\");\r\n\t\t\t\t rd=request.getRequestDispatcher(\"Dashboard\");\r\n\t\t\t rd.forward(request, response);\r\n\t\t\t \r\n\t\t\t} else {\r\n\t\t\t\t\r\n\t\t\t\trequest.setAttribute(\"status\",\"Wrong Credentials\");\r\n\t\t\t\trd=request.getRequestDispatcher(\"LoginFails\");\r\n\t\t\t\trd.include(request, response);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\trequest.setAttribute(\"status\",\"Empty Input Fields\");\r\n\t\t\trd=request.getRequestDispatcher(\"LoginFails\");\r\n\t\t\trd.include(request, response);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tString name = req.getParameter(\"uname\");\n\t\tString pass = req.getParameter(\"upass\");\n\t\tLoginService loginService = new LoginService();\n\t\tboolean result = loginService.authenticate(name, pass);\n\t\tif (result) {\n\t\t\tresp.sendRedirect(\"success.jsp\");\n\t\t\treturn;\n\t\t} else {\n\t\t\tresp.sendRedirect(\"login.jsp\");\n\t\t\treturn;\n\t\t}\n\t}", "void addCookie(HttpServletResponse response, Cookie cookie);", "@SuppressWarnings(\"unchecked\")\r\n\tpublic void doFilter(ServletRequest request, ServletResponse response,\r\n\t\t\tFilterChain chain) throws IOException, ServletException {\n\t\tHttpServletRequest req = (HttpServletRequest) request;\r\n\t\tHttpServletResponse res = (HttpServletResponse)response; \r\n\t\tString path = req.getServletPath();\r\n\t\tString paths = req.getContextPath();\r\n\t\tString basePath = req.getScheme()+\"://\"+req.getServerName()+\":\"+req.getServerPort()+paths;\r\n\t\t//System.out.println(\"-----:\"+path);\r\n\t\t//HttpSession session = req.getSession();\r\n\t\tHttpSession session = req.getSession(true);\r\n\t\tT t = (T)session.getAttribute(\"CURRENTUSER\");\r\n\t\tboolean b=true;\r\n\t\ttry {\r\n\t\t\tif(t != null && !checkEndFuffix(path) && !checkUrl(path,loginPage) && !checkUrl(path,loaginAction) && !checkUrl(path,authority)){\r\n\t\t\t\tSysContainer.set((Users)t);\r\n\t\t\t\tb = userAuthValueServiceImpl.validate(path,(Users)t);\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tif(b && (t != null || checkEndFuffix(path) || checkUrl(path,loginPage) || checkUrl(path,loaginAction))){\r\n\t\t\tchain.doFilter(request, response);\r\n\t\t\tSysContainer.romove();\r\n\t\t}else{\r\n\t\t\tif(t == null){\r\n\t\t\t\treq.getSession().invalidate();\r\n\t\t\t\tres.sendRedirect(basePath+loginPage);\r\n\t\t\t}else{\r\n\t\t\t\tresponse.setContentType(\"text/html\");\r\n\t\t\t\tresponse.setCharacterEncoding(\"UTF-8\");\r\n\t\t\t\tPrintWriter out = response.getWriter();\r\n\t\t\t\tout.print(\"NOPASS\");\r\n\t\t\t\tout.flush();\r\n\t\t\t\tout.close();\r\n\t\t\t}\r\n\t\t\t//out.println(\"<html><head></head>\");\r\n\t\t\t//out.println(\"<Script LANGUAGE='javascript'> alert('用户权限不足');</script>\");\r\n\t\t\t//out.println(\"</head>\");\r\n\t\t\t//out.println(\"<body>\");\r\n\t\t\t//out.println(\"</body></html>\");\t\r\n\t\t}\r\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n System.out.println(\"Console: doGET visited\");\n String result = \"\";\n //get the user choice from the client\n String choice = (request.getPathInfo()).substring(1);\n response.setContentType(\"text/plain;charset=UTF-8\");\n PrintWriter out = response.getWriter();\n //methods call appropriate to user calls\n if (Integer.valueOf(choice) == 3) {\n result = theBlockChain.toString();\n if (result != null) {\n out.println(result);\n response.setStatus(200);\n //set status if result output is not generated\n } else {\n response.setStatus(401);\n return;\n }\n }\n //verify chain method\n if (Integer.valueOf(choice) == 2) {\n response.setStatus(200);\n boolean validity = theBlockChain.isChainValid();\n out.print(\"verifying:\\nchain verification: \");\n out.println(validity);\n }\n }", "public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\tdoGet(request, response);\n\t\tresponse.setContentType(\"text/html;charset=utf-8\");\n\t\tString name = request.getParameter(\"username\").trim();\n\t\tString psw = request.getParameter(\"password\").trim();\n\t\tif (!name.equals(\"admin\") || !psw.equals(\"admin\")) {\n\t\t\tmessage = \"用户名或口令不正确!请重试!\";\n\t\t\trequest.getSession().setAttribute(\"message\", message);\n\t\t\tresponse.sendRedirect(\"ch3/Login.jsp\");\n\t\t} else {\n\t\t\tif ((request.getParameter(\"check\")) != null && (request.getParameter(\"check\")).equals(\"check\")) {\n\t\t\t\tCookie nameCookie = new Cookie(\"username\", name);\n\t\t\t\tCookie pswCookie = new Cookie(\"password\", psw);\n\t\t\t\tnameCookie.setMaxAge(60 * 60);\n\t\t\t\tpswCookie.setMaxAge(60 * 60);\n\t\t\t\tresponse.addCookie(nameCookie);\n\t\t\t\tresponse.addCookie(pswCookie);\n\t\t\t}\n\t\t\tmessage = \"登陆成功!\";\n\t\t\trequest.getSession().setAttribute(\"message\", message);\n//\t\t\tresponse.sendRedirect(\"ch3/welcome.jsp\");\n\t\t\tresponse.getWriter().write(\"<script>window.location.href='ch3/welcome.jsp'</script>\");\n\t\t\treturn;\n\t\t}\n\t}", "@Override\n\tpublic String login_request() {\n\t\treturn null;\n\t}", "protected void service(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String login = request.getParameter(\"login\");\n String senha = request.getParameter(\"senha\");\n UsuarioDAO dao = new UsuarioDAO();\n if (dao.checkLogin(login, senha)) {\n HttpSession session = request.getSession(true);\n session.setAttribute(\"login\", login);\n Cookie[] cookies = request.getCookies();\n Cookie cookie = null;\n for (int i = 0; cookies != null && i < cookies.length; i++) {\n Cookie c = cookies[i];\n if (c.getName().equals(\"myapp.login\")) {\n cookie = c;\n cookie.setValue(cookie.getValue().replace(\"@\" + login, \"\"));\n cookie.setValue(cookie.getValue().replace(login + \"@\", \"\"));\n cookie.setValue(login + \"@\" + cookie.getValue());\n break;\n }\n }\n if (cookie == null) {\n cookie = new Cookie(\"myapp.login\", login);\n }\n cookie.setMaxAge(Integer.MAX_VALUE);\n response.addCookie(cookie);\n RequestDispatcher rd = request.getRequestDispatcher(\"WEB-INF/TheGame.jsp\");\n rd.forward(request, response);\n } else {\n request.setAttribute(\"msg\", \"<span class=\\\"alert label\\\">Login ou senha inválida</span>\");\n RequestDispatcher rd = request.getRequestDispatcher(\"index.jsp\");\n rd.forward(request, response);\n }\n }", "public void doGet(HttpServletRequest request,\r\n HttpServletResponse response)\r\n throws IOException, ServletException\r\n {\r\n response.setContentType(\"text/html\");\r\n PrintWriter out = response.getWriter(); \r\n CookieUtil PkCookie = new CookieUtil();\r\n String vPID = PkCookie.getCookie(request,\"PID\");\r\n if(vPID==null)\r\n {\r\n out.println(WebUtil.IllegalEntry());\r\n return;\r\n }\r\n\r\n int nRefID = 0;\r\n int nCount = 0;\r\n\r\n String nAuditID=null;\r\n String nLangID=null;\r\n String nUserID=null;\r\n String nSchemeID=null;\r\n String vImagePath=null;\r\n String vBPLate=null;\r\n String vImgOption=null;\r\n String vLabelAttrib=null;\r\n String vTextAttrib=null;\r\n String vListAttrib=null;\r\n String vFormType=null;\r\n String vObjParQry = null;\r\n String vGroupQry = null;\r\n String vUserQry = null;\r\n\r\n DBConnect db = new DBConnect();\r\n ConfigData cdata = new ConfigData();\r\n WebUtil util = new WebUtil();\r\n\r\n nAuditID = Parse.GetValueFromString( vPID, \"AuditID\" );\r\n nUserID = Parse.GetValueFromString( vPID, \"UserID\" );\r\n nLangID = Parse.GetValueFromString( vPID, \"LangID\" );\r\n nSchemeID = Parse.GetValueFromString( vPID, \"SchemeID\" );\r\n vImgOption = Parse.GetValueFromString( vPID, \"Image\" );\r\n\r\n vFormType = cdata.GetConfigValue( \"SY_OBJSEC\", nLangID, \"WD_FORM_DEFINE\", \"Object Security / D\" );\r\n\t\r\n if(vImgOption!=null && vImgOption.equalsIgnoreCase(\"ON\"))\r\n vImagePath = \"/ordimg/\" + (db.getName( nLangID, \"Lang\" )).toLowerCase() + \"/BP_ObjSec/\";\r\n else\r\n vLabelAttrib = Scheme.getSchemeProperty( nSchemeID, 'A', 'N' );\r\n \r\n vTextAttrib = Scheme.getSchemeProperty( nSchemeID, 'B', 'N' );\r\n vListAttrib = Scheme.getSchemeProperty( nSchemeID, 'C', 'N' );\r\n\r\n vObjParQry = \"SELECT DISTINCT ObjParent_Name, ObjParent_Name FROM T_ObjSecRef\";\r\n vGroupQry = \"Select Group_ID, Group_Name From T_Group\";\r\n vUserQry = \"Select User_ID, User_Name From T_User\";\r\n\r\n Page page = new Page();\r\n Head head = new Head();\r\n Body body = new Body(\"/ordimg/BACKGR2.GIF\",null); \r\n Form form = new Form(\"/JOrder/servlets/DefineObjSec\",\"POST\",\"_parent\",null,null);\r\n\r\n Script scr = new Script( \"JavaScript\", null );\r\n HtmlTag scrdata = new HtmlTag();\r\n scrdata.add(\"<!-- Start Hidding\" + \"\\n\" +\r\n \"top.show_form(\\\"\"+vFormType+\"\\\")\" + \"\\n\" +\r\n \"// End Hidding -->\");\r\n scr.add(scrdata);\r\n\r\n form.add(new FormHidden(\"vSecLevel\", \"dummy\", null ));\r\n form.add(new NL(2));\r\n\r\n Table tab = new Table(\"1\",\"center\",\"Border=\\\"0\\\" width=\\\"35%\\\" COLS=3\");\r\n \r\n TableRow row = new TableRow(\"Left\",null,null);\r\n vBPLate = cdata.GetConfigValue( \"SY_OBJSEC\", nLangID, \"BL_LABEL.B_OBJSEC_SYSTEM\", \"System\" );\r\n TableCol col = new TableCol(util.GetBoilerPlate(vImgOption, vImagePath+\"System.gif\", vBPLate, vLabelAttrib ),null, null, null, null); \r\n TableCol col1 = new TableCol( new FormRadio( \"vSecLevel\", \"S\", \"CHECKED\", null ),null,null,null,\"WIDTH=\\\"15%\\\"\");\r\n row.add(col) ;\r\n row.add(col1) ;\r\n\r\n TableRow row1 = new TableRow(\"Left\",null,null);\r\n vBPLate = cdata.GetConfigValue( \"SY_OBJSEC\", nLangID, \"BL_LABEL.B_OBJSEC_GROUP\", \"Group\" );\r\n TableCol col2 = new TableCol(util.GetBoilerPlate(vImgOption, vImagePath+\"Grp.gif\", vBPLate, vLabelAttrib ),null, null, null, null); \r\n TableCol col3 = new TableCol( new FormRadio( \"vSecLevel\", \"G\", null, null ),null,null,null,null);\r\n HtmlTag sel = util.createList( nUserID, \"SY_OBJSEC\", \"vGroup\", \"Q\", vGroupQry, null, null, vListAttrib);\r\n TableCol col4 = new TableCol( sel, null, null, null,null);\r\n row1.add(col2) ;\r\n row1.add(col3) ;\r\n row1.add(col4) ;\r\n\r\n TableRow row2 = new TableRow(\"Left\",null,null);\r\n vBPLate = cdata.GetConfigValue( \"SY_OBJSEC\", nLangID, \"BL_LABEL.B_OBJSEC_USER\", \"User\" );\r\n TableCol col5 = new TableCol(util.GetBoilerPlate(vImgOption, vImagePath+\"Usr.gif\", vBPLate, vLabelAttrib ),null, null, null, null);\r\n TableCol col6 = new TableCol( new FormRadio( \"vSecLevel\", \"U\", null, null ),null,null,null,null);\r\n HtmlTag sel1 = util.createList( nUserID, \"SY_OBJSEC\", \"vUser\", \"Q\", vUserQry, null, null, vListAttrib);\r\n TableCol col7 = new TableCol( sel1, null, null, null,null);\r\n row2.add(col5) ;\r\n row2.add(col6) ;\r\n row2.add(col7) ;\r\n\r\n tab.add(row);\r\n tab.add(row1);\r\n tab.add(row2);\r\n\r\n Table tab1 = new Table(\"1\",\"center\",\"Border=\\\"0\\\" width=\\\"50%\\\" COLS=3\");\r\n\r\n TableRow row3 = new TableRow(\"Left\",null,null);\r\n vBPLate = cdata.GetConfigValue( \"SY_OBJSEC\", nLangID, \"BL_LABEL.B_OBJSEC_SELECT\", \"Select Form Name\" );\r\n TableCol col8 = new TableCol(util.GetBoilerPlate(vImgOption, vImagePath+\"select.gif\", vBPLate, vLabelAttrib ),null, null, null, null);\r\n col8.add(WebUtil.NotNull);\r\n HtmlTag sel2 = util.createList( nUserID, \"SY_OBJSEC\", \"vFormName\", \"Q\", vObjParQry, null, null, vListAttrib);\r\n TableCol col9 = new TableCol( sel2, null, null, null,null);\r\n\r\n row3.add(col8) ;\r\n row3.add(col9) ;\r\n tab1.add(row3);\r\n\r\n form.add(new FormHidden(\"vAction\", null, null ));\r\n form.add(tab); \r\n form.add(tab1); \r\n body.add(form);\r\n head.add(scr);\r\n page.add(head);\r\n page.add(body);\r\n out.println(page);\r\n }", "protected void doPostLogin(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tout.println(\"Look where we are, it's the login page\");\n\t\t\n\t\t//get parameter Names\n\t\tsetParameters(request);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tKeyspace keyspace = Connection.getKeyspace();\n\t\tStringSerializer se = StringSerializer.get();\n\t\t\n\t\ttry\n\t\t{\n\t\t\t// given Keyspace keyspace and StringSerializer se\n\t\t\tSliceQuery<String, String, String> q = HFactory.createSliceQuery(keyspace, se, se, se);\n\t\t\tq.setColumnFamily(\"Users\") .setKey(displayName).setColumnNames(\"fullname\", \"email\", \"password\");\n\t\t\tQueryResult<ColumnSlice<String, String>> r = q.execute();\n\n\t\t\tfullname = r.get().getColumnByName(\"fullname\").getValue();\n\t\t\temail = r.get().getColumnByName(\"email\").getValue();\n\n\t\t\tif(password.equals(r.get().getColumnByName(\"password\").getValue()))\n\t\t\t{\n\t\t\t\t//LOGGED IN CORRECTLY\n\t\t\t\t\n\t\t\t\tmySexySession.setAttribute(\"displayName\", displayName);\n\t\t\t\tmySexySession.setAttribute(\"fullname\", fullname);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmySexySession.setAttribute(\"message\", \"Incorrect Password.\");\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\t//catches happen when the key is not found (i.e. user doesn't exist)\n\t\t\tmySexySession.setAttribute(\"message\", \"User does not exist.\");\n\t\t}\n\t\tresponse.sendRedirect(\"/quotes/home\");\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n String bsn = request.getParameter(\"bsn\");\n String uuid = request.getParameter(\"uuid\");\n if (service.ActivateUser(bsn, uuid)) { \n PrintWriter out = response.getWriter();\n out.println(\"Uw account is succesvol geregistreerd. U kunt nu inloggen op de website van de Rekeningrijder.\");\n }\n else {\n PrintWriter out = response.getWriter();\n out.println(\"Registratie is mislukt. Mogelijk is de link verlopen of is de account al geactiveerd.\");\n }\n } catch (Exception ex) {\n PrintWriter out = response.getWriter();\n out.println(\"Er is een fout opgetreden: \" + ex.toString());\n }\n }", "@RequestMapping(value = \"/\", method ={RequestMethod.POST,RequestMethod.GET})\n\tpublic String home(HttpServletRequest request, Model model, HttpServletResponse response) {\n\t\t\n\t\t\n\t\t//Variables \n\t\tString cookieName =\"user\";\n\t\tString cookieValue = \"\";//var a obtener\n\t\tString cookie2pass =\"pass\";\n\t\tString cookie2Value = \"\";//var a obener\n\t\tCookie[ ] cookies = request.getCookies( ); //Obtenemos cookies de la peticion\n\t\t\n\t\t\n\t\t//Asignar valor a las cookies\n\t\tif(cookies==null) {\n\t\t\treturn \"home\";\n\t\t}else {\n\t\tfor (Cookie cookie: cookies){\n\t\t\tif (cookieName.equals(cookie.getName())) {\n\t\t\tcookieValue = cookie.getValue();\n\t\t\t//usuario\n\t\t\tif(cookie2pass.equals(cookie.getName())) {\n\t\t\t//contaseña\t\n\t\t\tcookie2Value=cookie.getValue();\n\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//Comprobamos si el cookievalue es el del administrador o no\n\t\t\n\t\tif(cookieValue.equals(\"Admin\")&& cookie2Value.equals(\"12345\")) {\n\t\t\t\n\t\t\tList <DTOUsuarios> lista = dao.leeUsuarios();\n\t\t\tmodel.addAttribute(\"lista\", lista);\n\t\t\treturn \"usuario\";\n\t\t\t\n\t\t}else {\n\t\t\t//Si el valor de las cookies no es el anterior significa que el usuario se ha autenticado para acceder a los\n\t\t\t//articulos por ello mostramos articulo.jsp, no hace falta autenticar porque ya lo ha echo antes\n\t\t\t\n\t\t\tList <DTOArticulo> list = daoA.leeArticulo();\n\t\t\tmodel.addAttribute(\"list\", list);\n\t\t\treturn\"articulo\";\n\n\n\t\t\t}\n\t\t\n\t\t\t}\n\t\t\n\t\t\n\t}", "public synchronized void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {\r\n\r\n\t\ttry{\r\n\t\t\tsetLanguage(request.getSession(),request);\r\n\t\t\tAdminBO adminBO = (AdminBO)application.getAttribute(\"adminBO\");\r\n\r\n\r\n\t\t\tHttpSession session = request.getSession(true);\r\n\t\t\tString language = (String)session.getAttribute(\"language\");\r\n\r\n\t\t\t//check if the session is New if it's not we will a new session to avoid primary key conflict on the tabel C_USER_SESSIONS\r\n\t\t\tif(!session.isNew()){\r\n\t\t\t\tlogger.info(\"user userName\" + session.getAttribute(\"userName\") + \"is trying to log In using old session : old session Id = \" + session.getId());\r\n\t\t\t\tsession.setAttribute(\"SESSION_INVALIDATED\",\"true\");\r\n\t\t\t\tsession.invalidate();\r\n\t\t\t\tsession = request.getSession(true);\r\n\t\t\t\tif(language != null){\r\n\t\t\t\t\tsession.setAttribute(\"language\", language);\r\n\t\t\t\t}\r\n\t\t\t\tlogger.info(\"invalidating old Session And Creating a New Session : new session Id = \" + session.getId());\r\n\t\t\t}else{\r\n\t\t\t\tlogger.info(\"session is New : session Id =\" + session.getId() + \" for the user: \" + session.getAttribute(\"userName\"));\r\n\t\t\t}\r\n\r\n\t\t\t// removing 'siteAccessTime' parameter that is used only for outside the LOGGED IN area\r\n\t\t\tsession.removeAttribute(\"siteAccessTime\");\r\n\t\t\t\r\n\r\n\t\t\tString userName = StringUtil.nullToEmpty(request.getParameter(\"userName\"));\r\n//\t\t\tString password = StringUtil.nullToEmpty(request.getParameter(\"password\"));\r\n\t\t\tString encryptedPassword = SecurityUtil.byteArrayToHexString(SecurityUtil.getEncryptedString((request.getParameter(\"password\")!= null ? request.getParameter(\"password\").toString()+userName : \"\")));\r\n\r\n\t\t\tboolean isAuthenticated = adminBO.login(userName, encryptedPassword);\r\n\r\n\t\t\tif (isAuthenticated){\r\n\r\n\t\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyyDDMM\");\r\n\t\t\t\tUserBean userBean = adminBO.getUserDetails(0, userName);\r\n\t\t\t\t\r\n\t\t\t\tlogger.info(\"\\nLOGINPAGE userID: \"+userBean.getUserID());\r\n\t\t\t\tlogger.info(\"\\nLOGINPAGE lastAccessTime: \"+userBean.getLastAccessTime());\r\n\t\t\t\tsession.setAttribute(\"userID\", userBean.getUserID());\r\n\t\t\t\tsession.setAttribute(\"userName\", userBean.getUserName());\r\n\t\t\t\tsession.setAttribute(\"userRole\", userBean.getRoleBean().getRoleID());\r\n\t\t\t\tsession.setAttribute(\"sessionAlive\", \"true\");\r\n\t\t\t\tsession.setAttribute(\"lastAccessTime\", userBean.getLastAccessTime());\r\n\t\t\t\t\r\n\t\t\t\tTimestamp loginTime = new Timestamp(new java.util.Date().getTime());\r\n\t\t\t\tString loginTimeStr = sdf.format(loginTime);\r\n\t\t\t\tsession.setAttribute(\"loginTime\", loginTimeStr);\r\n\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\tadminBO.updateUserSession(Integer.parseInt(userBean.getUserID()), session.getId(), loginTime/*, request.getRemoteHost(), */);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tStringBuffer requestString=new StringBuffer();\r\n\t\t\t\trequestString.append(\"formLastAccess=\"+loginTimeStr);\r\n\t\t\t\tString encryptedString = QueryCrypt.encrypt(request, requestString.toString());\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tActivityLogVO activityLogVO = new ActivityLogVO();\r\n\t\t\t\tactivityLogVO.setActivityDate(new Timestamp(new java.util.Date().getTime()));\r\n\t\t\t\tactivityLogVO.setActivityDesc(\"User Successfully LoggedIn\");\r\n\t\t\t\tactivityLogVO.setActivityTypeID(ActivityType.LOGIN_ACT.value());\r\n\t\t\t\tactivityLogVO.setReference(\"\");\r\n\t\t\t\tactivityLogVO.setSessionID(session.getId());\r\n\t\t\t\tactivityLogVO.setUserID(Integer.parseInt(StringUtil.nullOrEmptyToString(session.getAttribute(\"userID\"), \"0\")));\r\n\t\t\t\tadminBO.logActivity(activityLogVO);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tresponse.sendRedirect(\"Home?\"+encryptedString);\r\n\t\t\t\t\r\n\r\n\t\t\t} else{\r\n\t\t\t\tsession.setAttribute(\"LoginErrorMsg\", \"Invalid Username/Password, please try again\");\r\n\t\t\t\tresponse.sendRedirect(\"Login\");\r\n\r\n\t\t\t}\r\n\t\t}catch (Exception e) {\r\n\t\t\tlogger.error(\"ERROR\", e); \r\n\t\t\tresponse.sendRedirect(\"ErrorHandler\");\r\n\t\t}\r\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException\n {\n HttpSession session = request.getSession(false);\n User user = (User)session.getAttribute(\"user\");\n \n if (session != null)\n {\n session.removeAttribute(\"user\");\n session.removeAttribute(\"lastLogin\");\n session.removeAttribute(\"applicationPath\");\n session.removeAttribute(\"webInfPath\");\n session.removeAttribute(\"groupsStoragePath\");\n session.removeAttribute(\"groupID\");\n session.invalidate();\n }\n \n response.setContentType(\"text/html;charset=UTF-8\");\n try (PrintWriter out = response.getWriter())\n {\n PHUtils.pageHeader(out);\n out.println(\"<meta HTTP-EQUIV=\\\"REFRESH\\\" content=\\\"1; url=\" + request.getContextPath() + \"/index.html\\\">\");\n out.println(\"<div class=\\\"alert alert-success\\\" align = \\\"center\\\">\");\n out.println(\" Arrivederci <strong>\"+ user.getUserName() +\"!</strong>.\");\n out.println(\"</div>\");\n PHUtils.pageFooter(out);\n }\n }", "public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException {\n\t\t\n\t\t\n\t\tint k=0;\n\t\t\n\t\t\n\t\t//accept cookie\n\t\tCookie cookies[] =req.getCookies();\n\t\t\n\t\tfor(Cookie c:cookies) {\n\t\t\tif(c.getName().equals(\"k\"))\n\t\t\t\tk=Integer.parseInt(c.getValue());\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tk*=k;\n\t\t\n\t\tPrintWriter out = res.getWriter();\n\t\tout.println(\"Square called\"+k);\n\t\t\n\t\t\n\t\t\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException \r\n{\nresponse.getWriter().append(\"Served at: \").append(request.getContextPath()); \r\n}", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\n\tsuper.doPost(req, resp);\n\t\n\tSystem.out.println(\"dddd\");\n}", "protected void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\t\tif (!isLoggedIn(request)) {\n\t\t\twriteLoginNeededInfo(response);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tJSONObject status = new JSONObject();\n\t\tPrintWriter out = response.getWriter();\n\t\t\n\t\ttry {\n\t\t\tIdentity id = parseIdentity(request);\n\t\t\tdao.update(id);\n\n\t\t\tstatus.put(\"status\", Integer.toString(HttpURLConnection.HTTP_OK));\n\t\t\tstatus.put(\"msg\", \"Identity updated! :)\");\n\t\t} catch (JSONException ex) {\n\t\t\tlogger.error(ex.toString());\n\t\t\t\n\t\t\tstatus.put(\"status\", Integer.toString(HttpURLConnection.HTTP_BAD_REQUEST));\n\t\t\tstatus.put(\"msg\", ex.toString());\n\t\t}\n\t\t\n\t\tout.print(status);\n\t}", "@Override\n\t\tpublic void addCookie(Cookie cookie) {\n\t\t\t\n\t\t}", "private void loginForm(HttpServletRequest req, HttpServletResponse res)\n throws IOException {\n String url = req.getRequestURI();\n String query = req.getQueryString();\n if (query != null) {\n url = url + '?' +query;\n }\n ProtectedRequest target = new ProtectedRequest(url);\n\n // Store in current session\n HttpSession session = req.getSession(true);\n session.setAttribute(AuthSessions.REQUEST_ATTRIBUTE, target);\n\n res.sendRedirect(this.loginForm);\n }", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tresp.setCharacterEncoding(\"utf-8\");\n\t\tresp.setContentType(\"text/html;charset=utf-8\");\n\t\tout=resp.getWriter();\n\t\tsession=req.getSession();\n\t\t//读取表单数据\n\t\tString usname=req.getParameter(\"usname\");\n\t\tString psword=req.getParameter(\"psword\");\n\t\tString yzm=req.getParameter(\"randomCode\");\n\t\t//是否Cookie登录\n\t\tString ck=req.getParameter(\"login\");\n\t\tif(ck==null){\n\t\t\tck=\"\";\n\t\t}\n\n\t\tif(\"ck\".equals(ck)){\n\t\t\tthis.loginNoCokie(usname, psword);\n\t\t\t//System.out.println(usname+\" \"+psword);\n\t\t\treturn;\n\t\t}\n\t\t//System.out.println(yzm);\n\t\t\n\t\tif(usname==null || psword==null || yzm==null){\n\t\t\tout.println(\"<script>\");\n\t\t\tout.println(\"alert(\\\"输入信息不能为空!\\\");\");\n\t\t\tout.println(\"window.location.href=\\\"login.jsp\\\";\");\n\t\t\tout.println(\"</script>\");\n\t\t\treturn;\n\t\t}\n\t\tif(\"\".equals(yzm) || \"\".equals(usname)){\n\t\t\tout.println(\"<script>\");\n\t\t\tout.println(\"alert(\\\"输入信息不能为空!\\\");\");\n\t\t\tout.println(\"window.location.href=\\\"login.jsp\\\";\");\n\t\t\tout.println(\"</script>\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//判断验证码,不正确直接pass\n\t\t\n\t\tString yzm2=(String)session.getAttribute(\"randomCode\");\n\t\t\n\t\tif(!(yzm.equals(yzm2))){\n\t\t\tout.println(\"<script>\");\n\t\t\tout.println(\"alert(\\\"验证码输入有误!\\\");\");\n\t\t\tout.println(\"window.location.href=\\\"login.jsp\\\";\");\n\t\t\tout.println(\"</script>\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//获取Cookie时效的参数\n\t\tString shixiao=req.getParameter(\"shixiao\");\n\t\t//处理有效性\n\t\tif(shixiao==null){\n\t\t\tshixiao=\"now\";\n\t\t}\n\t\t\n\t\t//根据不同的cookie时效,进行处理\n\t\tif(\"now\".equals(shixiao)){\n\t\t\tthis.loginNoCokie(usname, psword);\n\t\t}\n\t\t\n\t\tint age=0;\n\t\tif(\"week\".equals(shixiao)){\n\t\t\tage=60*60*24*7;\n\t\t\tthis.loginAddCokie(usname, psword, age, resp);\n\t\t}\n\t\t\n\t\tif(\"month\".equals(shixiao)){\n\t\t\tage=60*60*24*30;\n\t\t\tthis.loginAddCokie(usname, psword, age, resp);\n\t\t}\n\n\t\t\n\t}", "private void loginAsAdmin() {\n vinyardApp.navigateToUrl(\"http://localhost:8080\");\n vinyardApp.fillUsername(\"admin\");\n vinyardApp.fillPassord(\"321\");\n vinyardApp.clickSubmitButton();\n }", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n try {\r\n String username = request.getParameter(\"Username\");\r\n String password = request.getParameter(\"Password\");\r\n\r\n HttpSession session = request.getSession();\r\n List<User> userList = sql.selectAllUsers();\r\n\r\n Boolean validUser = false;\r\n Boolean IsAdmin = false;\r\n\r\n if (userList != null && userList.isEmpty() == false) {\r\n for (User user : userList) {\r\n if (user.getUsername().equals(username)\r\n && user.getPass().equals(password)) {\r\n LoginHistory newLoginHistory = new LoginHistory(user.getUsersID(),LocalDate.now().toString(),\"test123\");\r\n sql.createLoginHistory(newLoginHistory);\r\n if (user.getUserType().equals(\"Admin\")) {\r\n IsAdmin = true;\r\n break;\r\n }\r\n session.setAttribute(Session.LOGIN_USERNAME, user.getUsername());\r\n System.out.println(user.getUsername());\r\n validUser = true;\r\n break;\r\n }\r\n }\r\n }\r\n if (session.getAttribute(Session.SITE) != null) {\r\n goToSite = session.getAttribute(Session.SITE).toString();\r\n }\r\n\r\n if (validUser && goToSite.equals(\"ProfilePage\")) {\r\n session.setAttribute(\"LoginUsername\", username);\r\n session.setAttribute(Session.SITE, \"\");\r\n response.sendRedirect(\"User/ProfilePage.jsp\");\r\n } else if (validUser && goToSite.equals(\"PurchaseMethod\")) {\r\n session.setAttribute(\"LoginUsername\", username);\r\n session.setAttribute(Session.SITE, \"\");\r\n response.sendRedirect(\"User/PurchaseMethod.jsp\");\r\n } else if (validUser) {\r\n session.setAttribute(\"LoginUsername\", username);\r\n session.setAttribute(Session.SITE, \"\");\r\n response.sendRedirect(\"MainPage.jsp\");\r\n } else if (IsAdmin) {\r\n response.sendRedirect(\"Admin/AdminMainPage.jsp\");\r\n } else {\r\n response.sendRedirect(\"LoginPage.jsp\");\r\n }\r\n } catch (Exception ex) {\r\n Logger.getLogger(LoginServlet.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tObjectMapper mapper = new ObjectMapper();\n\t\tUsers inputUser = mapper.readValue(request.getInputStream(), Users.class);\n\t\tString username = inputUser.getUName();\n\t\tString password = inputUser.getPassword();\n\t\t\n\t\t\n\t\tPrintWriter writer = response.getWriter(); //initialize printwriter\n\t\tHttpSession session=request.getSession(); //initialize session\n \n\t\tUsers userCode = service.logIn(username, password);\n\t\t\n\t\tif(userCode.getValue() ==-1)\n\t\t{\n\t\t\tresponse.setStatus(200); //CREATED\n\t\t\tresponse.setContentType(\"application/text\");\n\t\t\t \n\t\t}\n\t\tif(userCode.getValue()==-2)\n\t\t{\n\t\t\tresponse.setStatus(200); //CREATED\n\t\t\tresponse.setContentType(\"application/text\");\n\t\t\t \n\t\t}\n\t\tif(userCode.getValue()==3 ||userCode.getValue()==4 )\n\t\t{\n\t\t\t\n\t\t\tsession.setAttribute(\"uid\",userCode.getUserID());\n\t\t\tsession.setAttribute(\"name\",userCode.getFName());\n\t\t\tsession.setAttribute(\"roleid\",userCode.getURole().getRoleID());\n\t\t\t\n\t\t\t//resource = \"/ers/ERequest.view\";\n\t\t\t//request.getRequestDispatcher(resource).forward(request, response);\n\t\t\t//response.sendRedirect(resource);\n\t\t\t//writer.write(\"Welcome Employee\"); \n\t\t}\n\t\tresponse.setStatus(200);\n\t\tresponse.setContentType(\"application/text\");\n\t\twriter.write(userCode.getValue()+\"\");\n\t\t\t\t\n\t}", "protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\r\n\t\t\r\n\t\tSystem.out.println(\"로그인기능을 수행하겠습니다\");\r\n\r\n\t\trequest.setCharacterEncoding(\"euc-kr\");\r\n\r\n\t\tString id = request.getParameter(\"id\");\r\n\t\tString pw = request.getParameter(\"pw\");\r\n\t\t\r\n\t\tSystem.out.println(id);\r\n\t\tSystem.out.println(pw);\r\n\t\t\r\n\r\n\t\tmemberDAO dao = new memberDAO();\r\n\t\tmemberVO vo = dao.Login(id, pw);\r\n\r\n\t\t\tSystem.out.println(vo);\r\n\r\n\t\t\tHttpSession session = request.getSession();\r\n\r\n\t\t\tsession.setAttribute(\"vo\", vo);\r\n\r\n\t\t\t\r\n\t\t\tresponse.sendRedirect(\"home.jsp\");\r\n\t\t\t\r\n\t\t}", "private void action_login_utente(HttpServletRequest request, HttpServletResponse response) throws IOException{\n //recupero credenziali di login\n String email = SecurityLayer.addSlashes(request.getParameter(\"email\").toLowerCase());\n email = SecurityLayer.sanitizeHTMLOutput(email);\n String password = SecurityLayer.addSlashes(request.getParameter(\"password\"));\n password = SecurityLayer.sanitizeHTMLOutput(password);\n if(!email.isEmpty() && !password.isEmpty()){\n try {\n //recupero utente dal db\n Utente u = ((PollwebDataLayer)request.getAttribute(\"datalayer\")).getUtenteDAO().getUtenteByEmail(email);\n //controllo che l'utente esista\n if(u != null){\n //controllo i parametri\n if(u.getEmail().equalsIgnoreCase(email) && new BasicPasswordEncryptor().checkPassword(password, u.getPassword())){\n //se l'utente esiste ed è lui\n\n request.setAttribute(\"userName\", u.getNome());\n request.setAttribute(\"user_id\", u.getId());\n System.out.println(u.getId());\n\n SecurityLayer.createSession(request, u.getId());\n\n if (request.getParameter(\"referrer\") != null) {\n response.sendRedirect(request.getParameter(\"referrer\"));\n } else {\n response.sendRedirect(\"/home\");\n }\n }else{\n if(request.getAttribute(\"referrer\") != null){\n response.sendRedirect(\"/login?referrer=\" + URLEncoder.encode(((String)request.getAttribute(\"referrer\")), \"UTF-8\"));\n }else{\n request.setAttribute(\"error\", \"Credenziali errate\");\n response.sendRedirect(\"/login?error=100\");\n }\n }\n\n }else{\n\n if(request.getAttribute(\"referrer\") != null){\n response.sendRedirect(\"/login?referrer=\" + URLEncoder.encode(((String)request.getAttribute(\"referrer\")), \"UTF-8\"));\n }else{\n response.sendRedirect(\"/login&error=102\");\n }\n }\n }catch (DataException ex) {\n //TODO Handle Exception\n\n }\n } else {\n\n if(request.getAttribute(\"referrer\") != null){\n response.sendRedirect(\"/login?referrer=\" + URLEncoder.encode(((String)request.getAttribute(\"referrer\")), \"UTF-8\"));\n }else{\n response.sendRedirect(\"/login?error=101\");\n }\n }\n }", "@DOMSupport(DomLevel.ONE)\r\n @Property String getCookie();", "public void logout(){\r\n final String url3 = \"http://192.168.43.218/default/logout.json\";\r\n RequestQueue rq = Volley.newRequestQueue(this);\r\n StringRequest s1 = new StringRequest(Request.Method.GET, url3,\r\n new Response.Listener<String>() {\r\n @Override\r\n\r\n public void onResponse(String response) {\r\n\r\n LoginActivity.editor = LoginActivity.use.edit();\r\n LoginActivity.editor.putString(\"Set-Cookie\",\"\");\r\n LoginActivity.editor.apply();\r\n }\r\n\r\n },\r\n //giving volley error\r\n\r\n new Response.ErrorListener() {\r\n @Override\r\n public void onErrorResponse(VolleyError error) {\r\n Dialog(error.toString(),\"error\");\r\n }\r\n }\r\n\r\n ){\r\n\r\n public Map<String, String> getHeaders() throws AuthFailureError {\r\n Map<String, String> getHeader = new HashMap<String, String>();\r\n getHeader.put(\"Cookie\",LoginActivity.use.getString(\"Set-Cookie\",\"\"));\r\n return getHeader;\r\n }\r\n };\r\n Intent nextScreen = new Intent(getApplicationContext(), LoginActivity.class);\r\n //nextScreen.putExtra(\"type\",0);\r\n startActivity(nextScreen);\r\n\r\n\r\n rq.add(s1);\r\n\r\n\r\n }", "public void doPost(HttpServletRequest request,\r\n HttpServletResponse response)\r\n throws IOException, ServletException\r\n {\r\n response.setContentType(\"text/html\");\r\n PrintWriter out = response.getWriter(); \r\n CookieUtil PkCookie = new CookieUtil();\r\n String vPID = PkCookie.getCookie(request,\"PID\");\r\n if(vPID==null)\r\n {\r\n out.println(WebUtil.IllegalEntry());\r\n return;\r\n }\r\n\r\n String nRefID = null;\r\n String mode = null;\r\n \r\n String vSecLevel[] = request.getParameterValues(\"vSecLevel\");\r\n String vGroup = request.getParameter(\"vGroup\");\r\n String vUser = request.getParameter(\"vUser\");\r\n String vFormName = request.getParameter(\"vFormName\");\r\n String vAction = request.getParameter(\"vAction\");\r\n\r\n if ( vSecLevel[0].equalsIgnoreCase(\"G\") )\r\n nRefID = vGroup;\r\n if ( vSecLevel[0].equalsIgnoreCase(\"U\") )\r\n nRefID = vUser;\r\n\r\n if(vAction.equalsIgnoreCase(\"New\"))\r\n mode=\"I\";\r\n else\r\n mode=\"N\";\r\n response.sendRedirect(\"/JOrder/servlets/ObjSecFrame?pvMode=\"+mode+\"&pvParentObj=\"+vFormName+\"&pvObjType=&pvSecLevel=\"+vSecLevel[0]+\"&pnRefID=\"+nRefID+\"&pvMessage=\");\r\n }", "public String execute(){\n HttpSession session = request.getSession();\n System.out.println(request);\n System.out.println(response);\n System.out.println(application);\n System.out.println(session);\n\n return null;\n\n}", "protected String getJWTFromCookie(HttpServletRequest req) {\n String serializedJWT = null;\n Cookie[] cookies = req.getCookies();\n if (cookies != null) {\n for (Cookie cookie : cookies) {\n if (cookieName.equals(cookie.getName())) {\n LOG.info(cookieName\n + \" cookie has been found and is being processed\");\n serializedJWT = cookie.getValue();\n break;\n }\n }\n }\n return serializedJWT;\n }", "private void loggedInUser() {\n\t\t\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n //processRequest(request, response);\n if(request.getParameter(\"acao\").equals(\"Deslogar\")){\n HttpSession sessao = request.getSession();\n sessao.invalidate();\n response.sendRedirect(\"home.jsp\");\n }\n }", "GroupKey appCookie();" ]
[ "0.6577397", "0.6488018", "0.64688945", "0.64301056", "0.6311893", "0.6238824", "0.61970955", "0.61845267", "0.61750066", "0.6038336", "0.5989205", "0.5980924", "0.5978478", "0.59776235", "0.59022117", "0.58864045", "0.58811146", "0.58592504", "0.5853684", "0.5836049", "0.5804775", "0.5803943", "0.5794459", "0.5789323", "0.5780817", "0.57807326", "0.57441324", "0.5743434", "0.5737138", "0.5704339", "0.5696113", "0.56919116", "0.5668135", "0.5656012", "0.5650179", "0.56489193", "0.5643308", "0.56408155", "0.5631952", "0.562324", "0.5618594", "0.56120265", "0.5600693", "0.55978817", "0.55916977", "0.55848783", "0.5580157", "0.5580082", "0.5550261", "0.5543512", "0.5525183", "0.5522993", "0.55223304", "0.5504613", "0.55020267", "0.54814017", "0.547618", "0.5463414", "0.5461085", "0.54561085", "0.54531634", "0.5452923", "0.5442509", "0.54424256", "0.5441609", "0.5441145", "0.5434662", "0.5427736", "0.54179233", "0.54175454", "0.54087067", "0.54085034", "0.54037106", "0.5403685", "0.540094", "0.5400008", "0.5398616", "0.5394671", "0.5389733", "0.53871655", "0.5385635", "0.53817225", "0.5378736", "0.53759253", "0.5372498", "0.5371887", "0.5364181", "0.5349118", "0.53475726", "0.5345863", "0.53455013", "0.5345364", "0.5341133", "0.53344345", "0.5327013", "0.53258765", "0.5316159", "0.53160965", "0.53153723", "0.5311279" ]
0.6169179
9
System.out.println(Utils.getCurrentTime() + " / START ADMIN Edit SERVLET IS DONE! POST"); Authentication.log(req.getCookies()[0].getValue() + " ");
@Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException { req.setCharacterEncoding("UTF-8"); resp.setContentType("application/json; charset=UTF-8"); JSONObject userJSon = Utils.getJsonFromRequest(req); JSONObject jsonObjectResponse = new JSONObject(); System.out.println(userJSon); if (Authentication.isAdminInDbByCookies(req)) { if (userJSon.getString("command").equals("setTurnNumberForMember")) { if(Authentication.getRepository().isTurnNumberFree(userJSon.getInt("turnNumber"))){ Member member = Authentication.getRepository().getMemberById(userJSon.getInt("idMember")); Authentication.getRepository().updateTurnNumberForMember(member, userJSon.getInt("turnNumber")); jsonObjectResponse.append("status", "200"); jsonObjectResponse.append("message", "Номер жеребъевки установлен"); }else{ jsonObjectResponse.append("status", "400"); jsonObjectResponse.append("message", "Номер уже занят"); } } } resp.getWriter().write(String.valueOf(jsonObjectResponse)); resp.flushBuffer(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void doPost(HttpServletRequest r, HttpServletResponse s) throws ServletException, IOException {\n Cookie ck=new Cookie(\"auth\",\"\"); \n ck.setMaxAge(0);\n s.addCookie(ck); \n RequestDispatcher rd = r.getRequestDispatcher(\"index.jsp\");\n rd.forward(r, s);\n \n }", "@Override\n protected void doPost(HttpServletRequest req,\n HttpServletResponse resp)\n throws ServletException, IOException {\n\n String requestBody = \"\";\n requestBody = IOUtils.toString(req.getReader());\n String[] usernameAndPassword = requestBody.split(\"&\");\n String username = usernameAndPassword[0].substring(9);\n String password = usernameAndPassword[1].substring(9);\n LoginDAO loginDAO = new LoginDAO();\n JsonCredential credential = loginDAO.login(username,password);\n if(credential == null) {\n // send invalid login response\n log.info(\"LoginServlet, Invalid Username/Password\");\n String invalidLoginURL = String.format(\"%s/\", req.getContextPath());\n resp.setStatus(401);\n }\n else{\n // login user, maybe with a redirect\n String credentialAsString = credential.makeJsonString();\n if(!credentialAsString.equals(\"\")) {\n // encoding prevents issue where Tomcat sees Cookie as invalid\n credentialAsString = URLEncoder.encode(credentialAsString,\"UTF-8\");\n Cookie cookie = new Cookie(\"expenseapp_authenticationcookie\",credentialAsString);\n cookie.setMaxAge(1200000); //roughly 2 weeks before expiration\n if(credential.getPermissionName().equals(\"Employee\")) {\n resp.addCookie(cookie);\n String employeeHomeScreen = String.format(\"%s/employeehomescreen.html\", req.getContextPath());\n resp.sendRedirect(employeeHomeScreen);\n }\n else if(credential.getPermissionName().equals(\"Manager\")) {\n resp.addCookie(cookie);\n String managerHomeScreen = String.format(\"%s/managerhomescreen.html\", req.getContextPath());\n resp.sendRedirect(managerHomeScreen);\n }\n else{\n log.error(\"LoginServlet, Invalid Permission Name - 500 error\");\n resp.setStatus(500);\n String errorUrl = String.format(\"%s/500Error.html\", req.getContextPath());\n req.getRequestDispatcher(errorUrl).forward(req,resp);\n }\n }\n }\n\n }", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tresp.setContentType(\"type=text/html; charset=utf-8\");\r\n\t\tPrintWriter out = resp.getWriter();\r\n\t\tString username = req.getParameter(\"username\");\r\n\t\tString password = req.getParameter(\"password\");\r\n\t\tout.print(username+\"===\"+password);\r\n\t\treq.getSession().setAttribute(\"remoteusername\", username);\r\n\t\treq.getSession().setAttribute(\"remotepassword\", password);\r\n\t\t\r\n\t\tCookie c1 = new Cookie(\"cooUserName\", username);\r\n\t\tCookie c2 = new Cookie(\"cooPassword\", password);\r\n\t\tc1.setPath(\"/\");\r\n\t\tc2.setPath(\"/\");\r\n\t\tresp.addCookie(c1);\r\n\t\tresp.addCookie(c2);\r\n\t\tc1.setMaxAge(60 * 60 * 24 * 14);\r\n\t\tc2.setMaxAge(60 * 60 * 24 * 14);\r\n\t\tRequestDispatcher dispatcher = req.getRequestDispatcher(\"/main.jsp\");\r\n\r\n\t\tdispatcher .forward(req, resp);\r\n\t\t//super.doPost(req, resp);\r\n\t}", "public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException\n\t\t\t {\n\n\t\tresponse.setContentType(\"text/html;charset=UTF-8\");\n\t\trequest.setCharacterEncoding(\"UTF-8\");\n\t\tHttpSession session=request.getSession();\n\t\tString id=request.getParameter(\"id\");\n\t\tString pwd=request.getParameter(\"pwd\");\n\t\tString rand = (String)session.getAttribute(\"rand\");\n\t\tString input = request.getParameter(\"rand\");\n\t\tString[] rem=request.getParameterValues(\"remember\");\n\t\tSystem.out.println(\"记住密码=\"+rem[0]);\n\t\tif (rand.equals(input)) {\n\t\t\tWebLoginDAO t=new WebLoginDAO();\n\t\t \tSystem.out.println(id+\"+\"+pwd);\n\t\t\tint ss=0;\n\t\t \ttry {\n\t\t\t\tss=t.checkid(id, pwd);\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\n\t\t\t\te.printStackTrace();\n\t\t\t\tthrow new ServletException(e);\n\t\t\t}\n\t\t \tSystem.out.println(\"check=\"+ss);\n\t\t\tif(ss==1){\n\t\t\t\t//存入登陆的用户logname\n\t\t\t\tRegistUser ee=new RegistUser();\n\t\t\t\tee.setLogname(id);\n\t\t\t\t//登陆成功后根据ID取出用户全部信息,以方便用户修改界面预显示信息\n\t\t\t\ttry {\n\t\t\t\t\tee.get(id);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tsession.setAttribute(\"user\", ee);\n<<<<<<< HEAD\n\t\t\t\tsession.setAttribute(\"logname\",id);\n\t\t\t\t\n=======\n\t\t\t\tsession.setAttribute(\"username\", id);\n>>>>>>> origin/master\n\t\t\t\t//检查“记住我”是否勾选;\n\t\t\t\tif(rem[0].equals(\"remember\")){\n\t\t\t\t//新建cookie对象\n\t\t \t\tCookie idcookie=new Cookie(\"id\", URLEncoder.encode(id, \"UTF-8\"));\n\t\t \t\tCookie pwdcookie=new Cookie(\"pwd\",pwd);\n\t\t \t\t//设置cookie的生命周期\n\t\t \t\tidcookie.setMaxAge(300);\n\t\t \t\tpwdcookie.setMaxAge(300);\n\t\t \t\t//将cookie写入客户端浏览器\n\t\t \t\tresponse.addCookie(idcookie);\n\t\t \t\tresponse.addCookie(pwdcookie);\n\t\t \t\tSystem.out.println(\"已记住\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\trequest.getRequestDispatcher(\"index2.jsp\").forward(request, response);\n\t\t\t}\n\t\t\telse if(ss==2){\n\t\t\t\tthrow new ServletException(\"密码错误!\");\n\t\t\t}\n\t\t\telse if(ss==3){\n\t\t\t\tthrow new ServletException(\"账号不存在!\");\n\t\t\t}\n\t\t}\n\t\telse{\n\n\t\t\t\tthrow new ServletException(\"验证码错误!\");\n\n\t\t\n\t\t}\n\t\t\n\t\t\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tCookie[] cookies = req.getCookies();\n\t\tif (cookies != null) {\n\t\t\tfor (Cookie cookie : cookies) {\n\t\t\t\tif (cookie.getName().equals(\"hello-cookie\")) {\n\t\t\t\t\t// cookie has already been created\n\t\t\t\t\tSystem.out.println(\"Replacing old cookie value: \" + cookie.getValue());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Cookie cookie = req.getCookie(\"hello-cookie\"); // Java EE 7\n\n\t\t// creating cookies\n\t\tCookie cook = new Cookie(\"hello-cookie\", req.getParameter(\"cookie\"));\n\t\tcook.setMaxAge(2_000_000_000); // expiry\n\t\tresp.addCookie(cook);\n\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n String userId = request.getParameter(\"username\");\r\n String password = request.getParameter(\"pass\");\r\n String remember = request.getParameter(\"remember\");\r\n \r\n HttpSession session = request.getSession();\r\n User user = new UserDAO().login(userId, password);\r\n \r\n if(user != null){//dang nhap thang cong\r\n if(remember != null){\r\n Cookie uCookie = new Cookie(\"username\", userId);\r\n uCookie.setMaxAge(24 * 3600);//hạn 1 ngày\r\n Cookie pCookie = new Cookie(\"password\", password);\r\n pCookie.setMaxAge(24 * 3600);//hạn 1 ngày\r\n response.addCookie(uCookie);\r\n response.addCookie(pCookie);\r\n }\r\n if(user.getRoleId() == 1) {\r\n response.sendRedirect(\"admin\");\r\n session.setAttribute(\"user\", user);\r\n }\r\n else if(user.getStatus() != 1) {//chua active code \r\n response.sendRedirect(\"active\");\r\n request.getSession().setAttribute(\"user\", user);\r\n \r\n } \r\n else {\r\n response.sendRedirect(\"home\"); \r\n session.setAttribute(\"user\", user);\r\n }\r\n }else{\r\n request.setAttribute(\"err\", \"Incorrect Id or Password\");\r\n request.getRequestDispatcher(\"login.jsp\").forward(request, response);\r\n }\r\n \r\n }", "public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {\n\n\t\tresponse.setContentType(\"text/html\");\n\t\tCookie loginCookie = null;\n\t\tCookie[] cookies = request.getCookies();\n\t\tif (cookies != null) {\n\t\t\tfor (Cookie cookie : cookies) {\n\t\t\t\tif (cookie.getName().equals(\"uname\")|| cookie.getName().equals(\"JSESSIONID\")) {\n\t\t\t\t\tcookie.setMaxAge(0);\n\t\t\t\t\tcookie.setValue(null);\n\t\t\t\t\tresponse.addCookie(cookie);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n//\n//\t\tif (loginCookie != null) {\n//\t\t\tloginCookie.setMaxAge(0);\n//\t\t\tresponse.addCookie(loginCookie);\n//\t\t}\n\t\tHttpSession session = request.getSession(false);\n// \tSystem.out.println(\"User=\"+session.getAttribute(\"name\"));\n \tif(session != null){\n \t\tsession.removeAttribute(\"name\");\n \t\tsession.invalidate();\n \t\tresponse.sendRedirect(\"index.jsp\");\n \t}\n\t}", "private void loginAdmin(HttpServletRequest request, HttpServletResponse response) throws IOException, SQLException {\n\t\tString username = request.getParameter(\"username\");\n\t\tString pass = request.getParameter(\"password\");\n\t\tCookie[] theCookieLoop=request.getCookies();\n\t\t\n\t\tif(username.equals(\"admin\") && pass.equals(\"123456\")) {\n\t\t\tif(theCookieLoop !=null) {\n\t\t\t\tfor(Cookie tempCookie:theCookieLoop) {\n\t\t\t\t\tif(\"checkLoginPageAdmin\".equals(tempCookie.getName())) {\n\t\t\t\t\t\ttempCookie.setValue(\"true\");\n\t\t\t\t\t\tresponse.addCookie(tempCookie);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor(Cookie tempCookie:theCookieLoop) {\n\t\t\t\t\tif(\"UserLoginAdmin\".equals(tempCookie.getName())) {\n\t\t\t\t\t\ttempCookie.setValue(request.getParameter(\"username\"));\n\t\t\t\t\t\tresponse.addCookie(tempCookie);\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\tresponse.sendRedirect(\"/WebBuyPhone/admin/darkboard.jsp\");\n\t\t}\n\t\tboolean check;\n\t\tcheck=daoPageAdmin.LoginPageAdmin(request.getParameter(\"username\"),MD5Encrypt.hashPass(request.getParameter(\"password\")));\n\t\tif(check) {\n\t\t\ttheCookieLoop=request.getCookies();\n\t\t\tif(theCookieLoop !=null) {\n\t\t\t\tfor(Cookie tempCookie:theCookieLoop) {\n\t\t\t\t\tif(\"checkLoginPageAdmin\".equals(tempCookie.getName())) {\n\t\t\t\t\t\ttempCookie.setValue(\"true\");\n\t\t\t\t\t\tresponse.addCookie(tempCookie);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor(Cookie tempCookie:theCookieLoop) {\n\t\t\t\t\tif(\"UserLoginAdmin\".equals(tempCookie.getName())) {\n\t\t\t\t\t\ttempCookie.setValue(request.getParameter(\"username\"));\n\t\t\t\t\t\tresponse.addCookie(tempCookie);\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\ttheCookie =new Cookie(\"userLoginPageAdmin\",request.getParameter(\"username\"));\n\t\t\ttheCookie.setMaxAge(60*60*24*365);\n\t\t\tresponse.addCookie(theCookie);\n\t\t\tresponse.sendRedirect(\"/WebBuyPhone/admin/darkboard.jsp\");\n\t\t}\n\t}", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\n\tsuper.doPost(req, resp);\n\t\n\tSystem.out.println(\"dddd\");\n}", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n String action = request.getParameter(\"action\");\n String email=request.getParameter(\"email\");\n String password=request.getParameter(\"password\");\n HttpSession session = request.getSession();\n \n AccountService as = new AccountService();\n User user = as.login(email, password);\n String message=\"\";\n if (email.isEmpty() || email==null || password.isEmpty() || password == null){\n message=\"empty\";\n session.setAttribute(\"message\",message);\n response.sendRedirect(\"login\");\n return;\n }\n \n if (action!= null){\n session.setAttribute(\"email\", email);\n switch(action)\n {\n case \"signin\":\n if (user==null){\n message = \"notfound\";\n session.setAttribute(\"message\", message);\n response.sendRedirect(\"login\");\n return;\n }\n\n else if (user.getActive()){\n session.setAttribute(\"user\",user);\n if (user.getRole().getRoleId()==1){ \n response.sendRedirect(\"admin\");\n return;\n }\n else {\n response.sendRedirect(\"inventory\"); \n return;\n }\n }\n else{\n message=\"inactive\";\n session.setAttribute(\"message\", message);\n response.sendRedirect(\"login\");\n return;\n }\n \n case \"register\":\n response.sendRedirect(\"registration\");\n return;\n }\n }\n \n getServletContext().getRequestDispatcher(\"/WEB-INF/login.jsp\").\n forward(request, response); \n }", "public void doPost(HttpServletRequest request,\r\n HttpServletResponse response)\r\n throws IOException, ServletException\r\n {\r\n response.setContentType(\"text/html\");\r\n PrintWriter out = response.getWriter(); \r\n CookieUtil PkCookie = new CookieUtil();\r\n String vPID = PkCookie.getCookie(request,\"PID\");\r\n if(vPID==null)\r\n {\r\n out.println(WebUtil.IllegalEntry());\r\n return;\r\n }\r\n\r\n String nRefID = null;\r\n String mode = null;\r\n \r\n String vSecLevel[] = request.getParameterValues(\"vSecLevel\");\r\n String vGroup = request.getParameter(\"vGroup\");\r\n String vUser = request.getParameter(\"vUser\");\r\n String vFormName = request.getParameter(\"vFormName\");\r\n String vAction = request.getParameter(\"vAction\");\r\n\r\n if ( vSecLevel[0].equalsIgnoreCase(\"G\") )\r\n nRefID = vGroup;\r\n if ( vSecLevel[0].equalsIgnoreCase(\"U\") )\r\n nRefID = vUser;\r\n\r\n if(vAction.equalsIgnoreCase(\"New\"))\r\n mode=\"I\";\r\n else\r\n mode=\"N\";\r\n response.sendRedirect(\"/JOrder/servlets/ObjSecFrame?pvMode=\"+mode+\"&pvParentObj=\"+vFormName+\"&pvObjType=&pvSecLevel=\"+vSecLevel[0]+\"&pnRefID=\"+nRefID+\"&pvMessage=\");\r\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String name = request.getParameter(\"name\");\n String password = request.getParameter(\"password\");\n Cookie firstName = new Cookie(\"name\", request.getParameter(\"name\"));\n Cookie passWord = new Cookie(\"password\", request.getParameter(\"password\"));\n firstName.setMaxAge(60 * 60 * 24);\n response.addCookie(passWord);\n response.addCookie(firstName);\n response.setContentType(\"text/html\");\n\n try {\n Request(request, response, name, password);\n } catch (Exception ex) {\n Logger.getLogger(dbServlet.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void eatCookie(){\n}", "@Override\n\tpublic void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tboolean isAuthenticated = false;\n\t\tString userName = request.getParameter(\"user\");\n\t\tString password = request.getParameter(\"password\");\n\t\tisAuthenticated = (userName .equals( \"demo\") && password .equals( \"demo\"));\n\n\t\t/**\n\t\t * If authentication succeeds, redirect to user page servlet\n\t\t */\n\t\tif (isAuthenticated) {\n\t\t\t/**\n\t\t\t * Create a new session each time user login successfully a secure page\n\t\t\t */\n\t\t\tHttpSession session = ((HttpServletRequest)request).getSession(true);\n\t\t\tsession.setMaxInactiveInterval(20);\n\t\t\tSystem.out.println(session.getId() + \" \" + session.isNew() + \" \" + session.getCreationTime() + \" \" + session.getLastAccessedTime() + \" \" + session.getMaxInactiveInterval());\n\n\t\t\tCookie authCookie = new Cookie(\"user\", userName);\n\t\t\tauthCookie.setMaxAge(cookie_expire_time);\n\t\t\tresponse.addCookie(authCookie);\n\t\t\ttry {\n\t\t\t\tsession.setAttribute(\"myname\", userName);\n\t\t\t}\n\t\t\tcatch(IllegalStateException ise) {\n\t\t\t\tise.printStackTrace();\n\t\t\t}\n\t\t\tresponse.sendRedirect(authenticated_redirect);\n\t\t\t//TODO: Redirect to the page user requested before forced to login\n\t\t}\n\t\telse {\n\t\t\trequest.getRequestDispatcher(noauthenticated_forward).forward(request, response);\n\t\t}\n\t}", "public synchronized void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {\r\n\r\n\t\ttry{\r\n\t\t\tsetLanguage(request.getSession(),request);\r\n\t\t\tAdminBO adminBO = (AdminBO)application.getAttribute(\"adminBO\");\r\n\r\n\r\n\t\t\tHttpSession session = request.getSession(true);\r\n\t\t\tString language = (String)session.getAttribute(\"language\");\r\n\r\n\t\t\t//check if the session is New if it's not we will a new session to avoid primary key conflict on the tabel C_USER_SESSIONS\r\n\t\t\tif(!session.isNew()){\r\n\t\t\t\tlogger.info(\"user userName\" + session.getAttribute(\"userName\") + \"is trying to log In using old session : old session Id = \" + session.getId());\r\n\t\t\t\tsession.setAttribute(\"SESSION_INVALIDATED\",\"true\");\r\n\t\t\t\tsession.invalidate();\r\n\t\t\t\tsession = request.getSession(true);\r\n\t\t\t\tif(language != null){\r\n\t\t\t\t\tsession.setAttribute(\"language\", language);\r\n\t\t\t\t}\r\n\t\t\t\tlogger.info(\"invalidating old Session And Creating a New Session : new session Id = \" + session.getId());\r\n\t\t\t}else{\r\n\t\t\t\tlogger.info(\"session is New : session Id =\" + session.getId() + \" for the user: \" + session.getAttribute(\"userName\"));\r\n\t\t\t}\r\n\r\n\t\t\t// removing 'siteAccessTime' parameter that is used only for outside the LOGGED IN area\r\n\t\t\tsession.removeAttribute(\"siteAccessTime\");\r\n\t\t\t\r\n\r\n\t\t\tString userName = StringUtil.nullToEmpty(request.getParameter(\"userName\"));\r\n//\t\t\tString password = StringUtil.nullToEmpty(request.getParameter(\"password\"));\r\n\t\t\tString encryptedPassword = SecurityUtil.byteArrayToHexString(SecurityUtil.getEncryptedString((request.getParameter(\"password\")!= null ? request.getParameter(\"password\").toString()+userName : \"\")));\r\n\r\n\t\t\tboolean isAuthenticated = adminBO.login(userName, encryptedPassword);\r\n\r\n\t\t\tif (isAuthenticated){\r\n\r\n\t\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyyDDMM\");\r\n\t\t\t\tUserBean userBean = adminBO.getUserDetails(0, userName);\r\n\t\t\t\t\r\n\t\t\t\tlogger.info(\"\\nLOGINPAGE userID: \"+userBean.getUserID());\r\n\t\t\t\tlogger.info(\"\\nLOGINPAGE lastAccessTime: \"+userBean.getLastAccessTime());\r\n\t\t\t\tsession.setAttribute(\"userID\", userBean.getUserID());\r\n\t\t\t\tsession.setAttribute(\"userName\", userBean.getUserName());\r\n\t\t\t\tsession.setAttribute(\"userRole\", userBean.getRoleBean().getRoleID());\r\n\t\t\t\tsession.setAttribute(\"sessionAlive\", \"true\");\r\n\t\t\t\tsession.setAttribute(\"lastAccessTime\", userBean.getLastAccessTime());\r\n\t\t\t\t\r\n\t\t\t\tTimestamp loginTime = new Timestamp(new java.util.Date().getTime());\r\n\t\t\t\tString loginTimeStr = sdf.format(loginTime);\r\n\t\t\t\tsession.setAttribute(\"loginTime\", loginTimeStr);\r\n\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\tadminBO.updateUserSession(Integer.parseInt(userBean.getUserID()), session.getId(), loginTime/*, request.getRemoteHost(), */);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tStringBuffer requestString=new StringBuffer();\r\n\t\t\t\trequestString.append(\"formLastAccess=\"+loginTimeStr);\r\n\t\t\t\tString encryptedString = QueryCrypt.encrypt(request, requestString.toString());\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tActivityLogVO activityLogVO = new ActivityLogVO();\r\n\t\t\t\tactivityLogVO.setActivityDate(new Timestamp(new java.util.Date().getTime()));\r\n\t\t\t\tactivityLogVO.setActivityDesc(\"User Successfully LoggedIn\");\r\n\t\t\t\tactivityLogVO.setActivityTypeID(ActivityType.LOGIN_ACT.value());\r\n\t\t\t\tactivityLogVO.setReference(\"\");\r\n\t\t\t\tactivityLogVO.setSessionID(session.getId());\r\n\t\t\t\tactivityLogVO.setUserID(Integer.parseInt(StringUtil.nullOrEmptyToString(session.getAttribute(\"userID\"), \"0\")));\r\n\t\t\t\tadminBO.logActivity(activityLogVO);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tresponse.sendRedirect(\"Home?\"+encryptedString);\r\n\t\t\t\t\r\n\r\n\t\t\t} else{\r\n\t\t\t\tsession.setAttribute(\"LoginErrorMsg\", \"Invalid Username/Password, please try again\");\r\n\t\t\t\tresponse.sendRedirect(\"Login\");\r\n\r\n\t\t\t}\r\n\t\t}catch (Exception e) {\r\n\t\t\tlogger.error(\"ERROR\", e); \r\n\t\t\tresponse.sendRedirect(\"ErrorHandler\");\r\n\t\t}\r\n\t}", "@Override\n public void endRequest(HttpServletResponse httpServletResponse) {\n if (wasModified.get()) {\n Cookie newCookie = new Cookie(COOKIE_NAME, sessionId.get());\n newCookie.setPath(\"/\");\n httpServletResponse.addCookie(newCookie);\n }\n\n // -- Clear the threadlocals since we are now exiting this session --\n wasModified.remove();\n sessionId.remove();\n }", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException\n {\n HttpSession session = request.getSession(false);\n User user = (User)session.getAttribute(\"user\");\n \n if (session != null)\n {\n session.removeAttribute(\"user\");\n session.removeAttribute(\"lastLogin\");\n session.removeAttribute(\"applicationPath\");\n session.removeAttribute(\"webInfPath\");\n session.removeAttribute(\"groupsStoragePath\");\n session.removeAttribute(\"groupID\");\n session.invalidate();\n }\n \n response.setContentType(\"text/html;charset=UTF-8\");\n try (PrintWriter out = response.getWriter())\n {\n PHUtils.pageHeader(out);\n out.println(\"<meta HTTP-EQUIV=\\\"REFRESH\\\" content=\\\"1; url=\" + request.getContextPath() + \"/index.html\\\">\");\n out.println(\"<div class=\\\"alert alert-success\\\" align = \\\"center\\\">\");\n out.println(\" Arrivederci <strong>\"+ user.getUserName() +\"!</strong>.\");\n out.println(\"</div>\");\n PHUtils.pageFooter(out);\n }\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n doGet(request, response);\n HttpSession session = request.getSession(true);\n String name=\"User\";\n Usuario user= new Usuario(request.getParameter(\"name\"),request.getParameter(\"email\"),request.getParameter(\"password\"));\n session.setAttribute(name, user);\n Cookie idsession= new Cookie(\"idsession\",session.getId());\n response.addCookie(idsession);\n \n \n \n PrintWriter out=response.getWriter();\n \n out.println(\"<html>\");\n out.println(\"<head>\");\n out.println(\"<title>Registro</title>\");\n out.println(\"<meta charset='UTF-8'>\");\n out.println(\"<meta name='viewport' content='width=device-width, initial-scale=1.0'>\");\n out.println(\"<link href='css.css' rel='stylesheet' type='text/css'/>\");\n out.println(\"</head>\");\n out.println(\"<body>\");\n out.println(\"<div>\");\n out.println(\"<a href='login.html'>Ir a login</a>\");\n out.println(\"</div>\");\n out.println(\"</body>\");\n out.println(\"</html>\");\n \n \n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n RequestDispatcher view = request.getRequestDispatcher(\"/board/boardLogin.jsp\");\n Cookie[] cookies = request.getCookies();\n String userId=null;\n for(int i = 0; i< cookies.length;i++){\n Cookie cookie = cookies[i];\n if(cookie.getName().equals(\"userId\")){\n userId = cookie.getValue();\n break;\n }\n }\n if(request.getServletContext().getAttribute(\"connect\")==null){\n request.getServletContext().setAttribute(\"connect\",new Integer(0));\n }\n\n// int a[]={1,2,3,4,7,8,11,12,16,19,20,22,24,34,40,41};\n//\n// for(int j=0 ; j< a.length;j++){\n// if(Math.random()*10+1>5){\n// System.out.println(a[j]);\n// }\n//\n// }\n\n int connect = (Integer)request.getServletContext().getAttribute(\"connect\");\n\n request.getServletContext().setAttribute(\"connect\",new Integer(connect));\n\n request.setAttribute(\"userId\",userId);\n\n request.setAttribute(\"connect\",new Integer(connect));\n view.forward(request, response);\n\n }", "@Override\r\n public void getCookie(String name)\r\n {\n\r\n }", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tString code = req.getParameter(\"code\");\n\t\t\n\t\t//temporary code\n\t\tif(code.equals(\"jpoweradm\")) {\n\t\t\treq.getSession().setAttribute(\"STATUS\", \"AUTHENTICATED\");\n\t\t\t//production\n\t\t\tresp.sendRedirect(\"/upload.jsp\");\n\t\t\t//testing development\n//\t\t\tresp.sendRedirect(\"/jpower/upload.jsp\");\n\t\t} else {\n\t\t\treq.getSession().setAttribute(\"ERROR\", \"invalid security code\");\n\t\t\t//production\n\t\t\tresp.sendRedirect(\"/admin.jsp\");\n\t\t\t//testing development\n//\t\t\tresp.sendRedirect(\"/jpower/admin.jsp\");\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tString homeUrl= \"http://localhost/upload/login.php\";\r\n\t\tString loginUrl= \"http://localhost/upload/login.php?\";\r\n\t\tString postData= \"forward=&jumpurl=http%3A%2F%2Flocalhost%2Fupload%2Fthread.php%3Ffid%3D10&step=2&lgt=0&pwuser=admin&pwpwd=admin&hideid=0&cktime=31536000\";\r\n\t\t//String ResponseByLogin= new CommonHandler().sendPost(loginUrl, postData);\r\n\t\tnew HttpRequestor().sendGet(homeUrl);\r\n\t\tSystem.out.println(new HttpRequestor().mycookie);\r\n\t\tnew HttpRequestor().sendPost(loginUrl, postData);\r\n\t\tSystem.out.println(\"==============================\");\r\n\t\tSystem.out.println(new HttpRequestor().mycookie);\r\n\t\t\r\n\r\n\t}", "public void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n response.setContentType(\"text/html;charset=UTF-8\");\n \n try(PrintWriter out = response.getWriter()){\n \n String user = request.getParameter(\"text\");\n String pass = request.getParameter(\"password\");\n \n Cookie ck = new Cookie(\"auth\", user);\n ck.setMaxAge(600);\n \n DbConnect dbCon = new DbConnect();\n Connection connect = dbCon.getCon();\n \n PreparedStatement pst = connect.prepareStatement\n (\"SELECT Username, UserSecretCode FROM break.Users where Username=? and UserSecretCode=?\");\n \n pst.setString(1, user);\n pst.setString(2, pass);\n \n ResultSet rs = pst.executeQuery();\n \n if (rs.next()) {\n response.addCookie(ck);\n response.sendRedirect(\"index.html\");\n } else {\n RequestDispatcher rd = request.getRequestDispatcher(\"login.html\");\n rd.include(request, response);\n }\n } catch (SQLException ex) {\n \n Logger.getLogger(LoginServlet.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\ttry{\n\t\t\tCookie ck[]=request.getCookies();\n\t\t\tString user = ck[0].getValue();\n\t\t\t\n\t\t\tAdminDao adminDao = new AdminDaoImpl();\n\t\t\tAdmin admin = adminDao.getAdmin(user);\n\t\t\t//String username = request.getParameter(\"username\");\n\t\t\t//String pass = request.getParameter(\"password\");\n\t\t\tString submitType = request.getParameter(\"submit\");\n\t\t\t\n\t\t\t//Login login = new Login(username, pass);\n\t\t\t\n\t\t\tDoctorDao doctorDao = new DoctorDaoImpl();\n\t\t\tDoctor a = new Doctor();\n\t\t\t\n\t\t\tif(submitType.equals(\"register\")){\n\t\t\t\ta.setName(request.getParameter(\"name\"));\n\t\t\t\ta.setUsername(request.getParameter(\"username\"));\n\t\t\t\ta.setPassword(request.getParameter(\"password\"));\n\t\t\t\ta.setSpecialty(request.getParameter(\"Specialty\"));\n\t\t\t\ta.setInfo(request.getParameter(\"Info\"));\n\t\t\t\tdoctorDao.addDoctor(a);\n\t\t\t\t\n\t\t\t\t//SlotDao slotdao = new SlotDaoImpl();\n\t\t\t\t//slotdao.addSlot(new Slot(600,700,a.getID()));\n\t\t\t\t\n\t\t\t\trequest.setAttribute(\"successMessage\", \"Registration done, please login!\");\n\t\t\t\trequest.setAttribute(\"name\", admin.getName());\n\t\t\t\trequest.getRequestDispatcher(\"AdminHome.jsp\").forward(request, response);\n\t\t\t}}\n\t\tcatch(Exception e){System.out.println(\"Something went wrong\");}\n\t\t\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\n\t\t\r\n\t\t\r\n\t\tString id = \"방그리\";\r\n\t\t\r\n\t\tid = URLEncoder.encode(id, \"utf-8\");\r\n\t\t\r\n\t\tCookie cookie = new Cookie(\"loginId\", id);\r\n\t\tcookie.setMaxAge(60*60*24*30); // 단위는 초단위 \r\n\t\t//cookie.setDomain(\"http://www.naver.com\");\r\n//\t\tcookie.setPath(\"/\");\r\n\t\t\r\n\t\t//쿠키를 헤더에 밀어넣는 작업\r\n//\t\tresponse.setHeader(\"Set-Cookie\",\".......\");\r\n\t\t//밀어넣고~\r\n\t\tresponse.addCookie(cookie);\r\n\t\t// 보내주고~\r\n\t\tresponse.sendRedirect(\"hello2\");\r\n\t\t\r\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\t\tif (!isLoggedIn(request)) {\n\t\t\twriteLoginNeededInfo(response);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tJSONObject status = new JSONObject();\n\t\tPrintWriter out = response.getWriter();\n\t\t\n\t\ttry {\n\t\t\tIdentity id = parseIdentity(request);\n\t\t\tdao.update(id);\n\n\t\t\tstatus.put(\"status\", Integer.toString(HttpURLConnection.HTTP_OK));\n\t\t\tstatus.put(\"msg\", \"Identity updated! :)\");\n\t\t} catch (JSONException ex) {\n\t\t\tlogger.error(ex.toString());\n\t\t\t\n\t\t\tstatus.put(\"status\", Integer.toString(HttpURLConnection.HTTP_BAD_REQUEST));\n\t\t\tstatus.put(\"msg\", ex.toString());\n\t\t}\n\t\t\n\t\tout.print(status);\n\t}", "public void doPost (HttpServletRequest _req, HttpServletResponse _res)\n throws ServletException, IOException {\n session = _req.getSession();\n session.removeAttribute(\"loginError\");\n session.removeAttribute(\"submitError\");\n\n String action = _req.getParameter(\"action\");\n\n /* Authenticate user if request comes from login page */\n if (action.equals(\"login\")) {\n String uid = _req.getParameter(\"UID\");\n String pwd = _req.getParameter(\"PWD\");\n if (authenticate(uid, pwd)) {\n session.setAttribute(\"validUser\", \"y\");\n session.setAttribute(\"loginError\", \"n\");\n session.setAttribute(\"uid\", uid);\n gotoPage(\"/WEB-INF/jsp/ch5/census.jsp\", _req, _res);\n }\n /* If the user login fails, then return them to the login page to retry */\n else {\n loginError(_req, _res);\n }\n }\n\n /* Record the survey data if the request comes from the survey form */\n else if (action.equals(\"submit\")) {\n /* Make sure the user has logged in before recording the data */\n String validUser = (String) session.getAttribute(\"validUser\");\n if (validUser.equals(\"y\")) {\n if (recordSurvey(_req)) {\n /* Reset validUser flag and forward to ThankYou page */\n session.removeAttribute(\"validUser\");\n gotoPage(\"/WEB-INF/jsp/ch5/thankyou.jsp\", _req, _res);\n }\n else {\n session.setAttribute(\"submitError\", \"y\");\n gotoPage(\"/ch5/login.jsp\", _req, _res);\n }\n }\n /* If the user did not login, then send them to the login page */\n else {\n loginError(_req, _res);\n }\n }\n\n }", "@Override\n protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n resp.setContentType(\"text/html; charset=utf-8\");\n PrintWriter printWriter = resp.getWriter();\n if (req.getCookies() != null)\n for (int i = 0; i < req.getCookies().length; i++) {\n Cookie cookie = req.getCookies()[i];\n if (cookie.getName().equals(\"name\")) {\n printWriter.println(\"Hello \" + cookie.getValue());\n return;\n }\n printWriter.println(\"<html><head><title>My Servlet</title></head>\");\n printWriter.println(\"<body>\");\n printWriter.println(\"<p><h2>This is simple</h></p>\");\n printWriter.println(\"<p><h3>Servlet example.</h3></p>\");\n printWriter.println(\"<form method=\\\"post\\\">\");\n printWriter.println(\"<p>Give Name:<p><input name=\\\"name\\\"/><input type=\\\"submit\\\" value=\\\"OK\\\"/>\");\n printWriter.println(\"</form>\");\n printWriter.println(\"</body></html>\");\n }\n }", "@Override\n public void addCookie(Cookie arg0) {\n\n }", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tresp.setCharacterEncoding(\"utf-8\");\n\t\tresp.setContentType(\"text/html;charset=utf-8\");\n\t\tout=resp.getWriter();\n\t\tsession=req.getSession();\n\t\t//读取表单数据\n\t\tString usname=req.getParameter(\"usname\");\n\t\tString psword=req.getParameter(\"psword\");\n\t\tString yzm=req.getParameter(\"randomCode\");\n\t\t//是否Cookie登录\n\t\tString ck=req.getParameter(\"login\");\n\t\tif(ck==null){\n\t\t\tck=\"\";\n\t\t}\n\n\t\tif(\"ck\".equals(ck)){\n\t\t\tthis.loginNoCokie(usname, psword);\n\t\t\t//System.out.println(usname+\" \"+psword);\n\t\t\treturn;\n\t\t}\n\t\t//System.out.println(yzm);\n\t\t\n\t\tif(usname==null || psword==null || yzm==null){\n\t\t\tout.println(\"<script>\");\n\t\t\tout.println(\"alert(\\\"输入信息不能为空!\\\");\");\n\t\t\tout.println(\"window.location.href=\\\"login.jsp\\\";\");\n\t\t\tout.println(\"</script>\");\n\t\t\treturn;\n\t\t}\n\t\tif(\"\".equals(yzm) || \"\".equals(usname)){\n\t\t\tout.println(\"<script>\");\n\t\t\tout.println(\"alert(\\\"输入信息不能为空!\\\");\");\n\t\t\tout.println(\"window.location.href=\\\"login.jsp\\\";\");\n\t\t\tout.println(\"</script>\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//判断验证码,不正确直接pass\n\t\t\n\t\tString yzm2=(String)session.getAttribute(\"randomCode\");\n\t\t\n\t\tif(!(yzm.equals(yzm2))){\n\t\t\tout.println(\"<script>\");\n\t\t\tout.println(\"alert(\\\"验证码输入有误!\\\");\");\n\t\t\tout.println(\"window.location.href=\\\"login.jsp\\\";\");\n\t\t\tout.println(\"</script>\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//获取Cookie时效的参数\n\t\tString shixiao=req.getParameter(\"shixiao\");\n\t\t//处理有效性\n\t\tif(shixiao==null){\n\t\t\tshixiao=\"now\";\n\t\t}\n\t\t\n\t\t//根据不同的cookie时效,进行处理\n\t\tif(\"now\".equals(shixiao)){\n\t\t\tthis.loginNoCokie(usname, psword);\n\t\t}\n\t\t\n\t\tint age=0;\n\t\tif(\"week\".equals(shixiao)){\n\t\t\tage=60*60*24*7;\n\t\t\tthis.loginAddCokie(usname, psword, age, resp);\n\t\t}\n\t\t\n\t\tif(\"month\".equals(shixiao)){\n\t\t\tage=60*60*24*30;\n\t\t\tthis.loginAddCokie(usname, psword, age, resp);\n\t\t}\n\n\t\t\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tif(req.getCookies()==null) {\n\t\t\treq.getRequestDispatcher(\"CookiesDisabled.html\").include(req, resp);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tint empId=Integer.parseInt(req.getParameter(\"id\"));\n\t\tString empPass=req.getParameter(\"password\");\n\t\tSession session=HibernateUtil.openSession();\n\t\tServletContext ctx=getServletContext();\n\t\tEmployeeInfoBean emp=session.get(EmployeeInfoBean.class,empId);\n\t\tPrintWriter out=resp.getWriter();\n\t\tRequestDispatcher dispatcher=null;\n\t\tif((emp==null)&&(emp.getPassword().equals(empPass))) {\n\t\t\t//valid credentials; create a session\n\t\t\tHttpSession httpSession=req.getSession(true);\n\t\t\t\n\t\t\tresp.sendRedirect(\"search.jsp\");\n\t\t\thttpSession.setAttribute(\"data\", emp);\n\t\t\thttpSession.setAttribute(\"eid\",empId);\n\t\t\t\n\t\t}else {\n\t\t\tString url=\"/loginFail?msg=Invalid Credentials!!! please try again\";\n\t\t\tdispatcher=req.getRequestDispatcher(url);\n\t\t\tdispatcher.forward(req,resp);\n\t\t\n\t\t}\n\t\t\n\t\tctx.setAttribute(\"Eid\", empId);\n\t\t\n\t\t\n\t}", "private static void cookieMonster (HTTPRequest request)\n\t{\n\t /*if (!request.isCookiesParsed ())\n\t {\n\t \t retVal = request.cookieMonster ();\n\t }*/\n\t \n\t}", "@Override\n public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n if (request.getParameter(\"loginAttempt\") != null) {\n PrintWriter out = response.getWriter();\n //Check to see there is a username and password in case of corruption.\n if (request.getParameter(\"username\") != null && request.getParameter(\"password\") != null) {\n //Grab each\n String username = request.getParameter(\"username\");\n String password = request.getParameter(\"password\");\n\n try {\n //Always assume the worst.\n boolean exists = false;\n //Check to see if the user is valid\n String sql = \"SELECT * FROM admin\";\n String userName = username;\n PreparedStatement stmt = conn.prepareStatement(sql);\n\n rs = stmt.executeQuery();\n //Execute the query.\n while (rs.next()) {\n //Compare the username and password input to the database version.\n if (BCrypt.checkpw(password, rs.getString(\"password\")) && BCrypt.checkpw(userName, rs.getString(\"username\"))) {\n //There is a user!\n exists = true;\n \n }\n }\n //user is validated here\n if (exists == true) {\n //Create a key for the user to gain permission to index.jsp\n Cookie validateAdmin = new Cookie(\"validated\", \"true\");\n //Logs out after one hour.\n //This is just an autolog out feature. The user only needs to shut the window and it'll log itself out\n validateAdmin.setMaxAge(60 * 60 * 1);\n //Add the cookie\n response.addCookie(validateAdmin);\n //Send the user to index.jsp\n /*\n NOTE: If the server does not use virtual hosts or SSL you only need request.getContextPath()\n for some odd reason if you are using VH's and SSL you need request.getContextPath() + \"/\"\n + request.getContextPath()\n */\n response.sendRedirect(request.getContextPath());\n\n //If the user is not valid, send them an error page.\n } else {\n String logonTable = \"<html>\\n\"\n + \" <head>\\n\"\n + \" <title>Log into Admin Portal</title>\\n\"\n + \" <meta charset=\\\"UTF-8\\\">\\n\"\n + \" <meta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1.0\\\">\\n\"\n + \" <link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"css/loginStyle.css\\\" />\\n\"\n + \" </head>\\n\"\n + \" <body>\\n\"\n + \" <h1> Administrator Log In</h1>\\n\"\n + \" <h1> Bad password!</h1>\\n\"\n + \" <div class='left'></div>\\n\"\n + \" <div class='right'></div>\\n\"\n + \" <div class=\\\"SignIn fadeInRight\\\">\\n\"\n + \"\\n\"\n + \" <form action='LoginAdmin' method='POST'>\\n\"\n + \" <h2 style='padding-left: 175px;'> name</h2> \\n\"\n + \" <label>\\n\"\n + \" <input type='text' name='username'/>\\n\"\n + \" </label>\\n\"\n + \" <br>\\n\"\n + \" <h2 style='padding-left: 160px;'>password</h2> \\n\"\n + \" <label>\\n\"\n + \" <input type='password' name='password'/> \\n\"\n + \" </label>\\n\"\n + \" <label>\\n\"\n + \" <input type='hidden' name='loginAttempt' value ='loginAttempt'/>\\n\"\n + \" </label>\\n\"\n + \" <br><br>\\n\"\n + \" <div class='submit'>\\n\"\n + \" <input type='submit' />\\n\"\n + \" </div>\\n\"\n + \"\\n\"\n + \" </form>\\n\"\n + \" </div>\\n\"\n + \"\\n\"\n + \"\\n\"\n + \" </body>\\n\"\n + \"</html>\";\n out.println(logonTable);\n }\n } catch (SQLException ex) {\n Logger.getLogger(Login.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n //If there no parameters something weird happened, send them to doGet to resolve it.\n } else {\n doGet(request, response);\n }\n }", "public void part2(){\n Cookie c1 = new Cookie(\"uid\", \"2018\", 1800,false);\n Cookie c2 = new Cookie(\"PICK_KEY\", \"ahmd13ldsws8cw\",10800,true);\n Cookie c3 = new Cookie(\"REMEMBER_ME\",\"true\",10800,true);\n }", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n try {\r\n String username = request.getParameter(\"Username\");\r\n String password = request.getParameter(\"Password\");\r\n\r\n HttpSession session = request.getSession();\r\n List<User> userList = sql.selectAllUsers();\r\n\r\n Boolean validUser = false;\r\n Boolean IsAdmin = false;\r\n\r\n if (userList != null && userList.isEmpty() == false) {\r\n for (User user : userList) {\r\n if (user.getUsername().equals(username)\r\n && user.getPass().equals(password)) {\r\n LoginHistory newLoginHistory = new LoginHistory(user.getUsersID(),LocalDate.now().toString(),\"test123\");\r\n sql.createLoginHistory(newLoginHistory);\r\n if (user.getUserType().equals(\"Admin\")) {\r\n IsAdmin = true;\r\n break;\r\n }\r\n session.setAttribute(Session.LOGIN_USERNAME, user.getUsername());\r\n System.out.println(user.getUsername());\r\n validUser = true;\r\n break;\r\n }\r\n }\r\n }\r\n if (session.getAttribute(Session.SITE) != null) {\r\n goToSite = session.getAttribute(Session.SITE).toString();\r\n }\r\n\r\n if (validUser && goToSite.equals(\"ProfilePage\")) {\r\n session.setAttribute(\"LoginUsername\", username);\r\n session.setAttribute(Session.SITE, \"\");\r\n response.sendRedirect(\"User/ProfilePage.jsp\");\r\n } else if (validUser && goToSite.equals(\"PurchaseMethod\")) {\r\n session.setAttribute(\"LoginUsername\", username);\r\n session.setAttribute(Session.SITE, \"\");\r\n response.sendRedirect(\"User/PurchaseMethod.jsp\");\r\n } else if (validUser) {\r\n session.setAttribute(\"LoginUsername\", username);\r\n session.setAttribute(Session.SITE, \"\");\r\n response.sendRedirect(\"MainPage.jsp\");\r\n } else if (IsAdmin) {\r\n response.sendRedirect(\"Admin/AdminMainPage.jsp\");\r\n } else {\r\n response.sendRedirect(\"LoginPage.jsp\");\r\n }\r\n } catch (Exception ex) {\r\n Logger.getLogger(LoginServlet.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n String login = req.getParameter(\"login\");\n String password = req.getParameter(\"password\");\n if (logic.isExisting(login, password)) {\n HttpSession session = req.getSession();\n session.setAttribute(\"login\", login);\n if (logic.isAdmin(login)) {\n session.setAttribute(\"role\", \"admin\");\n }\n resp.sendRedirect(String.format(\"%s/\", req.getContextPath()));\n } else {\n req.setAttribute(\"error\", \"Credentional is invalid\");\n doGet(req, resp);\n }\n }", "private static void postLoginPage() {\n post(\"/login\", \"application/json\", (req, res) -> {\n HomerAccount loggedInAccount = homerAuth.login(req.body());\n if(loggedInAccount != null) {\n req.session().attribute(\"account\", loggedInAccount);\n res.redirect(\"/team\");\n } else {\n res.redirect(\"/login\");\n }\n return null;\n });\n }", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tObjectMapper mapper = new ObjectMapper();\n\t\tUsers inputUser = mapper.readValue(request.getInputStream(), Users.class);\n\t\tString username = inputUser.getUName();\n\t\tString password = inputUser.getPassword();\n\t\t\n\t\t\n\t\tPrintWriter writer = response.getWriter(); //initialize printwriter\n\t\tHttpSession session=request.getSession(); //initialize session\n \n\t\tUsers userCode = service.logIn(username, password);\n\t\t\n\t\tif(userCode.getValue() ==-1)\n\t\t{\n\t\t\tresponse.setStatus(200); //CREATED\n\t\t\tresponse.setContentType(\"application/text\");\n\t\t\t \n\t\t}\n\t\tif(userCode.getValue()==-2)\n\t\t{\n\t\t\tresponse.setStatus(200); //CREATED\n\t\t\tresponse.setContentType(\"application/text\");\n\t\t\t \n\t\t}\n\t\tif(userCode.getValue()==3 ||userCode.getValue()==4 )\n\t\t{\n\t\t\t\n\t\t\tsession.setAttribute(\"uid\",userCode.getUserID());\n\t\t\tsession.setAttribute(\"name\",userCode.getFName());\n\t\t\tsession.setAttribute(\"roleid\",userCode.getURole().getRoleID());\n\t\t\t\n\t\t\t//resource = \"/ers/ERequest.view\";\n\t\t\t//request.getRequestDispatcher(resource).forward(request, response);\n\t\t\t//response.sendRedirect(resource);\n\t\t\t//writer.write(\"Welcome Employee\"); \n\t\t}\n\t\tresponse.setStatus(200);\n\t\tresponse.setContentType(\"application/text\");\n\t\twriter.write(userCode.getValue()+\"\");\n\t\t\t\t\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n String idAcc = request.getParameter(\"idAcc\");\r\n String dateAcc = request.getParameter(\"dateAcc\");\r\n String timeAcc = request.getParameter(\"timeAcc\");\r\n String locationAcc = request.getParameter(\"locationAcc\");\r\n String departmentAcc = request.getParameter(\"departmentAcc\");\r\n String picAcc = request.getParameter(\"picAcc\");\r\n String participantAcc = request.getParameter(\"participantAcc\");\r\n String clientAcc = request.getParameter(\"clientAcc\");\r\n String accept = request.getParameter(\"accept\");\r\n\r\n if (\"true\".equals(accept)) {\r\n status = iic.save(idAcc, dateAcc, timeAcc, locationAcc, departmentAcc, picAcc, \"1\", participantAcc, clientAcc);\r\n } else {\r\n status = iic.save(idAcc, dateAcc, timeAcc, locationAcc, departmentAcc, picAcc, \"0\", participantAcc, clientAcc);\r\n }\r\n request.getSession().setAttribute(\"status\", status);\r\n\r\n processRequest(request, response);\r\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \tSystem.out.println(\"---here---value-\");\n processRequest(request, response);\n \n }", "public void handlePost( HttpExchange exchange ) throws IOException {\n switch( exchange.getRequestURI().toString().replace(\"%20\", \" \") ) {\n // the web client wants to submit a log in request\n case \"/log-in\":\n // get the body of the HttpExchange\n String body = getBody(exchange);\n print(\"BODY: \\n\" + body);\n if ( body.equals(\"-1\") == true) { // if the body is empty\n sendResponse(exchange, new byte[0], 204);\n // HTTP Response code 204 - no content\n } else {\n\n String[] content = body.split(\"&\");\n //pos 0 : username=<content>; pos 1 : password=<content>; pos 2 : <submit type>\n\n String username = content[0].split(\"=\")[1];\n String password = content[1].split(\"=\")[1];\n\n //check database\n if( username.equals(\"james\") && password.equals(\"123\")) {\n print(\"Username and Password Match\");\n sendResponse(exchange, getHTMLPage(\"/home.html\"), 200); // this will be changed to a redirect notice\n // set client as logged in\n logged_in = true;\n\n// sendResponse(exchange, getPanel(exchange, \"home.html\"), 200);\n } else {\n sendResponse(exchange, new byte[0], 406);\n // send HTTP Response code 406 - Not acceptable\n }\n }\n\n break;\n case \"/home\":\n\n default:\n print(\"Body:\");\n print( getBody(exchange) );\n sendResponse(exchange, htmlBuilder( \"Not Implemented\", \"Http Error 501: Not Implemented\").getBytes(), 501);\n break;\n }\n // got body response .. check form sending to - if form is login then get username and password combo\n }", "protected void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\tString vusuario = request.getParameter(\"usuario\");\n\t\tString vclave = request.getParameter(\"clave\");\n\t\tSystem.out.println(vusuario);\n\t\tSystem.out.println(vclave);\n\n\t\t// 2. \"validamos\" (creamos un poco de lógica)\n\t\tboolean ok = false;\n\t\tif (vusuario.equals(\"jose\") && vclave.equals(\"123\")){\n\t\t\tok = true;\n\t\t}\n\t\t\n\t\t// 3. Dependiendo del resultado de la validación invocamos a bienvenida.jsp o rebotamos a logueo.jsp\n\t\t// Para que un servlet pueda invocar a otro componente, usamos el famoso objeto RequestDispatcher (Despachador del request)\n\t\tif (ok == true) {\n\t\t\tSystem.out.println(\"Caso de éxito\");\n\t\t\t// Cargamos información adicional en el request, antes de despacharlo\n\t\t\tString nombre = \"José Luis :)\";\n\t\t\tCalendar c = Calendar.getInstance();\n\t\t\tc.set(1992, 1, 30);\n\t\t\tDate fecnac = c.getTime();\n\t\t\t// El primer parámetro representa el nombre del objeto a cargar en el request\n\t\t\t// El segundo parámetro es el objeto que estamos cargando en el request\n\t\t\trequest.setAttribute(\"nombre\", nombre);\n\t\t\trequest.setAttribute(\"fecha\", fecnac);\n\t\t\t\n\t\t\t// VERIFICAR SI EXISTE UNA SESIÓN ACTIVA, SI EXISTE LA MATAMOS\n\t\t\tif (request.isRequestedSessionIdValid()){\n\t\t\t\tHttpSession tempo = request.getSession(); // Apunta a la zona de memoria, da lo mismo poner true o false\n\t\t\t\ttempo.invalidate(); // Matamos la sesión\n\t\t\t\tSystem.out.println(\"La sesión murio :( \" + tempo);\n\t\t\t}\n\t\t\t\n\t\t\t// CREAMOS UNA SESIÓN NUEVA\n\t\t\tHttpSession lasesion = request.getSession(true); // Siempre va a crear la sesión, pues lo matamos anteriormente\n\t\t\tSystem.out.println(\"Id de la sesión: \" + lasesion.getId());\n\t\t\tSystem.out.println(\"Tiempo máximo de inactividad: \" + lasesion.getMaxInactiveInterval());\n\t\t\tSystem.out.println(\"La sesión es nueva? \" + lasesion.isNew()); // Retorna un booleano\n\t\t\t\n\t\t\t// CARGAMOS OBJETOS A LA SESIÓN\n\t\t\tlasesion.setAttribute(\"nombre\", nombre);\n\t\t\tlasesion.setAttribute(\"fecha\", fecnac);\n\t\t\t\n\t\t\tRequestDispatcher rd = request.getRequestDispatcher(\"/bienvenida.jsp\");\n\t\t\t// Despachamos\n\t\t\trd.forward(request, response);\n\t\t} else {\n\t\t\tSystem.out.println(\"Caso de error\");\n\t\t\t\n\t\t\t// Cargamos otros datos al request\n\t\t\tString mensaje = \"Usuario y/o clave erradas\";\n\t\t\t\n\t\t\trequest.setAttribute(\"mensaje\", mensaje);\n\t\t\tRequestDispatcher rd = request.getRequestDispatcher(\"/logueo.jsp\");\n\t\t\t\n\t\t\t// Despachamos\n\t\t\trd.forward(request, response);\n\t\t}\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\n\t\tString uname = request.getParameter(\"unamelog\");\n\t\tString pwd = request.getParameter(\"pwdlog\");\n\t\t\n\t\tif(uname==null||pwd==null) {\n\t\t\tloginFailure(request,response);\n\t\t\treturn;\n\t\t}\n\t\ttry(Connection con = dbRes.getConnection();\n\t\t\tPreparedStatement ps = con.prepareStatement(\"SELECT * FROM USERS WHERE USERNAME=? OR EMAIL=?\");){\n\t\t\tps.setString(1,uname);\n\t\t\tps.setString(2,uname);\n\t\t\ttry(ResultSet rs = ps.executeQuery();){\n\t\t\t\tif(rs.next()){\n\t\t\t\t\tif(BCrypt.checkpw(pwd, rs.getString(\"PWD_HASH\"))) {\n\t\t\t\t\t\trequest.getSession().setAttribute(\"user_id\", rs.getInt(\"USER_ID\"));\n\t\t\t\t\t\tif(rs.getString(\"HOTP_SERIAL\")!=null) {\n\t\t\t\t\t\t\tgetServletContext().getRequestDispatcher(\"/twoFA.jsp\").forward(request, response);;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\trequest.getSession().setAttribute(\"logged\", true);\n\t\t\t\t\t\t//request.setAttribute(\"message\",\"Succes\");\n\t\t\t\t\t\t//getServletContext().getRequestDispatcher(\"index.jsp\").forward(request, response);\n\t\t\t\t\t\t\tgetServletContext().getRequestDispatcher(\"/transactions\").forward(request, response);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//TO DO Forward to dashboard page\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tloginFailure(request,response);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tloginFailure(request,response);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tresponse.getWriter().append(e.getMessage());\t\t}\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n try {\r\n HttpSession session = request.getSession();\r\n String admin = session.getAttribute(\"admin\").toString();\r\n String referer = request.getHeader(\"Referer\");\r\n \r\n String question = request.getParameter(\"question\").trim();\r\n String answer = request.getParameter(\"answer\").toString();\r\n answer = answer.replaceAll(\"\\n\",\"<br />\");\r\n String action = request.getParameter(\"action\");\r\n if(action.equals(\"edit\")){\r\n int faqID = Integer.parseInt(request.getParameter(\"faqID\"));\r\n Faqs faqEdit = faqsFacade.find(faqID);\r\n \r\n faqEdit.setAnswer(answer);\r\n faqEdit.setQuestion(question);\r\n faqsFacade.edit(faqEdit);\r\n request.setAttribute(\"redirectMessage\", \"FAQs edited successful!\");\r\n }else if(action.equals(\"insert\")){\r\n Faqs faqInsert = new Faqs();\r\n faqInsert.setAnswer(answer);\r\n faqInsert.setQuestion(question);\r\n faqsFacade.create(faqInsert);\r\n request.setAttribute(\"redirectMessage\", \"FAQs insert successful!\");\r\n }\r\n request.setAttribute(\"redirectLink\", referer);\r\n request.getRequestDispatcher(\"../redirect.jsp\").forward(request, response);\r\n } catch (NumberFormatException | ServletException | IOException e) {\r\n response.sendRedirect(\"login.jsp\");\r\n return; // <--- Here.\r\n }\r\n processRequest(request, response);\r\n }", "@Override\n protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n // if request has language parameter save cookie\n String cookieLang = req.getParameter(\"lang\");\n if (cookieLang != null) {\n // request from changing the language, save cookie\n Cookie theCookie = new Cookie(\"MyDictionaryLanguage\", cookieLang);\n theCookie.setMaxAge(9999999 * 99);\n resp.addCookie(theCookie);\n RequestDispatcher dispatcher = req.getRequestDispatcher(\"/input.jsp\");\n dispatcher.forward(req, resp);\n }\n\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String acc = request.getParameter(\"acc\");\n String bank = request.getParameter(\"bank\");\n String email = request.getParameter(\"email\");\n Double txR = Math.random();\n\n String txRef = txR.toString();\n RaveConstant.ENVIRONMENT = Environment.STAGING;\n RaveConstant.PUBLIC_KEY = \"FLWPUBK-d8369e6826011f8a1f9f6c7c14a09b80-X\";\n RaveConstant.SECRET_KEY = \"FLWSECK-8abf446c71a58aaa858323f3a9ed156b-X\";\n try {\n AccountCharge ch = new AccountCharge();\n\n ch.setAccountbank(bank)\n .setAccountnumber(acc)\n .setEmail(email)\n .setTxRef(txRef)\n .setAmount(\"2000\")\n .setCountry(\"NG\")\n .setCurrency(\"NGN\");\n\n JSONObject charge = ch.chargeAccount();\n\n System.out.println(charge);\n JSONObject data = (JSONObject) charge.get(\"data\");\n String response_code = (String) data.get(\"chargeResponseCode\");\n\n if (charge.get(\"status\").equals(\"success\")) {\n {\n if (response_code.equals(\"02\")) {\n\n String flw = (String) data.get(\"flwRef\");\n HttpSession session = request.getSession(true);\n session.setAttribute(\"flwRef\", flw);\n session.setAttribute(\"payload\", ch);\n response.sendRedirect(\"Otp\");\n return;\n }\n else if (response_code.equals(\"00\")) {\n response.sendRedirect(\"Success\");\n return;\n \n }\n }\n } else {\n String message = (String) charge.get(\"message\");\n System.out.println(message);\n HttpSession session = request.getSession(true);\n session.setAttribute(\"message\", message);\n response.sendRedirect(\"401\");\n return;\n\n }\n\n } catch (JSONException ex) {\n }\n doGet(request, response);\n }", "String setRememberToken(HttpServletRequest request, HttpServletResponse response, String password, int maxAge, String domain, String path);", "@Override\n protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n if (Authentication.isAdminInDbByCookies(req)) {\n // Authentication.log(req.getCookies()[0].getValue() + \" - redirect to /admin/registration/registration.html\");\n req.getRequestDispatcher(\"/admin/registration/registration.html\")\n .forward(req, resp);\n\n } else {\n // Authentication.log(req.getCookies()[0].getValue() + \" - redirect to / . Error Authorization.\");\n resp.sendRedirect(\"/\");\n }\n\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n try (PrintWriter out = response.getWriter()) {\n\n HttpSession session = request.getSession(); //create session\n String userid = request.getParameter(\"userid\"); //get user input\n String passwordinput = request.getParameter(\"passwordinput\");\n \n Cookie cookie = new Cookie(\"userid\",userid); //add cookie\n cookie.setMaxAge(20*60); //cookie age is (number) * 60 seconds\n response.addCookie(cookie); //send cookie to client\n \n User userInput = new User(); //new user object\n userInput.setID(userid); //set user ID to User object\n userInput.setPassword(passwordinput); //set user password to User object\n \n LoginDao loginDao = new LoginDao(); //new login DAO \n String loginDaoReturn = loginDao.authenticateUser(userInput); //authenticate user\n\n MemberDAO member = new MemberDAO();\n\n PaymentDAO payments = new PaymentDAO();\n ClaimDAO claims = new ClaimDAO();\n \n boolean isAdmin = false;\n isAdmin = (boolean) session.getAttribute(\"isAdmin\");\n\n \n if(loginDaoReturn.equals(\"SUCCESS\")){ //if password and username matches\n User user = (User)member.getSingleById(userid);\n session.setAttribute(\"user\", user); //set User object as session wide attribute\n session.setAttribute(\"paymentlist\", payments.getRecordsById(user));\n session.setAttribute(\"claimlist\", claims.getClaimsById(user));\n \n response.sendRedirect(\"dashboard.jsp\");\n } \n else if(isAdmin){ //if user is an Admin\n \n session.setAttribute(\"claimlist\", claims.getAllClaims());\n session.setAttribute(\"userlist\", member.getAllRecords());\n session.setAttribute(\"paymentlist\", payments.getAllRecords());\n \n //set the tab view upon return\n session.setAttribute(\"home\", true);\n session.setAttribute(\"users\", false);\n session.setAttribute(\"claims\", false);\n session.setAttribute(\"search\", false);\n response.sendRedirect(\"admin/dashboard.jsp\");\n } \n else \n {\n session.setAttribute(\"error\", \"It appears that the username and password is wrong. Try again.\"); //set error message to be sent to index.jsp\n response.sendRedirect(\"/UWE_ESD\"); //redirect back to main page\n }\n }\n }", "@Override\r\n public void getAllCookies()\r\n {\n\r\n }", "public void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\t\tresponse.setContentType(\"text/html;charset=utf-8\");\n\t\tString value1 = \"\",value2 = \"\";\n\t\tCookie cookie = null;\n\t\tCookie[] cookies = request.getCookies();\n\t\tif (cookies != null) {\n\t\t\tfor (int i = 0; i < cookies.length; i++) {\n\t\t\t\tcookie = cookies[i];\n//\t\t\t\tSystem.out.println(cookie.getName());\n\t\t\t\tif (cookie.getName().equals(\"username\")) {\n\t\t\t\t\tvalue1 = cookie.getValue();\n\t\t\t\t}\n\t\t\t\tif (cookie.getName().equals(\"password\")) {\n\t\t\t\t\tvalue2 = cookie.getValue();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (value1.equals(\"admin\") && value2.equals(\"admin\")) {\n\t\t\t\tmessage = \"欢迎您!\" + value1 + \"再次登录该页面!\";\n\t\t\t\trequest.getSession().setAttribute(\"message\", message);\n\t\t\t\tresponse.sendRedirect(\"ch3/welcome.jsp\");\n\t\t\t} else {\n\t\t\t\tresponse.sendRedirect(\"ch3/Login.jsp\");\n\t\t\t}\n\t\t} else {\n\t\t\tresponse.sendRedirect(\"ch3/Login.jsp\");\n\t\t}\n\t}", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String sesion_med = dmmed.ObtenerCodigoSesion();\n Medico medico_sesion = dmmed.VerMedicoPorCodigo(sesion_med);\n String acceder = \"\";\n String accion = request.getParameter(\"accion\");\n if (accion.equalsIgnoreCase(\"Ingresar\")) {\n String codigo = request.getParameter(\"txcodigo\");\n String contraseña = request.getParameter(\"pass\");\n Medico medico = dmmed.Validar(codigo, contraseña);\n if (medico != null) {\n dmmed.AbrirSesion(codigo);\n request.setAttribute(\"medico\", medico);\n acceder = \"medico/interfaz.jsp\";\n } else {\n String mensaje = \"Codigo o contraseña incorrectas\";\n request.getSession().setAttribute(\"mensaje\", mensaje);\n acceder = \"medico/login.jsp\";\n }\n } else if (accion.equalsIgnoreCase(\"Regresar a la interfaz\")) {\n request.setAttribute(\"medico\", medico_sesion);\n acceder = \"medico/interfaz.jsp\";\n } else if (accion.equalsIgnoreCase(\"Buscar Citas\")) {\n String codigo_paciente = request.getParameter(\"codigo_pac\");\n ArrayList<Cita> lista = dmcit.VerCitaActual(codigo_paciente, sesion_med);\n request.setAttribute(\"lista\", lista);\n acceder = \"medico/realizar_cita.jsp\";\n } else if (accion.equalsIgnoreCase(\"Realizar Cita\")) {\n String mensaje = \"Fallo al realizar cita\";\n try {\n String codigo = request.getParameter(\"codigo\");\n String inf = request.getParameter(\"informe\");\n Cita cita = dmcit.VerCitaPorCodigo(codigo);\n if (cita != null) {\n Informe informe = dmcit.ObtenerInforme(codigo);\n if (informe != null) {\n boolean comprobar = dmcit.RealizarCita(cita);\n if (comprobar == true) {\n informe.setDescripcion(inf);\n mensaje = dminf.AgregarInforme(informe);\n } else {\n mensaje = \"Fallo al actualizar cita\";\n }\n } else {\n mensaje = \"Fallo al obtener informe\";\n }\n } else {\n mensaje = \"La cita no existe\";\n }\n } catch (Exception e) {\n mensaje = e.toString();\n }\n request.getSession().setAttribute(\"mensaje_cita\", mensaje);\n acceder = \"medico/realizar_cita.jsp\";\n } else if (accion.equalsIgnoreCase(\"Agendar Examen\")) {\n String alerta = \"Fallo para agendar examen\";\n try {\n int codigo = 0;\n String codigo_paciente = request.getParameter(\"codigo_paciente\");\n String codigo_medico = request.getParameter(\"codigo_medico\");\n String tipo_examen = request.getParameter(\"codigo_examen\");\n Date fecha = Date.valueOf(request.getParameter(\"fecha\"));\n String Orden = request.getParameter(\"orden\");\n\n Examen examen = new Examen(codigo, codigo_paciente, codigo_medico, tipo_examen, fecha);\n boolean comprobar_orden = dmtip.ComprobarOrden(tipo_examen);\n if (comprobar_orden == true) {\n if (Orden != null) {\n String tipo = dmtip.ObtenerTipo(tipo_examen);\n if (\"PDF\".equals(tipo)) {\n if (Orden.endsWith(\".pdf\")) {\n Orden = \"archivos/\" + Orden;\n examen.setOrden(Orden);\n alerta = dmexa.AgendarExamen(examen);\n } else {\n alerta = \"Orden incorrecta\";\n }\n } else if (\"IMG\".equals(tipo)) {\n if (Orden.endsWith(\".jpg\") || Orden.endsWith(\".png\") || Orden.endsWith(\".jepg\")) {\n Orden = \"archivos/\" + Orden;\n examen.setOrden(Orden);\n alerta = dmexa.AgendarExamen(examen);\n } else {\n alerta = \"Orden incorrecta\";\n }\n } else {\n alerta = \"Fallo en el codigo del Tipo de examen\";\n }\n } else {\n alerta = \"Es necesaria la orden y no esta agregada\";\n }\n } else {\n alerta = dmexa.AgendarExamen(examen);\n }\n } catch (Exception e) {\n alerta = e.toString();\n }\n request.getSession().setAttribute(\"alerta_e\", alerta);\n acceder = \"medico/agendar_examen.jsp\";\n } else if (accion.equalsIgnoreCase(\"Ver Historial\")) {\n Paciente paciente = dmpac.VerPacientePorCodigo(request.getParameter(\"codigo_paciente\"));\n request.setAttribute(\"paciente\", paciente);\n acceder = \"medico/reporte1.jsp\";\n } else if (accion.equalsIgnoreCase(\"Obtener Citas\")) {\n String fecha1 = request.getParameter(\"rep2fecha1\");\n String fecha2 = request.getParameter(\"rep2fecha2\");\n ArrayList<Cita> lista = dmcit.ReporteCitasEnIntervaloDeTiempo(sesion_med, fecha1, fecha2);\n request.setAttribute(\"lista\", lista);\n acceder = \"medico/reporte2.jsp\";\n } else if (accion.equalsIgnoreCase(\"Ver Citas\")) {\n String fecha = request.getParameter(\"rep3fecha\");\n ArrayList<Cita> lista = dmcit.ReportesCitasDiaActual(sesion_med, fecha);\n request.setAttribute(\"lista\", lista);\n acceder = \"medico/reporte3.jsp\";\n } else if (accion.equalsIgnoreCase(\"Obtener Conteo\")) {\n String fecha1 = request.getParameter(\"rep4fecha1\");\n String fecha2 = request.getParameter(\"rep4fecha2\");\n ArrayList<Informe> lista = dminf.ReportePacienteConMasInformes(sesion_med, fecha1, fecha2);\n request.setAttribute(\"lista\", lista);\n acceder = \"medico/reporte4.jsp\";\n } else if (accion.equalsIgnoreCase(\"Salir a la pagina principal\")){\n acceder = \"index.jsp\";\n }\n RequestDispatcher pagina = request.getRequestDispatcher(acceder);\n pagina.forward(request, response);\n }", "private void logout(HttpServletRequest request, HttpServletResponse response) throws IOException {\n\tCookie[] theCookieLoop=request.getCookies();\n\t\t\tif(theCookieLoop !=null) {\n\t\t\t\tfor(Cookie tempCookie:theCookieLoop) {\n\t\t\t\t\tif(\"checkLoginPageAdmin\".equals(tempCookie.getName())) {\n\t\t\t\t\t\ttempCookie.setValue(\"false\");\n\t\t\t\t\t\tresponse.addCookie(tempCookie);\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\tresponse.sendRedirect(\"admin/loginPageAdmin.jsp\");\n\t}", "public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\tdoGet(request, response);\n\t\tresponse.setContentType(\"text/html;charset=utf-8\");\n\t\tString name = request.getParameter(\"username\").trim();\n\t\tString psw = request.getParameter(\"password\").trim();\n\t\tif (!name.equals(\"admin\") || !psw.equals(\"admin\")) {\n\t\t\tmessage = \"用户名或口令不正确!请重试!\";\n\t\t\trequest.getSession().setAttribute(\"message\", message);\n\t\t\tresponse.sendRedirect(\"ch3/Login.jsp\");\n\t\t} else {\n\t\t\tif ((request.getParameter(\"check\")) != null && (request.getParameter(\"check\")).equals(\"check\")) {\n\t\t\t\tCookie nameCookie = new Cookie(\"username\", name);\n\t\t\t\tCookie pswCookie = new Cookie(\"password\", psw);\n\t\t\t\tnameCookie.setMaxAge(60 * 60);\n\t\t\t\tpswCookie.setMaxAge(60 * 60);\n\t\t\t\tresponse.addCookie(nameCookie);\n\t\t\t\tresponse.addCookie(pswCookie);\n\t\t\t}\n\t\t\tmessage = \"登陆成功!\";\n\t\t\trequest.getSession().setAttribute(\"message\", message);\n//\t\t\tresponse.sendRedirect(\"ch3/welcome.jsp\");\n\t\t\tresponse.getWriter().write(\"<script>window.location.href='ch3/welcome.jsp'</script>\");\n\t\t\treturn;\n\t\t}\n\t}", "private void userLogin(HttpServletRequest request, HttpServletResponse response) {\n\t\t\n\t}", "@Override\r\n protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n HttpSession session = req.getSession(true);\r\n //get session creation time\r\n Date createTime = new Date(session.getCreationTime());\r\n //get last access time of this web page \r\n Date lastAccessTime = new Date(session.getLastAccessedTime());\r\n\r\n String title = \"Welcome back to my website\";\r\n Integer visitCount = new Integer(0);\r\n String VistCountKey = new String(\"visitCount\");\r\n String userIDKey = new String(\"userID\");\r\n String userID = new String(\"ABCD\");\r\n //check if this is new comer on your web page \r\n if (session.isNew()) {\r\n title = \"welcoem to my website\";\r\n \r\n //set key and value like Cookie(key, value)\r\n session.setAttribute(userIDKey, userID);\r\n } else {\r\n visitCount = (Integer) session.getAttribute(VistCountKey);\r\n visitCount = visitCount + 1;\r\n userID = (String) session.getAttribute(userIDKey);\r\n }\r\n session.setAttribute(VistCountKey, visitCount);\r\n\r\n resp.setContentType(\"text/html\");\r\n PrintWriter out = resp.getWriter();\r\n out.println(\"<!DOCTYPE html>\");\r\n out.println(\"<html>\");\r\n out.println(\"<head>\"\r\n + \"<link href=\\\"resource/css/bootstrap.css\\\" rel=\\\"stylesheet\\\">\");\r\n out.println(\"<title>\" + title + \"</title>\");\r\n out.println(\"</head>\");\r\n out.println(\"<body>\");\r\n out.println(\"<h1 align = \\\"center\\\" >\" + title + \"</h1>\\n\");\r\n out.println(\"<h2 align = \\\"center\\\" > Session Information </h2>\\n\");\r\n out.println(\"<table align =\\\"center\\\" class=\\\"table table-bordered table-hover\\\">\\n\"\r\n + \"<tr>\"\r\n + \"<th>Session Info</th><th>value</th></tr>\\n\"\r\n + \"</tr>\\n\"\r\n + \"<tr>\\n\"\r\n + \"<td>id</td>\"\r\n + \"<td>\" + session.getId() + \"</td>\"\r\n + \"</tr>\\n\"\r\n + \"<tr>\\n\"\r\n + \"<td>Creation time</td>\"\r\n + \"<td>\" + createTime + \"</td>\"\r\n + \"</tr>\\n\"\r\n + \"<tr>\\n\"\r\n + \"<td>Time of last access</td>\"\r\n + \"<td>\" + lastAccessTime + \"</td>\"\r\n + \"</tr>\\n\"\r\n + \"<tr>\\n\"\r\n + \"<td>ID</td>\"\r\n + \"<td>\" + userID + \"</td>\"\r\n + \"</tr>\\n\"\r\n + \"<tr>\\n\"\r\n + \"<td>Number of visits</td>\"\r\n + \"<td>\" + visitCount + \"</td>\"\r\n + \"</tr>\\n\"\r\n + \"</tbale>\");\r\n out.println(\"<body>\");\r\n out.println(\"</body>\");\r\n out.println(\"</html>\");\r\n }", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tresponse.setContentType(\"text/html\");\r\n\t\tusername=request.getParameter(\"username\");\r\n\t\tpass=request.getParameter(\"password\");\r\n\t\tRequestDispatcher rd=null;\r\n\t\t\r\n\t\tif (username!=\"\" && username!=null && pass!=\"\" && pass!=null ) {\r\n\t\t\tif (username.equals(\"jahid\") && pass.equals(\"12345\")) {\r\n\t\t\t\t \r\n\t\t\t\t request.setAttribute(\"username\",\"jahid\");\r\n\t\t\t\t rd=request.getRequestDispatcher(\"Dashboard\");\r\n\t\t\t rd.forward(request, response);\r\n\t\t\t \r\n\t\t\t} else {\r\n\t\t\t\t\r\n\t\t\t\trequest.setAttribute(\"status\",\"Wrong Credentials\");\r\n\t\t\t\trd=request.getRequestDispatcher(\"LoginFails\");\r\n\t\t\t\trd.include(request, response);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\trequest.setAttribute(\"status\",\"Empty Input Fields\");\r\n\t\t\trd=request.getRequestDispatcher(\"LoginFails\");\r\n\t\t\trd.include(request, response);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\t\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t HttpSession session=request.getSession(); \n\t\tString username=request.getParameter(\"uname\");\n\t\t\n\t\tString password=request.getParameter(\"password\");\n\t\t\n\t\tString ip=request.getLocalAddr();\n\t\t\n\tSystem.out.println(\">>\"+username+\" \"+password+\" \"+ip);\n\t\n\tLoginService login=new LoginService();\n\tAdminLogin al=new AdminLogin();\n\tal.setName(username);\n\tal.setPassword(password);\n\tString resp=\"\";\n\ttry {\n\t\t resp=login.checkLogin(username,password,ip,session);\n\t}catch(Exception e) {\n\t\te.printStackTrace();\n\t}\n\tif(!resp.contains(\"NOK\")) {\n\t\t\n\t\t\n\t\tSystem.out.println(\"succefully login\");\n\t\t\n\t\tRandom rand = new Random(); \n\t\t \n \n session.setAttribute(\"uname\", username);\n int rand_int1 = rand.nextInt(1000);\n LinkedHashMap<String,Integer> lhm=new LinkedHashMap<String,Integer>();\n lhm.put(\"\"+rand_int1,rand_int1);\n System.out.println(lhm);\n //out.print(\"<a href='/CardDistributedSystem/test'>visit</a>\"); \n session.setAttribute(\"obj\", al);\n response.sendRedirect(\"/CardDistributedSystem/home.jsp\"); \n\t \n\t}\n\telse if(resp.contains(\"Invalid credentials\")) {\n\t\tSystem.out.println(\"not succefully login\");\n\t\trequest.setAttribute(\"StatusCode\",\"300\");\n\t\trequest.setAttribute(\"StatusMessage\",\"NOK\");\n\t\trequest.setAttribute(\"ErrorMessage\",\"Login with proper username and password!\");\n\t\trequest.getRequestDispatcher(\"index.jsp\").forward(request, response); \n\t}\n\telse {\n\t\tSystem.out.println(\"not succefully login\");\n\t\trequest.setAttribute(\"StatusCode\",\"300\");\n\t\trequest.setAttribute(\"StatusMessage\",\"NOK\");\n\t\trequest.setAttribute(\"ErrorMessage\",resp.split(\",\")[1]);\n\t\trequest.getRequestDispatcher(\"index.jsp\").forward(request, response); \n //response.sendRedirect(\"/CardDistributedSystem/index.jsp\"); \n\n\t}\n\t\t\n\n\t}", "@Override\r\n\tprotected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tthis.getServletContext().removeAttribute(\"msgs\");\r\n\t\tString operacao= request.getParameter(\"op\");\r\n\t\tif(operacao== null) {\r\n\t\t\tthis.getServletContext().setAttribute(\"msgs\", new String[]{\"Operação (op) não especificada na requisição!\"});\r\n\t\t\tresponse.sendRedirect(request.getHeader(\"Referer\"));\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tContatoController contatoCtrl= new ContatoController();\r\n\t\tOperadoraController operadoraCtrl = new OperadoraController();\r\n\t\t\r\n\t\tResultado resultado= null;\r\n\t\tString paginaSucesso= \"controller.do?op=conctt\";\r\n\t\tString paginaErro= \"../erro/erro.jsp\";\r\n\t\tString proxPagina= null;\r\n\t\t\r\n\t\tHttpSession session= request.getSession();\r\n\t\tUsuario usuario = (Usuario) session.getAttribute(\"usuario\");\r\n\t\t\r\n\t\tswitch(operacao) {\r\n\t\t\tcase\"login\":\r\n\t\t\t\tLoginController loginCtrl= new LoginController();\r\n\t\t\t\tpaginaSucesso= \"controller.do?op=conctt\";\r\n\t\t\t\tpaginaErro = \"login/login.jsp\";\r\n\t\t\t\tresultado= loginCtrl.isValido(request.getParameterMap());\r\n\t\t\t\tif(resultado.isErro()) {\r\n\t\t\t\t\trequest.setAttribute(\"msgs\", resultado.getMensagens());\r\n\t\t\t\t\tproxPagina= paginaErro;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tproxPagina= paginaSucesso;\r\n\t\t\t\t\tUsuario usuarioLogado = (Usuario) resultado.getEntidade();\r\n\t\t\t\t\tsession.setAttribute(\"usuario\",usuarioLogado);\r\n\t\t\t\t\t// trata o lembrar\r\n\t\t\t\t\tString lembrar= request.getParameter(\"lembrar\");\r\n\t\t\t\t\tif(lembrar != null) {\r\n\t\t\t\t\t\tCookie c= new Cookie(\"loginCookie\", usuarioLogado.getEmail());\r\n\t\t\t\t\t\tc.setMaxAge(3600*60);\r\n\t\t\t\t\t\tresponse.addCookie(c);\r\n\t\t\t\t\t} else{\r\n\t\t\t\t\t\tfor(Cookie cookie: request.getCookies()) {\r\n\t\t\t\t\t\t\tif(cookie.getName().equals(\"loginCookie\")) {\r\n\t\t\t\t\t\t\t\tcookie.setValue(null);\r\n\t\t\t\t\t\t\t\tcookie.setMaxAge(0);\r\n\t\t\t\t\t\t\t\tresponse.addCookie(cookie);\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase\"logout\":\r\n\t\t\t\tproxPagina = \"login/login.jsp\";\r\n\t\t\t\tresultado = new Resultado();\r\n\t\t\t\tresultado.setErro(false);\r\n\t\t\t\tsession.invalidate();\r\n\t\t\tbreak;\t\r\n\t\t\tcase \"cadctt\":\r\n\t\t\t\tresultado= contatoCtrl.cadastrar(request.getParameterMap(),usuario);\r\n\t\t\t\tif(!resultado.isErro()) {\r\n\t\t\t\t\tproxPagina = paginaSucesso;\r\n\t\t\t\t\trequest.setAttribute(\"msgs\", resultado.getMensagens());\r\n\t\t\t\t} else{\r\n\t\t\t\t\trequest.setAttribute(\"contato\", (Contato) resultado.getEntidade());\r\n\t\t\t\t\trequest.setAttribute(\"msgs\", resultado.getMensagens());\r\n\t\t\t\t\tproxPagina= \"contato/cadastro.jsp\";\r\n\t\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\tcase \"excctt\":\r\n\t\t\t\tresultado= contatoCtrl.excluir(request.getParameterMap());\r\n\t\t\t\tif(!resultado.isErro()) {\r\n\t\t\t\t\tproxPagina = paginaSucesso;\r\n\t\t\t\t\trequest.setAttribute(\"msgs\", resultado.getMensagens());\r\n\t\t\t\t} else{\r\n\t\t\t\t\trequest.setAttribute(\"contato\", (Contato) resultado.getEntidade());\r\n\t\t\t\t\trequest.setAttribute(\"msgs\", resultado.getMensagens());\r\n\t\t\t\t\tproxPagina= paginaErro;\r\n\t\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\tcase \"cadopera\":\r\n\t\t\t\tresultado= operadoraCtrl.cadastrar(request.getParameterMap());\r\n\t\t\t\tif(!resultado.isErro()) {\r\n\t\t\t\t\tproxPagina = \"controller.do?op=conoper\";\r\n\t\t\t\t\trequest.setAttribute(\"msgs\", resultado.getMensagens());\r\n\t\t\t\t} else{\r\n\t\t\t\t\trequest.setAttribute(\"operadora\", (Operadora) resultado.getEntidade());\r\n\t\t\t\t\trequest.setAttribute(\"msgs\", resultado.getMensagens());\r\n\t\t\t\t\tproxPagina= \"operadora/cadastro.jsp\";\r\n\t\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\tcase \"excopera\":\r\n\t\t\t\tresultado= operadoraCtrl.excluir(request.getParameterMap());\r\n\t\t\t\tif(!resultado.isErro()) {\r\n\t\t\t\t\tproxPagina = \"controller.do?op=conoper\";\r\n\t\t\t\t\trequest.setAttribute(\"msgs\", resultado.getMensagens());\r\n\t\t\t\t} else{\r\n\t\t\t\t\trequest.setAttribute(\"operadora\", (Operadora) resultado.getEntidade());\r\n\t\t\t\t\trequest.setAttribute(\"msgs\", resultado.getMensagens());\r\n\t\t\t\t\tproxPagina= \"controller.do?op=conoper\";\r\n\t\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\trequest.setAttribute(\"erro\", \"Operação não especificada no servlet!\");\r\n\t\t\t\tproxPagina= \"../erro/erro.jsp\";\r\n\t\t}\r\n\t\t\r\n\t\tif(resultado.isErro()){\r\n\t\t\t\tRequestDispatcher dispatcher= request.getRequestDispatcher(proxPagina);\r\n\t\t\t\tdispatcher.forward(request, response);\r\n\t\t}else{\r\n\t\t\tresponse.sendRedirect(proxPagina);\r\n\t\t}\r\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tSystem.out.println(req.getSession().getAttribute(\"attr\"));\n\t\treq.getSession().setAttribute(\"attr\", req.getParameter(\"session\"));\n\t\tSystem.out.println(req.getSession().getAttribute(\"attr\"));\n\t}", "@Override\n public void filter(ContainerRequestContext requestContext,\n ContainerResponseContext responseContext) throws IOException {\n HttpSession session = requestManager.getHttpSession();\n\n session.keepAlive();\n sessionManager.save(session);\n\n NewCookie sessionCookie = new NewCookie(COOKIE_NAME, session.getSessionId(),\n \"/\", null, null, -1, true, true);\n\n\n logger.trace(\"Request completed with session id {}\", sessionCookie);\n responseContext.getHeaders().add(HttpHeaders.SET_COOKIE, sessionCookie);\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String email = request.getParameter(\"email\");\n String pass = request.getParameter(\"password\");\n\n Account account = new AccountDAO().login(email, pass);\n if (account != null) {\n //add account to session\n response.getWriter().println(\"Login successfully\");\n request.getSession().setAttribute(\"account\", account);\n response.sendRedirect(\"home\");\n } else {\n// response.getWriter().println(\"Login failed\");\n response.sendRedirect(\"login\");\n }\n }", "@Override\n public void onAuthenticationSuccess(HttpServletRequest httpServletRequest,\n HttpServletResponse httpServletResponse,\n Authentication authentication)\n throws IOException, ServletException {\n HttpSession httpSession = httpServletRequest.getSession();\n httpSession.setMaxInactiveInterval(50000);\n\n\n\n\n System.out.println(\"Jab Ban: \" + httpServletRequest.getSession().getAttribute(\"EHAN_REDIRECT_URI\"));\n\n\n String redirectURI = (String) httpServletRequest.getSession().getAttribute(\"EHAN_REDIRECT_URI\");\n\n if (redirectURI == null)\n redirectURI = \"/\";\n\n\n for (GrantedAuthority grantedAuthority:\n authentication.getAuthorities()) {\n\n System.out.println(grantedAuthority.getAuthority());\n\n System.out.println(\"==============getDetails================\");\n System.out.println(authentication.getDetails());\n System.out.println(\"==============getPrincipal================\");\n System.out.println(authentication.getPrincipal());\n System.out.println(\"==============getCredentials================\");\n System.out.println(authentication.getCredentials());\n System.out.println(\"===============getAuthorities===============\");\n System.out.println(authentication.getAuthorities());\n System.out.println(\"===============getName===============\");\n System.out.println(authentication.getName());\n\n\n if (grantedAuthority.getAuthority().equals(\"ROLE_ADMIN\")) {\n redirectURI = \"/admin\";\n break;\n }\n else if (grantedAuthority.getAuthority().equals(\"ROLE_DBA\")) {\n redirectURI = \"/dba\";\n break;\n }\n else if (grantedAuthority.getAuthority().equals(\"ROLE_USER\")) {\n redirectURI = \"/user\";\n break;\n }\n \n }\n\n httpServletResponse.sendRedirect(redirectURI);\n\n }", "public void post(){\n\t\tHttpClient client = new HttpClient();\n\n\t\tPostMethod post = new PostMethod(\"http://211.138.245.85:8000/sso/POST\");\n//\t\tPostMethod post = new PostMethod(\"/eshopclient/product/show.do?id=111655\");\n//\t\tpost.addRequestHeader(\"Cookie\", cookieHead);\n\n\n\t\ttry {\n\t\t\tSystem.out.println(\"��������====\");\n\t\t\tint status = client.executeMethod(post);\n\t\t\tSystem.out.println(status);\n\t\t} catch (HttpException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n//\t\ttaskCount++;\n//\t\tcountDown--;\n\t}", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n resp.setContentType(\"text/html\");\n// PrintWriter out = resp.getWriter();\n// out.print(\"Beer Select Advice<br>\");\n//\n// resp.addHeader(\"foo\",\"bar\");\n// System.out.println(getServletConfig().getServletName());\n// out.print(\"<br>Got beer color \" + c);\n//\n//// Iterator iterator = list.iterator();\n//// while (iterator.hasNext()) {\n//// out.println(\"<br>\"+ iterator.next().toString()+\"<br>\");\n//// }\n// System.out.println(this.getServletInfo());\n// req.setAttribute(\"style\",list);\n// RequestDispatcher view = req.getRequestDispatcher(\"index.jsp\");\n// view.forward(req,resp);\n//\n// out.print(\"Status code is:\"+resp.getStatus());\n String mail = getServletConfig().getInitParameter(\"mail\");\n System.out.println(mail +\" and Servlet name: \"+getServletConfig().getServletName());\n\n logger.info(\"Servlet response info:\" + resp);\n\n //context input attr\n String attr = req.getParameter(\"attr\");\n //sending new request to server and new url\n //resp.sendRedirect(\"/Other\");\n System.out.println(\"Context param: \"+ getServletContext().getInitParameter(\"name\"));\n //req.getRequestDispatcher(\"/Other\").forward(req,resp);\n System.out.println(getServletContext().getServerInfo());\n getServletContext().log(\"Successful connection \");\n\n getServletContext().setAttribute(\"foo\",\"22\");\n getServletContext().setAttribute(\"bar\",\"42\");\n getServletContext().setAttribute(\"attr\",attr);\n\n\n PrintWriter out = resp.getWriter();\n out.print(getServletContext().getAttribute(\"foo\"));\n out.print(getServletContext().getAttribute(\"bar\"));\n out.print(getServletContext().getAttribute(\"attr\"));\n\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n HttpSession sessao = request.getSession();\n Usuario User =(Usuario) sessao.getAttribute(\"User\");\n \n if(request.getParameter(\"acao\").equals(\"ENTRAR\")) {\n String login = request.getParameter(\"login\");\n String pswd = request.getParameter(\"senha\");\n if(Login(login,pswd,request,response)){\n response.sendRedirect(\"PokeCenter_Perfil.jsp\");\n }else{\n response.sendRedirect(\"home.jsp\");\n }\n }else if(request.getParameter(\"acao\").equals(\"UpdateUser\")){\n UpdateUser(request,response,User);\n }else if(request.getParameter(\"acao\").equals(\"CriaUser\")){\n CriaUser(request,response);\n }else if(request.getParameter(\"acao\").equals(\"Deslogar\")){\n sessao.invalidate();\n response.sendRedirect(\"home.jsp\");\n }\n }", "void addCookie(HttpServletResponse response, Cookie cookie);", "public void doPost(HttpServletRequest request,\r\n HttpServletResponse response)\r\n throws IOException, ServletException\r\n {\r\n response.setContentType(\"text/html\");\r\n PrintWriter out = response.getWriter(); \r\n CookieUtil PkCookie = new CookieUtil();\r\n String vPID = PkCookie.getCookie(request,\"PID\");\r\n if(vPID==null)\r\n {\r\n out.println(WebUtil.IllegalEntry());\r\n return;\r\n }\r\n int nMsgID=-1;\r\n String errMsg=null; \r\n String nLangID=null;\r\n String nUserID=null;\r\n nUserID = Parse.GetValueFromString( vPID, \"UserID\" );\r\n nLangID = Parse.GetValueFromString( vPID, \"LangID\" );\r\n\r\n String ordtempl = request.getParameter(\"ordtempl\");\r\n String logoname = request.getParameter(\"logoname\");\r\n String cname = Parse.formatStr(request.getParameter(\"text1\"));\r\n String tname = Parse.formatStr(request.getParameter(\"text2\"));\r\n String addr = Parse.formatStr(request.getParameter(\"text3\"));\r\n String billaddrid = request.getParameter(\"billaddr_id\");\r\n String shipaddrid = request.getParameter(\"shipaddr_id\");\r\n String odateflg = request.getParameter(\"odateflg\");\r\n String note[] = request.getParameterValues(\"note\");\r\n String Instruct[] = request.getParameterValues(\"Instruct\");\r\n String rem1[] = request.getParameterValues(\"rem1\");\r\n String rem2[] = request.getParameterValues(\"rem2\");\r\n String rem3[] = request.getParameterValues(\"rem3\");\r\n String billid = request.getParameter(\"billid\");\r\n String shipid = request.getParameter(\"shipid\");\r\n String Inst = Parse.formatStr(request.getParameter(\"Inst\"));\r\n String remark1 = Parse.formatStr(request.getParameter(\"remark1\"));\r\n String remark2 = Parse.formatStr(request.getParameter(\"remark2\"));\r\n String remark3 = Parse.formatStr(request.getParameter(\"remark3\"));\r\n String notes = Parse.formatStr(request.getParameter(\"notes\"));\r\n String vAliasName = request.getParameter(\"vAliasName\");\r\n\r\n Statement stmt = null;\r\n Connection conn = null;\r\n ResultSet rs = null;\r\n \r\n DBConnect db = new DBConnect();\r\n Valid val = new Valid();\r\n Message msg = new Message(); \r\n\r\n try\r\n {\r\n conn = db.GetDBConnection();\r\n stmt = conn.createStatement(); \r\n String query = \"INSERT INTO T_ClsTemplDel( Ref_ID, Templ_Name, Text1, Text2, \"+\r\n \" Text3, Text4, Text5, Text6, Text7, Text8, Text9, Text10, \"+\r\n \" Flag1, Flag2, Flag3, Flag4, Flag5, Flag6, Flag7, Flag8, Flag9,\"+\r\n \" Flag10, num1, num2, num3, Alias_Name ) \" +\r\n \" VALUES (\"+nUserID+\",\"+val.IsNull(ordtempl)+\",\"+\r\n \" \"+val.IsNull(tname)+\" ,\"+val.IsNull(logoname)+\",\"+\r\n \" \"+val.IsNull(cname)+\",\"+val.IsNull(notes)+\",\"+\r\n \" \"+val.IsNull(remark1)+\",\"+val.IsNull(remark2)+\",\"+\r\n \" \"+val.IsNull(remark3)+\",null,\"+\r\n \" \"+val.IsNull(addr)+\",\"+val.IsNull(Inst)+\",\"+\r\n \" \"+odateflg+\",\"+billid+\",\"+shipid+\",\"+note[0]+\",\"+\r\n \" \"+Instruct[0]+\",\"+rem1[0]+\",\"+rem2[0]+\",\"+rem3[0]+\",null,null,\"+\r\n \" \"+val.IsNull(billaddrid)+\",\"+val.IsNull(shipaddrid)+\",null,\"+\r\n \" \"+val.IsNull(vAliasName)+\")\";\r\n stmt.executeUpdate(query);\r\n nMsgID = 3;\r\n }catch(SQLException sexe){errMsg=sexe.getMessage();nMsgID=6;}\r\n finally\r\n {\r\n try\r\n {\r\n if(stmt!=null)\r\n stmt.close();\r\n if(conn!=null) \r\n conn.close();\r\n }catch(SQLException sexe){}\r\n }\r\n if( nMsgID <= 5 )\r\n {\r\n response.sendRedirect(\"/ordhtm/del.html\");\r\n \r\n }\r\n else\r\n out.println(WebUtil.ShowException(errMsg, nMsgID, nLangID));\r\n }", "public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\tString userName = request.getParameter(\"adminID\");//取得用户名\n\t\tString password = request.getParameter(\"adminPswd\");//取得密码\n\t\tString returnUri = request.getParameter(\"return_uri\");\n\t\trequest.getSession().setAttribute(\"userID\", userName);\n\t\t\n\t\tDBUtil db = new DBUtil();//构建数据库对象\n\t\tboolean canLogin = db.loginSuccess(userName, password);\n\t\t\n\t\tRequestDispatcher rd = null;\n\t\tif (canLogin) {\n\t\t\trequest.getSession().setAttribute(\"flag\", \"login_success\");\n\t\t\tif (returnUri != null) {\n\t\t\t\trd = request.getRequestDispatcher(returnUri);\n\t\t\t\trd.forward(request, response);\n\t\t\t}else {\n\t\t\t\trd = request.getRequestDispatcher(\"index.jsp\");\n\t\t\t\trd.forward(request, response);\n\t\t\t}\n\t\t}else {\n\t\t\tresponse.sendRedirect(\"back.jsp\");\n\t\t\trequest.getSession().setAttribute(\"flag\", \"login_error\");\n\t\t\trd = request.getRequestDispatcher(\"login.jsp\");\t\t\t\t\n\t\t\trd.forward(request, response);\n\t\t}\n\t}", "private void createLoginCookie(HttpServletResponse response, String userName, String password) {\n Cookie appCookie = new Cookie(\"costsManager\", userName + \"_\" + password);\n appCookie.setMaxAge(99999);\n response.addCookie(appCookie);\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\n response.setContentType(\"text/html\");\r\n PrintWriter writer = response.getWriter();\r\n String userName = request.getParameter(\"userName\");\r\n HttpSession session = request.getSession();\r\n if (userName != \"\" && userName != null){\r\n \r\n session.setAttribute(\"savedUserName\", userName);\r\n }\r\n \r\n writer.println(\" Request parameter has username as \" + userName);\r\n writer.println(\" Session parameter has username \" + (String) session.getAttribute(\"savedUserName\"));\r\n //out.println(\"Hello \" + userName);\r\n \r\n }", "HttpClientRequest addCookie(Cookie cookie);", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {\n\t\t\r\n\t}", "public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\t\tHttpSession session =request.getSession();\n\t\t\n\t \tif((String)session.getAttribute(\"user\")==null)\n\t response.sendRedirect(\"LoginForm.jsp?status=Session Expired\");\n\t \n\t String page=\"\";\n\t/* \n\t \tif(((String)session.getAttribute(\"role\")).equals(\"user\"))\n\t \t{\n\t \t page=\"userhome.jsp\";\n\t \t }else if(((String)session.getAttribute(\"role\")).equals(\"admin\")){\n\t \t page=\"adminhome.jsp\"; \n\t \t}\n\t \t else\n\t \t\t page=\"LoginForm.jsp?status=Session Expired\";\n\t */\n\t \tString target=\"Changepassword.jsp?status=Password Changed Failed\";\n\t \t\tProfile rb=new Profile(); \n\t rb.setPassword(request.getParameter(\"oldpassword\")); \n\t rb.setLoginID(request.getParameter(\"username\")); \n\t rb.setNewPassword(request.getParameter(\"newpassword\")); \n\t \n\t boolean flag=new SecurityDAO().changePassword(rb); \n\t \n\t if(flag) \n\t target=\"DeveloperHome.jsp?status=Password Changed Successfully\"; \n\t else \n\t target=\"DeveloperHome.jsp?status=Password Changed Failed\"; \n\t RequestDispatcher rd = request.getRequestDispatcher(target);\n\t rd.forward(request,response);\n\t}", "private String getAppCookieValue(HttpServletRequest request) {\n Cookie[] cookies = request.getCookies();\n if (cookies != null) {\n for (Cookie cookie : cookies) {\n if(cookie.getName().equals(\"costsManager\"))\n return cookie.getValue();\n }\n }\n return \"\";\n }", "@Override\n\t\tpublic void addCookie(Cookie cookie) {\n\t\t\t\n\t\t}", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n PrintWriter out = response.getWriter();\n int postId = Integer.parseInt(request.getParameter(\"post_id\"));\n AdminDatabaseService_Service adminService = new AdminDatabaseService_Service();\n AdminDatabaseService port = adminService.getAdminDatabaseServicePort();\n if (request.getParameter(\"DELETE\") != null) {\n \n int success = port.deleteDupFlixData(postId);\n if(success==1){\n out.println(\"<script type=\\\"text/javascript\\\">\");\n out.println(\"alert('Deleted Successfully');\");\n out.println(\"</script>\"); \n request.getRequestDispatcher(\"ManageIndex.jsp\").forward(request, response); \n }else{\n out.println(\"<script type=\\\"text/javascript\\\">\");\n out.println(\"alert('Some error occured. Please try after sometime.');\");\n out.println(\"</script>\"); \n request.getRequestDispatcher(\"ManageIndex.jsp\").forward(request, response); \n }\n }else if (request.getParameter(\"UPDATE\") != null) {\n Dupflix flix = new Dupflix();\n \n flix = port.getDupFlixData(postId);\n \n \n request.setAttribute(\"dupFlix\", flix);\n \n request.getRequestDispatcher(\"AdminUpdateIndex.jsp\").forward(request, response); \n }\n }", "protected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {\n String lastName = req.getParameter(\"lastName\");\n// String age = req.getParameter(\"age\");\n\n if (LAST_NAME.equals(lastName)) {\n HttpSession session = req.getSession(true);\n session.setAttribute(\"user_in\", lastName);\n } else {\n JOptionPane.showMessageDialog(null, \"Only one user registered: Tagirov\");\n }\n res.sendRedirect(\"index.jsp\");\n }", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t \t SCLogBo provider=new SCLogBo();\r\n\t \t String mail=request.getParameter(\"u_email\");\r\n\t \t String password=request.getParameter(\"u_pass\");\r\n\t \t provider.setMail(mail);\r\n\t \t provider.setPassword(password);\r\n\t \t \r\n\t \t //Session management\r\n\t \t HttpSession session=request.getSession();\r\n\t \t session.setAttribute(\"providerLog\",provider);\r\n\t \t \r\n\t \t //Validate user in DB \r\n\t \t ServiceCentreDao dao=DaoFactory.getServiceCentreImp();\r\n\t \t boolean status=dao.validate(provider);\r\n\t \t \r\n\t \t //Checking user exist or not\r\n\t \t if(status){\r\n\t \t\t RequestDispatcher rd=request.getRequestDispatcher(\"JSP/scHome.jsp\");\r\n\t \t\t rd.forward(request,response);\r\n\t \t\t }else{\r\n\t \t\t RequestDispatcher rd=request.getRequestDispatcher(\"JSP/scLoginErr.jsp\");\r\n\t \t\t rd.include(request,response);\r\n\t \t }\t\t\r\n\t}", "@Override\n\tpublic void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)\n\t\t\tthrows IOException, ServletException {\n\t\tHttpServletRequest req=(HttpServletRequest) request;\n\t\tHttpServletResponse resp=(HttpServletResponse) response;\n\t\tCookie[] Cookies=req.getCookies();\n\t\t//System.out.println(\"jump\");\n\t\t\tboolean name=false;\n\t\t\tboolean pass=false;\n\t\t\tif(Cookies!=null){\n\t\t\tfor(Cookie c:Cookies){\n\t\t\t\tif(c.getName().equals(\"name\")){\n\t\t\t\t\tif(c.getValue().equals(\"user\")){\n\t\t\t\t\t\tname=true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(Cookie c:Cookies){\n\t\t\t\tif(c.getName().equals(\"pass\")){\n\t\t\t\t\tif(c.getValue().equals(\"pass\")){\n\t\t\t\t\t\tpass=true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t}\n\t\t\tif(name&&pass){\n\t\t\t resp.sendRedirect(\"autosuccess.html\");\n\t\t }\n\t\t\t\n\t\t System.out.println(\"not\");\n\t\t chain.doFilter(request, response);\n\t\t //req.getRequestDispatcher(\"autologin.html\").forward(request, response);\n\t\t\t\n\t}", "public void doGet(HttpServletRequest req,HttpServletResponse res) throws IOException {\n\tint k=0;\n\tCookie cook[]=req.getCookies();\n\tfor(Cookie c:cook) {\n\t\tif(c.getName().equals(\"k\")) {\n\t\t\tk=Integer.parseInt(c.getValue());\n\t\t}\n\t}\n\t\tk=k*k;\n\t\t// prints data on web page\n\t\tPrintWriter out= res.getWriter();\n\t\t\n\t\tout.println(\"Squaring Servlet \"+k);\n\t\t\n\tSystem.out.println(\"Sentt\");\n\t}", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n request.setCharacterEncoding(\"UTF-8\");\n String command = request.getParameter(\"command\");\n Staff s = new Staff();\n HttpSession session = request.getSession();\n String url = \"\";\n switch (command) {//String tenKH, String matKhau, String diaChi, String email, String sdt\n case \"login\":\n s = s.Login((Integer.parseInt(request.getParameter(\"manv\"))), request.getParameter(\"pass\"));\n if (s != null) {\n session.setAttribute(\"user\", s);//user tự đặt tại đây, tiếp tục tại header \n url = \"/index.jsp\";\n } else {\n url = \"/login.jsp\";\n session.setAttribute(\"loi\", \"ID và Password error\");\n }\n System.out.println(\"login success\");\n RequestDispatcher rd = getServletContext().getRequestDispatcher(url);\n rd.forward(request, response);\n break;\n case \"changepassword\":\n System.out.println(\"fisrt changepassword\");\n //Staff s2 = null;\n if (session.getAttribute(\"user\") != null) {\n s = (Staff) session.getAttribute(\"user\");\n }\n // lam sao get gia tri cua bien moi dang nhap.(=>dựa vào sesstion, login xong get value len, use attribute.)\n String a = \"\";\n String b = \"\";\n if (s != null) {\n a = s.getMaNV(); // null nè, h moi get dc ne.\n b = s.getpW();// null nè \n System.out.println(\"gia tri cua a\" + a);\n String passcu = request.getParameter(\"passcu\");\n System.out.println(passcu);\n String passmoi = request.getParameter(\"passmoi\");\n String nhaplaipassmoi = request.getParameter(\"nhaplaipassmoi\");\n if (passcu.equals(b)) {\n if (nhaplaipassmoi.equals(passmoi)) {\n s.ChangePassword(a, nhaplaipassmoi);\n url = \"/success.jsp\";\n } else {\n url = \"/changepassword.jsp\";\n session.setAttribute(\"errordoipass\", \"change pass error!\");\n }\n } else {\n url = \"/changepassword.jsp\";\n session.setAttribute(\"errordoipass\", \"change pass error!\");\n }\n } else {\n response.sendRedirect(\"back.jsp\");\n }\n RequestDispatcher rd2 = getServletContext().getRequestDispatcher(url);\n rd2.forward(request, response);\n break;\n case \"updateinfo\":\n request.setCharacterEncoding(\"utf-8\");\n response.setCharacterEncoding(\"utf-8\");\n String ho = request.getParameter(\"ho\");\n String ten = request.getParameter(\"ten\");\n String ngaysinh = request.getParameter(\"ngaysinh\");\n String sex = request.getParameter(\"sex\");\n String cmnd = request.getParameter(\"cmnd\");\n String status = request.getParameter(\"status\");\n if (session.getAttribute(\"user\") != null) {\n s = (Staff) session.getAttribute(\"user\");\n }\n // lam sao get gia tri cua bien moi dang nhap.(=>dựa vào sesstion, login xong get value len, use attribute.)\n String manv = \"\";\n if (s != null) {\n manv = s.getMaNV(); // null nè, h moi get dc ne.\n s.UpdateStaff(manv, ho, ten, ngaysinh, sex, cmnd, status);\n url = \"/success.jsp\";\n } else {\n // do something!\n }\n RequestDispatcher rd3 = getServletContext().getRequestDispatcher(url);\n rd3.forward(request, response);\n break;\n }\n\n // \n }", "@Override\n public void beginRequest(HttpServletRequest httpServletRequest) {\n String cookieValue = getCurrentCookieValue(httpServletRequest, COOKIE_NAME);\n if (cookieValue == null) {\n int sessionNumber = secureRandom.nextInt(Integer.MAX_VALUE);\n sessionId.set(\"session-\" + Integer.toString(sessionNumber));\n wasModified.set(true);\n } else {\n sessionId.set(cookieValue);\n wasModified.set(false);\n }\n }", "@Override\r\n public boolean preHandle(HttpServletRequest request,\r\n HttpServletResponse response, Object handler) throws Exception {\n \r\n String servletContext = \"http://\"+request.getServerName()+\":\"+request.getLocalPort()+request.getContextPath();\r\n \r\n \r\n// logger.info(servletContext);\r\n// if(!MRNSystemConstant.SYSTEM_URI_LOGIN.equals(request.getServletPath()) && !MRNSystemConstant.SYSTEM_URI_WELCOME.equals(request.getServletPath())\r\n// \t\t&& !\"/json/raiseInvalidSessionError.do\".equals(request.getServletPath()) && !\"/view/raiseInvalidSessionError.do\".equals(request.getServletPath())\r\n// \t\t&& !\"/logout.do\".equals(request.getServletPath()) && !\"/requestedURLNotSupported.do\".equals(request.getServletPath()) && !\"/json/raiseSystemInternalError.do\".equals(request.getServletPath())\r\n// \t\t&& !request.getRequestURL().toString().contains(MRNSystemConstant.SYSTEM_URI_ALLOTMENT_REQUEST) && !\"/json/raiseNoAuthorityError.do\".equals(request.getServletPath()))\r\n// {\r\n// \t\r\n// \tUserObject userObj = (UserObject) request.getSession().getAttribute(\"USER\");\r\n// \t\r\n// \tif(request.getSession().isNew() || userObj == null)\r\n// \t{\r\n// \t\t\r\n// \t\tif(request.getServletPath().indexOf(MRNSystemConstant.SYSTEM_URI_CONTENT_JSON) != -1)\r\n// \t\t{\r\n// \t\t\tresponse.sendRedirect(request.getContextPath()+\"/json/raiseInvalidSessionError.do\");\r\n// \t\t}\r\n// \t\telse if(request.getServletPath().indexOf(MRNSystemConstant.SYSTEM_URI_CONTENT_VIEW) != -1)\r\n// \t\t{\r\n// \t\t\tresponse.sendRedirect(request.getContextPath()+\"/view/raiseInvalidSessionError.do\");\r\n// \t\t}\r\n// \telse\r\n// \t{\r\n// \t\tif(!\"/main.do\".equals(request.getServletPath()))\r\n// \t\t{\r\n// \t\t\t//response.sendRedirect(request.getContextPath()+\"/json/raiseInvalidSessionError.do\");\r\n// \t\tresponse.sendRedirect(request.getContextPath()+\"/requestedURLNotSupported.do\");\r\n// \t\tlogger.error(\"Invalid url\");\r\n// \t\t//request.getSession().invalidate();\r\n// \t\t}\r\n// \t\telse\r\n// \t\t{\r\n// \t\t\t//if main is called then check if session is expired in main and then display error message with login link \r\n// \t\t\t//else dont show the link to login.\r\n// \t\t\tresponse.sendRedirect(request.getContextPath()+\"/view/raiseInvalidSessionError.do\");\r\n// \t\t}\r\n// \t\t\r\n// \t}\r\n// \t\t\r\n// \t\treturn false;\r\n// \t}\r\n \t\r\n \t//System.out.println(\"MRNContext : \"+mrnContext);\r\n \t//mrnContext.setScreenCd(\"MBPPPP\");\r\n// \tString screenCd = request.getParameter(MRNSystemConstant.SYSTEM_FORM_FIELD_SCREEN_CD);\r\n// \t\r\n// \tif(StringUtil.isEmpty(screenCd))\r\n// \t{ \t\t\r\n// \t\tresponse.sendRedirect(request.getContextPath()+\"/view/requestedScreenCdMissing.do\");\r\n// \t\t\r\n// \t} \r\n \t\r\n \tmrnContext.setScreenCd(\"Test\");\r\n \t\r\n \t\r\n// }\r\n \r\n// String screenCd = request.getParameter(MRNSystemConstant.SYSTEM_FORM_FIELD_SCREEN_CD);\r\n// mrnContext.setScreenCd(screenCd);\r\n //request.setAttribute(\"startTime\", startTime);\r\n //if returned false, we need to make sure 'response' is sent\r\n return true;\r\n }", "public final void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {\n\t\n\t// if false will not create new cookie\n\t// HttpSession session = request.getSession(false);\n\t// session stores in cookies or in response.encodeURL in the form action\n\n\t// cookie in localhost name is Cookie: (name/value) JSESSIONID=79648B6603709388645FDF61F374469C\n\t// get value from firefox or w3m M-k\n\n\t// in tomcat/logs will view the log data \n\t//context.log(\"ahmad session id is = \"+ session.getId());\n\n\tresponse.setContentType(\"text/html\");\n\tPrintWriter out = response.getWriter();\n\n\tHttpSession session = request.getSession(false);// true default\n\t////////\tHttpSession session = request.getSession(false);\n\tString name = \"ali\";\n\n\t// because the session always not null, so i need to check something is null or not\n\t//\tString myName=(String) session.getAttribute(\"name\");\n\t///////\t if (session == null) {\n\t if (session==null) {\n\t out.println(\" session attribue is new , so new user \");\t \n \t session = request.getSession(true);\n \t } else {\n\t out.println(\"old session ,so welcome back user \");\t \n\t }\n\t session.setAttribute(\"name\",name);\n\n\t// if ((session.isNew())) {\n\t// //\tif ((session == null)) {\n\t// //\tif ((getName == null)) {\n // //\tout.println(\" session is new, welcome \");\n\t// out.println(\" session == new \");\n\t// //\tout.println(\" session == null \");\n\t// }else {\n\t// session.setAttribute(\"name\",name);\n\t// //\tgetName =(String) session.getAttribute(\"name\");\n\t// String getName =(String) session.getAttribute(\"name\");\n\t// out.println(\" session scope attribute = \"+ getName +\" <br/>\");\n\t// out.println(\" test session \"+ session.getId()+\" <br/>\");\n\t// out.println(\" <br/> ============ <br/>\" );\n\t// out.println(\" int x = \"+ (x++));\n\t// }\n\n\n\n\t// work only if the cookies are disabled\n // out.println(response.encodeURL(\"hi\"));\n\t out.println(\" <br/> ========== <br/> \");\n\t out.println(response.encodeURL(\"encodeURL\")); //\n\t out.println(\" <br/> ========== <br/> \");\n\t //\t out.println(response.encodeRedirectURL(\"encodeRedirectURL\"));\n\t out.println(\"<a href=\"+ response.encodeURL(\"http://www.sosox2.com\") +\">click me1</a>\");\n\t out.println(\"<a href=\"+ response.encodeRedirectURL(\"http://www.sosox2.com\") +\">click me2</a>\");\n\t response.sendRedirect(\"/aaa/bbb\");\n\t response.encodeRedirectURL(\"aaa/bbb\");\n }", "@Override\r\n\t public void doPost(HttpServletRequest req, HttpServletResponse resp)\r\n\t throws ServletException, IOException {\n\t\t String uname=req.getParameter(\"login_uname\");\r\n\t\t String password=req.getParameter(\"login_psw\");\r\n\t System.out.println(\"login servlet is running username is : \"+uname);\r\n//check user request with database\t \r\n\t Check_login check_login = new Check_login ();\r\n\t String response_message=Check_login.check_user_login(uname, password);\r\n//store session variables\r\n\t HttpSession session = req.getSession();\r\n\t session.setAttribute(\"uname\", uname);\r\n\t session.setAttribute(\"password\",password);\r\n\t System.out.println(\"session user name : \"+(String)session.getAttribute(\"uname\"));\r\n//retrive attributes from session\t \r\n\t String session_value=(String) session.getAttribute(\"uname\");\r\n//call front end java script file by using Java Scripting API\t \r\n\t \t\ttry {\r\n\t\t\tScriptEngineManager manager = new ScriptEngineManager();\r\n\t\t\tScriptEngine engine = manager.getEngineByName(\"JavaScript\");\r\n\t\t\tSystem.out.println(\"okay1\");\r\n\t\t\tFileInputStream fileInputStream = new FileInputStream(\"C:/Users/Kushan/eclipse-workspace/sureson.lk/src/main/webapp/js/back_end_response.js\");\r\n\t\t\tSystem.out.println(\"okay2\");\r\n\t\t if (fileInputStream != null){\r\n\t\t BufferedReader reader = new BufferedReader(new InputStreamReader(fileInputStream));\r\n\t\t engine.eval(reader);\r\n\t\t System.out.println(\"okay3\");\r\n\t\t // Invocable javascriptEngine = null;\r\n\t\t System.out.println(\"okay4\");\r\n\t\t\tInvocable invocableEngine = (Invocable)engine;\r\n\t\t\t System.out.println(\"okay5\");\r\n\t\t\t System.out.println(\"invocableEngine is : \"+invocableEngine);\r\n\t\t Object object = invocableEngine.invokeFunction(\"backend_message\",session_value);\r\n\t\t \r\n\t\t System.out.println(\"okay6\");\r\n\t\t }\r\n\t\t\t}catch(Exception e) {\r\n\t\t\t\tSystem.out.println(\"erroe when calling js function\"+ e);\r\n\t\t\t} \r\n\t \t \r\n\t }", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n }", "private void loginSubmit(boolean rememberValues)\n\t{\n\t\tif((usernameItem.getValueAsString() == null) || (passwordItem.getValueAsString() == null))\n\t\t\treturn;\n\t\tString local = localItem.getValueAsString();\n\t\tif(local == null)\n\t\t\tlocal = \"\";\n\t\t\n\t\tif (rememberValues) {\n\t\t\tlong cookieLifespan = 1000 * 60 * 60 * 24 * 365; // one year\n\t\t Date expires = new Date(System.currentTimeMillis() + cookieLifespan);\n\t\t \n\t\t Cookies.setCookie(\"bffRememberNameLoc\", \"true\", expires, null, \"/\", false);\n\t\t \n\t\t\tString username = usernameItem.getValueAsString();\n\t\t\tCookies.setCookie(\"bffLastName\", username, expires, null, \"/\", false);\n\t\t\tCookies.setCookie(\"bffLastLocation\", local, expires, null, \"/\", false);\n\t\t} else {\n\t\t\tCookies.removeCookie(\"bffRememberNameLoc\", \"/\");\n\t\t\tCookies.removeCookie(\"bffLastName\", \"/\");\n\t\t\tCookies.removeCookie(\"bffLastLocation\", \"/\");\n\t\t}\n\t\t\n\t\tmyCallbackInterface.performLoginCallback(usernameItem.getValueAsString(), \n\t\t\t\t\t\t\t\t\t\t\t\t passwordItem.getValueAsString(),\n\t\t\t\t\t\t\t\t\t\t\t\t local);\n\t\tdestroy();\n\t}", "private void action_login_utente(HttpServletRequest request, HttpServletResponse response) throws IOException{\n //recupero credenziali di login\n String email = SecurityLayer.addSlashes(request.getParameter(\"email\").toLowerCase());\n email = SecurityLayer.sanitizeHTMLOutput(email);\n String password = SecurityLayer.addSlashes(request.getParameter(\"password\"));\n password = SecurityLayer.sanitizeHTMLOutput(password);\n if(!email.isEmpty() && !password.isEmpty()){\n try {\n //recupero utente dal db\n Utente u = ((PollwebDataLayer)request.getAttribute(\"datalayer\")).getUtenteDAO().getUtenteByEmail(email);\n //controllo che l'utente esista\n if(u != null){\n //controllo i parametri\n if(u.getEmail().equalsIgnoreCase(email) && new BasicPasswordEncryptor().checkPassword(password, u.getPassword())){\n //se l'utente esiste ed è lui\n\n request.setAttribute(\"userName\", u.getNome());\n request.setAttribute(\"user_id\", u.getId());\n System.out.println(u.getId());\n\n SecurityLayer.createSession(request, u.getId());\n\n if (request.getParameter(\"referrer\") != null) {\n response.sendRedirect(request.getParameter(\"referrer\"));\n } else {\n response.sendRedirect(\"/home\");\n }\n }else{\n if(request.getAttribute(\"referrer\") != null){\n response.sendRedirect(\"/login?referrer=\" + URLEncoder.encode(((String)request.getAttribute(\"referrer\")), \"UTF-8\"));\n }else{\n request.setAttribute(\"error\", \"Credenziali errate\");\n response.sendRedirect(\"/login?error=100\");\n }\n }\n\n }else{\n\n if(request.getAttribute(\"referrer\") != null){\n response.sendRedirect(\"/login?referrer=\" + URLEncoder.encode(((String)request.getAttribute(\"referrer\")), \"UTF-8\"));\n }else{\n response.sendRedirect(\"/login&error=102\");\n }\n }\n }catch (DataException ex) {\n //TODO Handle Exception\n\n }\n } else {\n\n if(request.getAttribute(\"referrer\") != null){\n response.sendRedirect(\"/login?referrer=\" + URLEncoder.encode(((String)request.getAttribute(\"referrer\")), \"UTF-8\"));\n }else{\n response.sendRedirect(\"/login?error=101\");\n }\n }\n }", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\t\tSystem.out.println(\"拦截器运行中------\");\r\n\t\t/*String otherparam = \"\";\r\n\t\t//Map<String, String[]> paramMap = request.getParameterMap();\r\n\t\tEnumeration<String> enum1=request.getParameterNames(); \r\n\t\t while(enum1.hasMoreElements()){ \r\n\t\t String paramName=(String)enum1.nextElement(); \r\n\t\t String[] values=request.getParameterValues(paramName); \r\n\t\t for(int i=0;i<values.length;i++){ \r\n\t\t \t otherparam =otherparam+(\"[\"+i+\"] \"+paramName+\" \"+values[i]+\"\\n\"); \r\n\t\t } \r\n\t\t }\r\n\t\tString companycode = \"\";\r\n\t\tString companyname = \"\";\r\n\t\tString chntitle = \"\";\r\n\t\tif(request.getParameter(\"companycode\")!=null && !request.getParameter(\"companycode\").equals(\"\"))\r\n\t\t{\r\n\t\t\tcompanycode = request.getParameter(\"companycode\");\r\n\t\t\tcompanyname = this.companyInfoService.getCompanyByCode(companycode).getCompanyname();\r\n\t\t}\r\n\t\tif(request.getParameter(\"companyCode\")!=null && !request.getParameter(\"companyCode\").equals(\"\"))\r\n\t\t{\r\n\t\t\tcompanycode = request.getParameter(\"companyCode\");\r\n\t\t\tcompanyname = this.companyInfoService.getCompanyByCode(companycode).getCompanyname();\r\n\t\t}\r\n\t if(modelAndView.getModel().get(\"chntitle\")!=null)\r\n\t\tchntitle=modelAndView.getModel().get(\"chntitle\").toString();\r\n\t\tHttpSession ss = (HttpSession)request.getSession();\r\n\t\t//System.out.println(\"openid:\"+ss.getAttribute(\"openid\"));\r\n\t\tString visiturl = modelAndView.getViewName()+\".jsp\";\r\n\t\tLogInfo loginfo = new LogInfo();\r\n\t\tDate date=new Date();\r\n\t\tDateFormat format=new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\t\tLong timetmp = 1L;\r\n\t\tString time=format.format(date);\r\n\t\tString city = \"\";\r\n\t\tif(ss.getAttribute(\"city\")!=null)\r\n\t\t\tcity = ss.getAttribute(\"city\").toString();\r\n\t\tString country = \"\";\r\n\t\tif(ss.getAttribute(\"country\")!=null)\r\n\t\t\tcountry = ss.getAttribute(\"country\").toString();\r\n\t\tString headimgurl = \"\";\r\n\t\tif(ss.getAttribute(\"headimgurl\")!=null)\r\n\t\t\theadimgurl = ss.getAttribute(\"headimgurl\").toString();\r\n\t\tString language = \"\";\r\n\t\tif(ss.getAttribute(\"language\")!=null)\r\n\t\t\tlanguage = ss.getAttribute(\"language\").toString();\r\n\t\tString nickname = \"\";\r\n\t\tif(ss.getAttribute(\"nickname\")!=null)\r\n\t\t\tnickname = ss.getAttribute(\"nickname\").toString();\r\n\t\tString province = \"\";\r\n\t\tif(ss.getAttribute(\"province\")!=null)\r\n\t\tprovince = ss.getAttribute(\"province\").toString();\r\n\t\tString sex = \"\";\r\n\t\tif(ss.getAttribute(\"sex\")!=null)\r\n\t\t\tsex = ss.getAttribute(\"sex\").toString();\r\n\t\tString subscribe_time = \"\";\r\n\t\tif(ss.getAttribute(\"subscribe_time\")!=null)\r\n\t\t\t{subscribe_time = ss.getAttribute(\"subscribe_time\").toString();\t\t\t\r\n\t\t\ttimetmp = Long.parseLong(subscribe_time);\r\n\t\t\tsubscribe_time = format.format(new Date(timetmp*1000L)); \r\n\t\t\t}\r\n\t\tString openid = \"\";\r\n\t\tif(ss.getAttribute(\"openid\")!=null)\r\n\t\t\topenid = ss.getAttribute(\"openid\").toString();\t\t\r\n\t\tloginfo.setOpenid(openid);\r\n\t\tloginfo.setCity(city);\r\n\t\tloginfo.setCountry(country);\r\n\t\tloginfo.setHeadimgurl(headimgurl);\r\n\t\tloginfo.setInserttime(time);\r\n\t\tloginfo.setLanguage(language);\r\n\t\tloginfo.setNickname(nickname);\r\n\t\tloginfo.setProvince(province);\r\n\t\tloginfo.setSex(sex);\r\n\t\tloginfo.setSubscribe_time(subscribe_time);\r\n\t\tloginfo.setVisitpage(visiturl);\r\n\t\tloginfo.setCompanyname(companyname);\r\n\t\tloginfo.setChntitle(chntitle);\r\n\t\tloginfo.setOtherparam(otherparam);\r\n\t\tloginfo.setLanguage(request.getRequestURI());\r\n\t\tthis.logInfoService.insertLog(loginfo);*/\r\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException \n\t{\n\t\tString usrId = req.getParameter(\"uid\");\n\t\tString password = req.getParameter(\"psw\");\n\t\tString domain=req.getParameter(\"domain\");\n\t\t\n\t\t//2. Validate the credentials\n\t\tUserAuthenticate util = new UserAuthenticate();\n\t\tboolean isValid = util.validate(usrId, password, domain);\n\t\t\n\t\tif(isValid) //if the user is valid, start a session.\n\t\t{\n\t\t\t\tHttpSession session = req.getSession(true); //starting a session.\n\t session.setAttribute(\"userID\", usrId);\n\t \n\t //setting flag according to the user's privileges.\n\t int flag=util.flag;\n\t \t\tsession.setAttribute(\"flag\", flag);\n\t\t\t\t\n\t \t\tresp.sendRedirect(\"home\");\n\t \t\t//End of Authentication\n\t\t}\n\t\telse //invalid user\n\t\t{\n\t\t\treq.setAttribute(\"errMsg\", \"In-Valid User Name / Password\");\n\t\t\tRequestDispatcher dispatcher = req.getRequestDispatcher(\"loginErr\");\n\t\t\tdispatcher.forward(req, resp);\n\t\t}\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tSystem.out.println(\"--doPost executed--\");\n\n\t\tUser user = new User();\n\t\t\n\t\t// Extracting data from Request\n\t\tuser.email = request.getParameter(\"txtEmail\");\n\t\tuser.password = request.getParameter(\"txtPassword\");\t\n\t\t\n\t\tSystem.out.println(user.email+\" : \"+user.password);\n\t\t\n\t\t// Send response to the client\n\t\tresponse.setContentType(\"text/html\");\n\t\tPrintWriter out = response.getWriter();\n\t\t\n\t\tJDBCHelper helper = new JDBCHelper();\n\t\thelper.createConnection();\n\t\tboolean flag = helper.loginUser(user);\n\t\t\n\t\tif(flag){\n\t\t\t\n\t\t\tString name = \"John Watson\";\n\t\t\tint age = 30;\n\t\t\t\n\t\t\t// Share the data among Servlets.\n\t\t\t// Session Tracking !!\n\t\t\t\n\t\t\t//1. Cookies\n\t\t\t/*Cookie ck1 = new Cookie(\"keyName\", name);\n\t\t\tCookie ck2 = new Cookie(\"keyAge\", String.valueOf(age));\n\t\t\t\n\t\t\tresponse.addCookie(ck1);\n\t\t\tresponse.addCookie(ck2);\n\t\t\t\n\t\t\tout.print(\"<html><body><h3>Welcome User !!</h3><a href='Welcome'>Enter Home</a></body></html>\");*/\n\t\t\t\n\t\t\t//2. URL ReWriting\n\t\t\t/*String url = \"Welcome?name=\"+name+\"&age=\"+age;\n\t\t\t\n\t\t\tout.print(\"<html><body><h3>Welcome User !!</h3><a href='\"+url+\"'>Enter Home</a></body></html>\");\n\t\t\t*/\n\t\t\t\n\t\t\t//3. HttpSession\n\t\t\t/*HttpSession session = request.getSession();\n\t\t\tsession.setAttribute(\"keyName\", name);\n\t\t\tsession.setAttribute(\"keyAge\", age);\n\t\t\tout.print(\"<html><body><h3>Welcome User !!</h3><a href='Welcome'>Enter Home</a></body></html>\");*/\n\t\t\t\n\t\t\t//4. Hidden Form Fields\n\t\t\tString form = \"<form action='Welcome' method = 'post'>\"\n\t\t\t\t\t+ \"<input type='hidden' name='txtName' value='\"+name+\"'/>\"\n\t\t\t\t\t+ \"<input type='hidden' name='txtAge' value='\"+age+\"'/>\"\n\t\t\t\t\t+ \"<input type='submit' value='Enter Home'/>\"\n\t\t\t\t\t+ \"</form>\";\n\t\t\tout.print(form);\n\t\t}else{\n\t\t\tout.print(\"Login Failed !!\");\n\t\t\tresponse.sendRedirect(\"https://www.google.in\");\n\t\t}\n\t\t\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest request,\r\n\t\t\tHttpServletResponse response)\r\n\t\t\t\t\tthrows ServletException, IOException\r\n\t\t\t\t\t{\n\t\tHttpSession session = request.getSession(true);\r\n\r\n\t\tServletContext context = getServletContext();\r\n\r\n\t\tsession.setMaxInactiveInterval(60); // in seconds\r\n\r\n\t\t// Get session creation time.\r\n\t\tDate createTime = new Date(session.getCreationTime());\r\n\t\t// Get last access time of this web page.\r\n\t\tDate lastAccessTime = \r\n\t\t\t\tnew Date(session.getLastAccessedTime());\r\n\r\n\t\tString title =\"\";\r\n\t\tInteger visitCount = new Integer(0);\r\n\t\tInteger requestCount = new Integer(0);\r\n\t\tString visitCountKey = new String(\"visitCount\");\r\n\t\tString userIDKey = new String(\"userID\");\r\n\t\tString userID = new String(\"ABCD\");\r\n\r\n\t\t// Check if this is new comer on your web page.\r\n\t\tif (session.isNew()){\r\n\r\n\t\t\ttitle = \"Welcome to my website\";\r\n\t\t\tsession.setAttribute(userIDKey, userID);\r\n\r\n\t\t\trequestCount = (Integer)context.getAttribute(\"totalRequestServed\");\r\n\t\t\trequestCount = (requestCount != null ? requestCount : 0) + 1;\r\n\t\t\t//RequestDispatcher\r\n\t\t} else {\r\n\t\t\ttitle = \"You are in the same Session !!!\";\r\n\t\t\tvisitCount = (Integer)session.getAttribute(visitCountKey);\r\n\t\t\tvisitCount = (visitCount != null ? visitCount : 0) + 1;\r\n\t\t\tuserID = (String)session.getAttribute(userIDKey);\r\n\r\n\t\t\trequestCount = (Integer)context.getAttribute(\"totalRequestServed\");\r\n\t\t\trequestCount = (requestCount != null ? requestCount : 0) + 1;\r\n\r\n\r\n\t\t}\r\n\t\tsession.setAttribute(visitCountKey, visitCount); // 1\r\n\t\tcontext.setAttribute(\"totalRequestServed\", requestCount);\r\n\r\n\t\tString logoutRequest = request.getParameter(\"logout\");\r\n\t\tSystem.out.println(\"SessionServlet.doGet() logoutRequest :: \"+ logoutRequest);\r\n\r\n\t\tif(\"logout\".equals(logoutRequest)){\r\n\t\t\ttitle = \"Good Bye\";\r\n\t\t\tSystem.out.println(\"Logging Out\");\r\n\t\t\tsession.invalidate();\r\n\t\t\t//\t\t\tsession.removeAttribute(arg0);\r\n\t\t\t//\t\t\tcontext.removeAttribute(\"totalRequestServed\");\r\n\r\n\t\t\t//\t\t\tsession.setAttribute(visitCountKey, new Integer(0));\r\n\t\t\tvisitCount = new Integer(0);\r\n\t\t}\r\n\r\n\r\n\t\t// Set response content type\r\n\t\tresponse.setContentType(\"text/html\");\r\n\t\tPrintWriter out = response.getWriter();\r\n\r\n\t\tString docType =\r\n\t\t\t\t\"<!doctype html public \\\"-//w3c//dtd html 4.0 \" +\r\n\t\t\t\t\t\t\"transitional//en\\\">\\n\";\r\n\t\tString logout = \"<form action='SessionServlet' method='POST'> \" +\r\n\t\t\t\t\"<input type='submit' name ='logout' value='logout' /> \" +\r\n\t\t\t\t\"</form>\";\r\n\r\n\t\tout.println(docType +\r\n\t\t\t\t\"<html>\\n\" +\r\n\t\t\t\t\"<head><title>\" + title + \"</title></head>\\n\" +\r\n\t\t\t\t\"<body bgcolor=\\\"#f0f0f0\\\">\\n\" +\r\n\t\t\t\t\"<h1 align=\\\"center\\\">\" + title + \"</h1>\\n\" +\r\n\t\t\t\t\"<h2 align=\\\"center\\\">Session Infomation</h2>\\n\" +\r\n\t\t\t\t\"<table border=\\\"1\\\" align=\\\"center\\\">\\n\" +\r\n\t\t\t\t\"<tr bgcolor=\\\"#949494\\\">\\n\" +\r\n\t\t\t\t\" <th>Session info</th><th>value</th></tr>\\n\" +\r\n\t\t\t\t\"<tr>\\n\" +\r\n\t\t\t\t\" <td>id</td>\\n\" +\r\n\t\t\t\t\" <td>\" + session.getId() + \"</td></tr>\\n\" +\r\n\t\t\t\t\"<tr>\\n\" +\r\n\t\t\t\t\" <td>Creation Time</td>\\n\" +\r\n\t\t\t\t\" <td>\" + createTime + \r\n\t\t\t\t\" </td></tr>\\n\" +\r\n\t\t\t\t\"<tr>\\n\" +\r\n\t\t\t\t\" <td>Time of Last Access</td>\\n\" +\r\n\t\t\t\t\" <td>\" + lastAccessTime + \r\n\t\t\t\t\" </td></tr>\\n\" +\r\n\t\t\t\t\"<tr>\\n\" +\r\n\t\t\t\t\" <td>User ID</td>\\n\" +\r\n\t\t\t\t\" <td>\" + userID + \r\n\t\t\t\t\" </td></tr>\\n\" +\r\n\t\t\t\t\"<tr>\\n\" +\r\n\t\t\t\t\" <td>Number of visits</td>\\n\" +\r\n\t\t\t\t\" <td>\" + visitCount + \"</td></tr>\\n\" +\r\n\t\t\t\t\"<tr>\\n\" +\r\n\t\t\t\t\" <td>Total Request Served</td>\\n\" +\r\n\t\t\t\t\" <td>\" + requestCount + \"</td></tr>\\n\" +\r\n\t\t\t\t\"</table>\\n\" +\r\n\t\t\t\tlogout+\r\n\t\t\t\t\"</body></html>\");\r\n\t\t\t\t\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\trequestPro(req, resp);\n\t\t\n\t\n\t\t// findPasswordAction(req);\n\t\tfindPasswordAction(req,resp);\n\t}", "private void alter(HttpServletRequest request, HttpServletResponse response) throws Exception {\n\t\tUser user = (User) request.getSession().getAttribute(SessionKey.USER_LOGIN);\r\n\r\n\t\tSimpleDateFormat format1 = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\t\tInteger Creater = user.getUser_id();\r\n\t\tString Create_Time = format1.format(new Date());\r\n\t\tString Old_Create_Time = request.getParameter(\"create_time\");\r\n\t\tString Old_Creater = request.getParameter(\"creater\");\r\n\t\tInteger Updater = user.getUser_id();\r\n\r\n\t\tSimpleDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd\");\r\n\t\tString id = request.getParameter(\"id\") == \"\" ? null : request.getParameter(\"id\");\r\n\t\tString Old_pub_time = request.getParameter(\"pub_time\");\r\n\t\tString expire_time = request.getParameter(\"expire_time\") == \"\" ? \"2019-11-7\"\r\n\t\t\t\t: request.getParameter(\"expire_time\");\r\n\t\tString subject = request.getParameter(\"subject\");\r\n\t\tString tongzhifanwei = request.getParameter(\"tongzhifanwei\");\r\n\t\tString text = request.getParameter(\"text\");\r\n\r\n\t\tif (id == null) {\r\n\r\n\t\t\tNotice notice = new Notice(Integer.valueOf(tongzhifanwei), subject, text, format1.parse(Create_Time),\r\n\t\t\t\t\tformat.parse(expire_time), Creater, format1.parse(Create_Time));\r\n\t\t\tservice.add(notice);\r\n\t\t} else {\r\n\t\t\tNotice notice = new Notice(Integer.valueOf(id), Integer.valueOf(tongzhifanwei), subject, text,\r\n\t\t\t\t\tformat1.parse(Old_pub_time), format.parse(expire_time), Integer.valueOf(Old_Creater),\r\n\t\t\t\t\tformat1.parse(Old_Create_Time), Updater, format1.parse(Create_Time));\r\n\t\t\tservice.update(notice);\r\n\t\t}\r\n\t\trequest.getRequestDispatcher(\"NoticeServlet?service=NoticeGuanLi\").forward(request, response);\r\n\r\n\t}", "private void authorize(){\n\t\t\n\t\tURL authURL = null;\n\t\tURL homeURL = null;\n\t\tURLConnection homeCon = null;\n\t\t\n\t\tString loginPage = GG.GG_LOGIN+\"?ACCOUNT=\"+GG.GG_UID\n\t\t\t+\"&PASSWORD=\"+GG.GG_PASS;\n\t\tString cookieString = \"\";\n\t\tString cookieString1 = \"\";\n\t\t\n\t\ttry{\n\t\t\thomeURL = new URL(GG.GG_HOME);\n\t\t\thomeCon = homeURL.openConnection();\n\t\t\t\n\t\t\t// Look At the headers\n\t\t\tMap headerMap = homeCon.getHeaderFields();\n\t\t\t\n\t\t\t// Look for the Cookie\n\t\t\tif(headerMap.containsKey(\"Set-Cookie\")){\n\t\t\t\t\n\t\t\t\t// this gets the exact value of the header\n\t\t\t\t// otherwise gets some formatted string\n\t\t\t\tcookieString = homeCon.getHeaderField(\"Set-Cookie\");\n\t\t\t\t//log.finest(\"cookie1: \"+cookieString);\n\t\t\t\t\n\t\t\t\tauthURL = new URL(loginPage);\n\t\t\t\tHttpURLConnection.setFollowRedirects(false);\n\t\t\t\tHttpURLConnection loginCon = (HttpURLConnection) authURL.openConnection();\n\t\t\t\t\n\t\t\t\t// doOutput must be set before connecting\n\t\t\t\tloginCon.setAllowUserInteraction(true);\n\t\t\t\tloginCon.setUseCaches(false);\n\t\t\t\tloginCon.setDoOutput(true);\n\t\t\t\tloginCon.setRequestProperty(\"Cookie\", cookieString);\n\t\t\t\tloginCon.connect();\n\t\t\t\t\n\t\t\t\t// Look At the headers\n\t\t\t\tMap headerMap1 = loginCon.getHeaderFields();\n\t\t\t\t\n\t\t\t\tcookieString1 = loginCon.getHeaderField(\"Set-Cookie\");\n\t\t\t\t//log.finest(\"cookie2: \"+cookieString1);\n\t\t\t\tif(!Pattern.matches(\".*\\\\.\"+GG.GG_UID+\"\\\\.\\\\d+.*\", cookieString1)){\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tString location = loginCon.getHeaderField(\"Location\");\n\t\t\t\tURL gotURL = new URL(location);\n\t\t\t\tHttpURLConnection gotCon = (HttpURLConnection) gotURL.openConnection();\n\t\t\t\t// doOutput must be set before connecting\n\t\t\t\tgotCon.setAllowUserInteraction(true);\n\t\t\t\tgotCon.setUseCaches(false);\n\t\t\t\tgotCon.setDoOutput(true);\n\t\t\t\tgotCon.setRequestProperty(\"Cookie\", cookieString);\n\t\t\t\tgotCon.setRequestProperty(\"Cookie\", cookieString1);\n\t\t\t\t\n\t\t\t\tgotCon.connect();\n\t\t\t\t\n\t\t\t\t// Got the Cookies\n\t\t\t\tcookies[0] = cookieString;\n\t\t\t\tcookies[1] = cookieString1;\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\tlog.info(\"Unable to find the Cookie\");\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\t\t\n\t\tauthorized = true;\n\t}" ]
[ "0.6721027", "0.65598255", "0.6554182", "0.618234", "0.61306256", "0.60872155", "0.6027173", "0.59085345", "0.5895349", "0.5861654", "0.58506024", "0.584596", "0.5830441", "0.58209485", "0.5804857", "0.57756805", "0.57730716", "0.5757975", "0.5747523", "0.5745708", "0.5739506", "0.573888", "0.5725749", "0.57152104", "0.57041717", "0.5703549", "0.57008725", "0.5690383", "0.5690262", "0.5677591", "0.5676365", "0.56555706", "0.56531346", "0.56518286", "0.56496036", "0.56289154", "0.5615938", "0.5602791", "0.55923563", "0.55883443", "0.55802166", "0.55795896", "0.5575554", "0.5550476", "0.5549962", "0.5546733", "0.553853", "0.5520358", "0.5513157", "0.55115294", "0.551031", "0.550937", "0.54944986", "0.5489347", "0.5488921", "0.54779226", "0.54763526", "0.54714614", "0.54678273", "0.54535335", "0.5442762", "0.54421926", "0.54413253", "0.5437762", "0.54342884", "0.54314166", "0.54280055", "0.54251957", "0.54241866", "0.5421693", "0.5418568", "0.5416584", "0.54085976", "0.54050153", "0.54037213", "0.5403208", "0.5401737", "0.5401708", "0.53886086", "0.53886086", "0.5381413", "0.5378951", "0.53773916", "0.53750306", "0.5373781", "0.53627837", "0.5357091", "0.53496146", "0.5339242", "0.53354347", "0.5331687", "0.53288454", "0.532633", "0.5321894", "0.5321191", "0.53207856", "0.531443", "0.5314391", "0.53120816", "0.53110075" ]
0.53197664
96
Created by lenovo on 2019/11/24.
@Mapper public interface SkuMapper { @Select("select * from Sku") List<SkuParam> getAll(); @Insert(value = {"INSERT INTO Sku (skuName,price,categoryId,brandId,description) VALUES (#{skuName},#{price},#{categoryId},#{brandId},#{description})"}) @Options(useGeneratedKeys=true, keyProperty="skuId") int insertLine(Sku sku); // @Insert(value = {"INSERT INTO Sku (categoryId,brandId) VALUES (2,1)"}) // @Options(useGeneratedKeys=true, keyProperty="SkuId") // int insertLine(Sku sku); @Delete(value = { "DELETE from Sku WHERE skuId = #{skuId}" }) int deleteLine(@Param(value = "skuId") Long skuId); // @Insert({ // "<script>", // "INSERT INTO", // "CategoryAttributeGroup(id,templateId,name,sort,createTime,deleted,updateTime)", // "<foreach collection='list' item='obj' open='values' separator=',' close=''>", // " (#{obj.id},#{obj.templateId},#{obj.name},#{obj.sort},#{obj.createTime},#{obj.deleted},#{obj.updateTime})", // "</foreach>", // "</script>" // }) // Integer createCategoryAttributeGroup(List<CategoryAttributeGroup> categoryAttributeGroups); @Update("UPDATE Sku SET skuName = #{skuName} WHERE skuId = #{skuId}") int updateLine(@Param("skuId") Long skuId,@Param("skuName")String skuName); @Select({ "<script>", "SELECT", "s.SkuName,c.categoryName,s.categoryId,b.brandName,s.price", "FROM", "Sku AS s", "JOIN", "Category AS c ON s.categoryId = c.categoryId", "JOIN", "Brand AS b ON s.brandId = b.brandId", "WHERE 1=1", //范围查询,根据时间 "<if test=\" null != higherSkuParam.startTime and null != higherSkuParam.endTime \">", "AND s.updateTime &gt;= #{higherSkuParam.startTime}", "AND s.updateTime &lt;= #{ higherSkuParam.endTime}", "</if>", //模糊查询,根据类别 "<if test=\"null != higherSkuParam.categoryName and ''!=higherSkuParam.categoryName\">", " AND c.categoryName LIKE CONCAT('%', #{higherSkuParam.categoryName}, '%')", "</if>", //模糊查询,根据品牌 "<if test=\"null != higherSkuParam.brandName and ''!=higherSkuParam.brandName\">", " AND b.brandName LIKE CONCAT('%', #{higherSkuParam.brandName}, '%')", "</if>", //模糊查询,根据商品名字 "<if test=\"null != higherSkuParam.skuName and ''!=higherSkuParam.skuName\">", " AND s.skuName LIKE CONCAT('%', #{higherSkuParam.skuName}, '%')", "</if>", //根据多个类别查询 "<if test=\" null != higherSkuParam.categoryIds and higherSkuParam.categoryIds.size>0\" >", "AND s.categoryId IN", "<foreach collection=\"higherSkuParam.categoryIds\" item=\"data\" index=\"index\" open=\"(\" separator=\",\" close=\")\" >", " #{data} ", "</foreach>", "</if>", "</script>" }) List<HigherSkuDTO> higherSelect(@Param("higherSkuParam")HigherSkuParam higherSkuParam); // "<if test=\" null != higherSkuParam.categoryName and ''!=higherSkuParam.categoryName \" >", // " AND c.categoryName LIKE \"%#{higherSkuParam.categoryName}%\" ", // "</if>", // "<if test=\" null != higherSkuParam.skuName \" >", // "AND s.skuName LIKE \"%#{higherSkuParam.skuName}%\" ", // "</if>", }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "private stendhal() {\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n public void memoria() {\n \n }", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "Petunia() {\r\n\t\t}", "@Override\n protected void initialize() {\n\n \n }", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n public int describeContents() { return 0; }", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n public void init() {\n\n }", "@Override\n protected void getExras() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "private void poetries() {\n\n\t}", "public void mo38117a() {\n }", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "public void mo6081a() {\n }", "@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 void init() {\n }", "@Override\n protected void initialize() \n {\n \n }", "public final void mo51373a() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "public void mo4359a() {\n }", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "private UsineJoueur() {}", "@Override\n public void init() {\n }", "public void mo55254a() {\n }", "public Pitonyak_09_02() {\r\n }", "private void strin() {\n\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n\tprotected void interr() {\n\t}", "private void init() {\n\n\t}", "public contrustor(){\r\n\t}", "@Override\n public void settings() {\n // TODO Auto-generated method stub\n \n }", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "private TMCourse() {\n\t}", "@Override\n\tpublic void create () {\n\n\t}", "private Rekenhulp()\n\t{\n\t}", "@Override\n public int getSize() {\n return 1;\n }", "private MApi() {}", "@Override\n\tpublic void create() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "protected void onFirstUse() {}", "@Override\n public void initialize() { \n }", "@Override\n public void init() {}", "@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}", "Consumable() {\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "private void getStatus() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "private void m50366E() {\n }", "@Test\r\n public void elCerdoNoSePuedeAtender() {\n }", "private void kk12() {\n\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "protected MetadataUGWD() {/* intentionally empty block */}", "@Override\n public void initialize() {}", "@Override\n public void initialize() {}", "@Override\n public void initialize() {}", "@Override\n public void initialize() {\n \n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}", "private MetallicityUtils() {\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\tpublic void one() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {}" ]
[ "0.57608926", "0.5674069", "0.5451703", "0.54067814", "0.53571814", "0.5324442", "0.5322599", "0.5322599", "0.5319341", "0.5306625", "0.5266298", "0.5252017", "0.5208263", "0.52068114", "0.51970905", "0.51891965", "0.5182249", "0.5181757", "0.51706547", "0.5166451", "0.5163565", "0.5161606", "0.515366", "0.515366", "0.515366", "0.515366", "0.515366", "0.515366", "0.515366", "0.51445186", "0.51222086", "0.51201683", "0.51193273", "0.5116186", "0.5101705", "0.5101705", "0.51000965", "0.5096069", "0.50911206", "0.5086036", "0.5086036", "0.5086036", "0.5086036", "0.5086036", "0.5086036", "0.5085308", "0.50557876", "0.505068", "0.5049706", "0.50470155", "0.5043231", "0.5028646", "0.50154144", "0.5010461", "0.5003824", "0.49993578", "0.49975917", "0.49903962", "0.4975037", "0.4955289", "0.49549186", "0.495393", "0.49504408", "0.49449456", "0.49401662", "0.49287593", "0.49250412", "0.49250412", "0.492392", "0.49226412", "0.49222723", "0.492003", "0.492003", "0.492003", "0.492003", "0.492003", "0.49163505", "0.49110973", "0.49083328", "0.49001485", "0.489899", "0.4894878", "0.48911753", "0.48880094", "0.48874947", "0.4883664", "0.4883664", "0.4883664", "0.48831603", "0.48821092", "0.48821092", "0.4879345", "0.48785514", "0.48733792", "0.48733792", "0.48733792", "0.4866078", "0.48631045", "0.4856415", "0.48543546", "0.48447385" ]
0.0
-1
own methods of LoginPage login
public void doLogin() { System.out.println("loginpage ----dologin"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void login() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void login() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void login() {\n\r\n\t}", "@Override\n\tpublic void goToLogin() {\n\t\t\n\t}", "@Override\n\tprotected void login() {\n\t\tsuper.login();\n\t}", "public static void Login() \r\n\t{\n\t\t\r\n\t}", "public abstract void navigateToLogin();", "Login() { \n }", "@Override\r\n\tprotected void onLoginSuccess() {\n\t\t\r\n\t}", "public void LogIn() {\n\t\t\r\n\t}", "private void loadLogin(){\n }", "@Override\n\tpublic void loginUser() {\n\t\t\n\t}", "public abstract void onLogin();", "protected Response login() {\n return login(\"\");\n }", "public abstract boolean showLogin();", "private static void postLoginPage() {\n post(\"/login\", \"application/json\", (req, res) -> {\n HomerAccount loggedInAccount = homerAuth.login(req.body());\n if(loggedInAccount != null) {\n req.session().attribute(\"account\", loggedInAccount);\n res.redirect(\"/team\");\n } else {\n res.redirect(\"/login\");\n }\n return null;\n });\n }", "public void LoginButton() {\n\t\t\r\n\t}", "@Override\n\tpublic void onLoginSuccess() {\n\t\t\n\t}", "public void goToLoginPage()\n\t{\n\t\tclickAccountNameIcon();\n\t\tclickSignInLink();\n\t}", "public void login() {\n presenter.login(username.getText().toString(), password.getText().toString());\n }", "void successLogin();", "public login() {\n initComponents();\n \n \n }", "public void login() {\n if (!areFull()) {\n return;\n }\n\n // Get the user login info\n loginInfo = getDBQuery(nameField.getText());\n if (loginInfo.equals(\"\")) {\n return;\n }\n\n // Get password and check if the entered password is true\n infoArray = loginInfo.split(\" \");\n String password = infoArray[1];\n if (!passField.getText().equals(password)) {\n errorLabel.setText(\"Wrong Password!\");\n return;\n }\n\n continueToNextPage();\n }", "void redirectToLogin();", "private void userLogin(HttpServletRequest request, HttpServletResponse response) {\n\t\t\n\t}", "public final void login() {\n Activity_ExtensionKt.hideSoftKeyboard(this);\n if (hasAllRequiredField()) {\n EditText editText = (EditText) _$_findCachedViewById(C2723R.C2726id.etUserName);\n Intrinsics.checkExpressionValueIsNotNull(editText, \"etUserName\");\n String obj = editText.getText().toString();\n if (obj != null) {\n this.username = StringsKt.trim((CharSequence) obj).toString();\n EditText editText2 = (EditText) _$_findCachedViewById(C2723R.C2726id.etPassword);\n Intrinsics.checkExpressionValueIsNotNull(editText2, \"etPassword\");\n String obj2 = editText2.getText().toString();\n if (obj2 != null) {\n this.password = StringsKt.trim((CharSequence) obj2).toString();\n LoginViewModel loginViewModel = this.viewModel;\n if (loginViewModel == null) {\n Intrinsics.throwUninitializedPropertyAccessException(\"viewModel\");\n }\n EditText editText3 = (EditText) _$_findCachedViewById(C2723R.C2726id.etUserName);\n Intrinsics.checkExpressionValueIsNotNull(editText3, \"etUserName\");\n String obj3 = editText3.getText().toString();\n EditText editText4 = (EditText) _$_findCachedViewById(C2723R.C2726id.etPassword);\n Intrinsics.checkExpressionValueIsNotNull(editText4, \"etPassword\");\n loginViewModel.login(obj3, editText4.getText().toString());\n return;\n }\n throw new TypeCastException(\"null cannot be cast to non-null type kotlin.CharSequence\");\n }\n throw new TypeCastException(\"null cannot be cast to non-null type kotlin.CharSequence\");\n }\n }", "private void loggedInUser() {\n\t\t\n\t}", "private void signIn() {\n }", "@Override\n public void manejarLogin() {\n loginPresenter.validarLogin(etxtEmail.getText().toString(),etxtPass.getText().toString());\n }", "private void login(String username,String password){\n\n }", "@Override\r\n\tpublic void MemberLogin() {\n\r\n\t}", "void loginDone();", "public loginPage() {\n\t\tPageFactory.initElements(driver, this);\n\t}", "private LogIn() {}", "protected String getLoginPage() {\r\n return loginPage;\r\n }", "private void login() {\n\t\t \tetUserName.addTextChangedListener(new TextWatcher() {\n\t\t public void afterTextChanged(Editable s) {\n\t\t Validation.hasText(etUserName);\n\t\t }\n\t\t public void beforeTextChanged(CharSequence s, int start, int count, int after){}\n\t\t public void onTextChanged(CharSequence s, int start, int before, int count){}\n\t\t });\n\t\t \t\n\t\t \t // TextWatcher would let us check validation error on the fly\n\t\t \tetPass.addTextChangedListener(new TextWatcher() {\n\t\t public void afterTextChanged(Editable s) {\n\t\t Validation.hasText(etPass);\n\t\t }\n\t\t public void beforeTextChanged(CharSequence s, int start, int count, int after){}\n\t\t public void onTextChanged(CharSequence s, int start, int before, int count){}\n\t\t });\n\t\t }", "public LoginPage(){\n\t\tPageFactory.initElements(driver, this);\n\t\t\n\t}", "public static void login() {\n\t\trender();\n\t}", "protected synchronized void login() {\n\t\tauthenticate();\n\t}", "public Login() {\n initComponents();\n KiemTraKN();\n }", "@Override\r\n\t\t\tpublic void onLogin(String username, String password) {\n\r\n\t\t\t}", "@Override\n public void onLoginClicked(String username, String password) {\n loginView.showProgress();\n loginInteractor.authorize(username, password, this);\n }", "private void showLogin() {\n \t\tLogin.actionHandleLogin(this);\n \t}", "public login() {\r\n\t\tsuper();\r\n\t}", "public abstract boolean isLoginRequired();", "@FXML\n\tprivate void handleLogin() {\n\t \n\t\t\t\ttry {\n\t\t\t\t\tmain.showHomePageOverview(username.getText(),password.getText());\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}", "private final static void onLogin(TextField username, PasswordField password)\n\t{\n\t\tif (ProfileManipulation.checkLogin(username.getText(), password.getText())) {\n\t\t\tif (ProfileManipulation.isVerfied(username.getText())) {\n\t\t\t\tProfileManipulation.updateLoginStatus(username.getText(), true);\n\n\t\t\t\t// Jetzt wird das Profil aufgerufen\n\t\t\t\tPartylize.setUsername(username.getText());\n\t\t\t\tPartylize.showMainScene();\n\t\t\t} else {\n\t\t\t\tPartylize.setUsername(username.getText());\n\t\t\t\tPartylize.showVerification();\n\t\t\t}\n\t\t}\n\t\t// Funktionsaufruf Datenbankanbindung -> Erstellen einer Session ID\n\t\t// Funktionsaufruf Profildaten in lokalen Speicher laden - WIP\n\t\telse {\n\t\t\tusername.setText(\"\");\n\t\t\tpassword.setText(\"\");\n\t\t}\n\t}", "public Page_Home doDefaultLogin() {\n\t\tLogStatus.info(\"Logging in with username :: \\'\" + TestUtils.getValue(\"username\") + \"\\' and password :: \\'\"\n\t\t\t\t+ TestUtils.getValue(\"password\") + \"\\'\");\n\t\tDriverManager.getDriver().findElement(By.name(\"username\")).sendKeys(TestUtils.getValue(\"username\"));\n\t\tDriverManager.getDriver().findElement(By.name(\"password\")).sendKeys(TestUtils.getValue(\"password\"));\n\t\tDriverManager.getDriver().findElement(By.id(\"Registration Desk\")).click();\n\t\tDriverManager.getDriver().findElement(By.id(\"loginButton\")).click();\n\n\t\treturn new Page_Home();\n\n\t}", "public interface LoginView {\n void enableInputs();\n void disableInputs();\n void showProgressBar();\n void hideProgressBar();\n\n //registro\n void handleSignUp();\n void handleSignIn();\n\n //sesion exitosa\n void navigateToMainScreen();\n void loginError( String error);\n\n //registro\n void newUserSuccess();\n void newUserError(String error);\n}", "public void doLogin() {\r\n\t\tif(this.getUserName()!=null && this.getPassword()!=null) {\r\n\t\t\tcdb=new Connectiondb();\r\n\t\t\tcon=cdb.createConnection();\r\n\t\t\ttry {\r\n\t\t\t\tps=con.prepareStatement(\"Select idUser,nom,prenom,userName,type,tel from t_user where userName=? and pass=? and status=?\");\r\n\t\t\t\tps.setString(1, this.getUserName());\r\n\t\t\t\tps.setString(2, this.getPassword());\r\n\t\t\t\tif(rs.next()) {\r\n\t\t\t\t\tSessionConfig.getSession().setAttribute(\"idUser\", rs.getInt(\"idUser\"));\r\n\t\t\t\t\tSessionConfig.getSession().setAttribute(\"nom\", rs.getString(\"nom\"));\r\n\t\t\t\t\tSessionConfig.getSession().setAttribute(\"prenom\", rs.getString(\"prenom\"));\r\n\t\t\t\t\tSessionConfig.getSession().setAttribute(\"userName\", rs.getString(\"userName\"));\r\n\t\t\t\t\tSessionConfig.getSession().setAttribute(\"type\", rs.getString(\"type\"));\r\n\t\t\t\t\tSessionConfig.getSession().setAttribute(\"tel\", rs.getString(\"tel\"));\r\n\t\t\t\t\tFacesContext.getCurrentInstance().getExternalContext().redirect(\"view/welcome.xhtml\");\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t\tnew Message().error(\"echec de connexion\");\r\n\t\t\t}finally {\r\n\t\t\t\tcdb.closeConnection(con);\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\tnew Message().warnig(\"Nom d'utilisateur ou mot de passe incorrecte\");\r\n\t\t}\r\n\t}", "public LoginPage(){\n\t\tPageFactory.initElements(driver, this);\n\t}", "public HomePage loginAs(String username, String password) {\n // The PageObject methods that enter username, password & submit login have\n // already defined and should not be repeated here.\n typeUserName(username);\n typePassword(password);\n return clickOnSignInButton();\n }", "public pageLogin() {\n initComponents();\n labelimage.setBorder(new EmptyBorder(0,0,0,0));\n enterButton.setBorder(null);\n enterButton.setContentAreaFilled(false);\n enterButton.setVisible(true);\n usernameTextField.setText(\"Username\");\n usernameTextField.setForeground(new Color(153,153,153));\n passwordTextField.setText(\"Password\");\n passwordTextField.setForeground(new Color(153,153,153));\n usernameAlert.setText(\" \");\n passwordAlert.setText(\" \");\n \n }", "public void signInExistingUser(View v) {\n attemptLogin();\n\n }", "public abstract User login(User data);", "@Override\r\n\tpublic void ShowLogin(Context _in_context, String _in_data) {\n\t\tTypeSDKLogger.e(\"ShowLogin\");\r\n\t\tsuper.ShowLogin(_in_context, _in_data);\r\n\t\tthis.youkuLogin();\r\n\t}", "private void attemptUsernamePasswordLogin()\n {\n if (mAuthTask != null)\n {\n return;\n }\n\n if(mLogInButton.getText().equals(getResources().getString(R.string.logout)))\n {\n mAuthTask = new RestCallerPostLoginTask(this,mStoredToken,MagazzinoService.getAuthenticationHeader(this),true);\n mAuthTask.execute(MagazzinoService.getLogoutService(this));\n return;\n }\n // Reset errors.\n mUsernameView.setError(null);\n mPasswordView.setError(null);\n\n // Store values at the time of the login attempt.\n String email = mUsernameView.getText().toString();\n String password = mPasswordView.getText().toString();\n\n boolean cancel = false;\n View focusView = null;\n\n // Check for a valid password, if the user entered one.\n if (!TextUtils.isEmpty(password) && !isPasswordValid(password))\n {\n mPasswordView.setError(getString(R.string.error_invalid_password));\n focusView = mPasswordView;\n cancel = true;\n }\n\n // Check for a valid email address.\n if (TextUtils.isEmpty(email))\n {\n mUsernameView.setError(getString(R.string.error_field_required));\n focusView = mUsernameView;\n cancel = true;\n }\n else if (!isUsernameOrEmailValid(email))\n {\n mUsernameView.setError(getString(R.string.error_invalid_email));\n focusView = mUsernameView;\n cancel = true;\n }\n\n if (cancel)\n {\n // There was an error; don't attempt login and focus the first\n // form field with an error.\n focusView.requestFocus();\n return;\n }\n\n mAuthTask = new RestCallerPostLoginTask(this,email, password);\n mAuthTask.execute(MagazzinoService.getLoginService(this));\n\n }", "public void login() {\n\n String username = usernameEditText.getText().toString();\n String password = passwordEditText.getText().toString();\n regPresenter.setHost(hostEditText.getText().toString());\n regPresenter.login(username, password);\n }", "@Test\n\tpublic void login(){\n\t\tloginPage.login(data.readData(\"email\"), data.readData(\"password\"));\n\t\tAssert.assertEquals(isPresent(locateElement(By.id(home.homeLogo))),true,\"user not got logged in successfully\");\n\t}", "private void loginFlow() {\n\t\tActiveUserModel userController = ActiveUserModel.getInstance();\n\n\t\tif (userController.isLoggedIn()) {\n\t\t\t// continue\n\t\t} else {\n\t\t\tIntent intent = new Intent(this, LoginActivity.class);\n\t\t\tstartActivityForResult(intent, LOGIN_ACTIVITY);\n\t\t}\n\t}", "Login(String strLogin)\n {\n \tsetLogin(strLogin);\n }", "private void login(){\n\t\tprogress.toggleProgress(true, R.string.pagetext_signing_in);\n\t\tParseUser.logInInBackground(email.split(\"@\")[0], password, new LogInCallback() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void done(ParseUser user, ParseException e) {\n\t\t\t\tif (e == null) {\n\t\t\t\t\tprogress.toggleProgress(false);\n\t\t\t\t\tIntent intent = new Intent(context, MainActivity.class);\n\t\t\t\t\tstartActivity(intent);\n\t\t\t\t} else {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t// else, incorrect password\n\t\t\t\t\tToast.makeText(context, \n\t\t\t\t\t\t\t\t getString(R.string.parse_login_fail, email), \n\t\t\t\t\t\t\t\t Toast.LENGTH_LONG).show();\t\t\t\t\t\n\t\t\t\t\tLog.e(\"Error Logging into Parse\", \"Details: \" + e.getMessage());\n\t\t\t\t}\n\t\t\t}\t\t\t\t\t\t\t\n\t\t});\n\t}", "public void login() {\n\t\tloggedIn = true;\n\t}", "@Override\n public void onLoggedIn() {\n\n }", "public boolean loginUser();", "public void performLogin() {\n AppMethodBeat.m2504i(92640);\n LoginManager loginManager = getLoginManager();\n if (LoginAuthorizationType.PUBLISH.equals(LoginButton.this.properties.authorizationType)) {\n if (LoginButton.this.getFragment() != null) {\n loginManager.logInWithPublishPermissions(LoginButton.this.getFragment(), LoginButton.this.properties.permissions);\n AppMethodBeat.m2505o(92640);\n } else if (LoginButton.this.getNativeFragment() != null) {\n loginManager.logInWithPublishPermissions(LoginButton.this.getNativeFragment(), LoginButton.this.properties.permissions);\n AppMethodBeat.m2505o(92640);\n } else {\n loginManager.logInWithPublishPermissions(LoginButton.access$800(LoginButton.this), LoginButton.this.properties.permissions);\n AppMethodBeat.m2505o(92640);\n }\n } else if (LoginButton.this.getFragment() != null) {\n loginManager.logInWithReadPermissions(LoginButton.this.getFragment(), LoginButton.this.properties.permissions);\n AppMethodBeat.m2505o(92640);\n } else if (LoginButton.this.getNativeFragment() != null) {\n loginManager.logInWithReadPermissions(LoginButton.this.getNativeFragment(), LoginButton.this.properties.permissions);\n AppMethodBeat.m2505o(92640);\n } else {\n loginManager.logInWithReadPermissions(LoginButton.access$900(LoginButton.this), LoginButton.this.properties.permissions);\n AppMethodBeat.m2505o(92640);\n }\n }", "protected void login() {\n\t\tdriver.get(getProperty(\"baseUrl\"));\n\n\t\t// 2. Enter valid credentials in the Username and Password fields.\n\t\tLoginPageObjects.usernameTextField(driver).sendKeys(getProperty(\"validUsername\"));\n\t\tLoginPageObjects.passwordTextField(driver).sendKeys(getProperty(\"validPassword\"));\n\n\t\t// 3. Click on the Login button\n\t\tLoginPageObjects.loginButton(driver).click();\n\t\t// waiting.waitForLoad(driver);\n\t}", "@Given(\"landing to the loginpage and signin\")\n\tpublic void user_on_login_page_andSignin() {\n\t\t\n\t\t\n\t\tdriver.findElement(By.className(\"login\")).click();\n\t\t\n\t}", "private void login() {\n Log.d(Constants.TAG_LOGIN_ACTIVITY, \"login: \");\n\n // Store values at the time of the login attempt.\n mEmail = mEditTextSignInEmail.getText().toString();\n mPassword = mEditTextSignInPassword.getText().toString();\n mFocusView = null;\n\n // Check for a valid password\n if (TextUtils.isEmpty(mPassword) || !mPresenter.isPasswordValid(mPassword)) {\n mEditTextSignInPassword.setError(getString(R.string.error_invalid_password));\n mFocusView = mEditTextSignInPassword;\n isProcessCancel = true;\n }\n\n // Check for a valid email address.\n if (TextUtils.isEmpty(mEmail)) {\n mEditTextSignInEmail.setError(getString(R.string.error_field_required));\n mFocusView = mEditTextSignInEmail;\n isProcessCancel = true;\n } else if (!mPresenter.isEmailValid(mEmail)) {\n mEditTextSignInEmail.setError(getString(R.string.error_invalid_email));\n mFocusView = mEditTextSignInEmail;\n isProcessCancel = true;\n }\n\n if (isProcessCancel) {\n // There was an error; don't attempt login and focus the first\n // form field with an error.\n mFocusView.requestFocus();\n\n } else {\n // Show a progress spinner, and kick off a background task to\n // perform the user login attempt.\n showProgress(true, mLinearlayoutSignIn);\n mPresenter.loginTask(this, mAuth, mEmail, mPassword, new SignInCallback() {\n @Override\n public void onCompleted() {\n showProgress(false, mLinearlayoutSignIn);\n showUserInfoLog();\n transToShareBookActivity();\n }\n\n @Override\n public void onError(String errorMessage) {\n Log.d(Constants.TAG_LOGIN_ACTIVITY, \"onError: \" + errorMessage);\n\n showProgress(false, mLinearlayoutSignIn);\n mEditTextSignInEmail.setError(getString(R.string.error_login_fail));\n mFocusView = mEditTextSignInEmail;\n isProcessCancel = true;\n }\n });\n }\n }", "@Override\n public void onClick(View view) {\n attemptLogin();\n }", "private void onLoginButtonClicked() {\n this.loginManager = new LoginManager(this, this);\n this.password = passwordEditText.getText().toString().trim();\n this.username = usernameEditText.getText().toString().trim();\n if (username.isEmpty() || password.isEmpty()) {\n Snackbar.make(coordinatorLayout, R.string.fill_all_fields_snackbar, Snackbar.LENGTH_LONG).show();\n } else loginManager.fetchUsersToDatabase(username, password, serverName, serverPort);\n }", "public login() {\n initComponents();\n }", "public void login () {\n\t\tGPPSignIn.sharedInstance().authenticate();\n\t}", "public Login() {\r\n\t\tinitialize();\r\n\t}", "private void checkLogin(String email, String password) {\n final Context ctx = getApplicationContext();\n\n processor.checkLoginCredentials(email, password, ctx, new FetchDataListener() {\n @Override\n public void onFetchComplete(JSONObject data) {\n Boolean resp = (Boolean) data.get(\"response\");\n if (resp) {\n // go to home page\n Intent goToHome = new Intent(ctx, MainActivity.class);\n goToHome.putExtra(\"user\", etEmail.getText().toString());\n goToHome.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n startActivity(goToHome);\n\n // finish prevents people from going back to login without logging out\n finish();\n } else {\n displayLoginError(\"Couldn't log in\");\n etEmail.setText(\"\");\n etPassword.setText(\"\");\n }\n }\n\n @Override\n public void onFetchFailure(String msg) {\n Log.d(TAG, msg);\n displayLoginError(\"Error connecting to server\");\n }\n\n @Override\n public void onFetchStart() {\n // do nothing\n }\n });\n\n }", "@Override\n public void onLogin() {\n toast(\"You are logged in\");\n }", "public void testLogin() throws Exception {\n super.login();\n }", "public LoginPage() {\r\n\t\t\t\r\n\t\t\t//Initialize webElements.\r\n\t\t\tPageFactory.initElements(driver, this);\r\n\t\t}", "public LoginPage() {\n\t\tPageFactory.initElements(driver, this);\n\t}", "public LoginPage() {\n\t\tPageFactory.initElements(driver, this);\n\t}", "private void loginSuccess(String uname) {\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tString username = txtUsername.getText().toString();\n\t\t\t\tString password = txtPassword.getText().toString();\n\n\t\t\t\tif (username.trim().length() > 0\n\t\t\t\t\t\t&& password.trim().length() > 0) {\n\t\t\t\t\t\n\t\t\t\t \tValidateLogin validateLogin=new ValidateLogin();\n\t\t\t\t\tURL url1;\n\t\t\t\t\t\n\t\t\t\t\ttry {\n\t\t\t\t\t\turl1 = new URL(\"http://localhost:8080/shopExperience/reading\");\n\t\t\t\t\t\tvalidateLogin.execute(url1);\n\t\t\t\t\t} catch (MalformedURLException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t \t\n\t\t\t\t\t if (username.equals(\"test\") && password.equals(\"test\")) {\n//\t\t\t\t\ttry {\n//\t\t\t\t\t\tif (httpLoginRequest()) {\n\n\t\t\t\t\t\t\t// Creating user login session\n\t\t\t\t\t\t\t// For testing i am stroing name, email as follow\n\t\t\t\t\t\t\t// Use user real data\n\t\t\t\t\t\t\tsession.createLoginSession(\"Android Hive\",\n\t\t\t\t\t\t\t\t\t\"[email protected]\");\n\n\t\t\t\t\t\t\t// Staring MainActivity\n\t\t\t\t\t\t\tIntent i = new Intent(getApplicationContext(),\n\t\t\t\t\t\t\t\t\tMainActivity.class);\n\t\t\t\t\t\t\tstartActivity(i);\n\t\t\t\t\t\t\tfinish();\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// username / password doesn't match\n\t\t\t\t\t\t\talert.showAlertDialog(LoginActivity.this,\n\t\t\t\t\t\t\t\t\t\"Login failed..\",\n\t\t\t\t\t\t\t\t\t\"Username/Password is incorrect\", false);\n\t\t\t\t\t\t}\n//\t\t\t\t\t} catch (Exception e) {\n//\t\t\t\t\t\t// TODO Auto-generated catch block\n//\t\t\t\t\t\te.printStackTrace();\n//\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// user didn't entered username or password\n\t\t\t\t\t// Show alert asking him to enter the details\n\t\t\t\t\talert.showAlertDialog(LoginActivity.this, \"Login failed..\",\n\t\t\t\t\t\t\t\"Please enter username and password\", false);\n\t\t\t\t}\n\n\t\t\t}", "@Override\n\t\tpublic void onCancelLogin() {\n\n\t\t}", "@Override\n\t\tpublic void onCancelLogin() {\n\n\t\t}", "public void handleLogin() {\n\t\tString username = usernameInput.getText();\n\t\tString password = passwordInput.getText();\n\n\t\t// Saves username and password if remember me is ticked\n\t\t// otherwise it deletes the file.\n\t\tif (rememberMeCheckbox.isSelected()) {\n\t\t\twriteRememberMe(username, password);\n\t\t} else {\n\t\t\tclearRememberMe();\n\t\t}\n\n\n\t\ttryUsernamePassword(username, password);\n\t}", "@Override\n public void login(String nome, String email, int senha) {\n if (getNome() == nome && this.getEmail() == email && this.getSenha() == senha){\n System.out.println(\"Login efetuado com sucesso\");\n } else {\n System.out.println(\"0 - Sair\");\n System.out.println(\"Saiu do usuario\");\n }\n\n }", "private void login() {\n AnonimoTO dati = new AnonimoTO();\n String username = usernameText.getText();\n String password = passwordText.getText();\n\n if (isValidInput(username, password)) {\n dati.username = username;\n dati.password = password;\n\n ComplexRequest<AnonimoTO> request =\n new ComplexRequest<AnonimoTO>(\"login\", RequestType.SERVICE);\n request.addParameter(dati);\n\n SimpleResponse response =\n (SimpleResponse) fc.processRequest(request);\n\n if (!response.getResponse()) {\n if (ShowAlert.showMessage(\n \"Username o password non corretti\", AlertType.ERROR)) {\n usernameText.clear();\n passwordText.clear();\n }\n }\n }\n\n }", "public interface ILoginView {\n void clear();// 清空文本框的方法\n int checkInfo(String username,String pass);// 检查用户输入的合法性\n void showProgress(int visibility);// 是否显示登录进度\n void setEnable(boolean flag);\n}", "public void navLogin() {\n container.getChildren().clear();\n loginText.setText(\"Vennligst skriv inn brukernavn og passord:\");\n Label name = new Label(\"Brukernavn:\");\n Label pwd = new Label(\"Passord:\");\n TextField username = new TextField(); /* Lager tekstfelt */\n username.getStyleClass().add(\"textField\");\n PasswordField password = new PasswordField(); /* Ditto */\n password.getStyleClass().add(\"textField\");\n password.setOnAction(new EventHandler<ActionEvent>() {\n public void handle(ActionEvent args) {\n handleLogin(login.checkLogin(username.getText(), password.getText()));\n }\n });\n username.getStyleClass().add(\"inpDefault\");\n password.getStyleClass().add(\"inpDefault\");\n Button logIn = new Button(\"Logg inn\"); /* Laget knapp, Logg inn */\n Button register = new Button(\"Registrer deg\"); /* Skal sende deg til en side for registrering */\n HBox buttons = new HBox();\n buttons.getChildren().addAll(logIn, register);\n container.setPadding(new Insets(15, 12, 15, 12));\n container.setSpacing(5);\n container.getChildren().addAll(loginText, name, username, pwd, password, buttons);\n register.setOnMouseClicked(event -> navRegister());\n logIn.setOnMouseClicked(event -> handleLogin(login.checkLogin(username.getText(), password.getText())));\n }", "@Override\n public void validateCredentials(ObjLogin objLogin, Context mContext) {\n if (loginView != null) {\n loginView.showProgress();\n loginInteractor.login(objLogin, this, mContext);\n }\n }", "@Override\n public void loginScreen() {\n logIn = new GUILogInScreen().getPanel();\n frame.setContentPane(logIn);\n ((JButton) logIn.getComponent(4)).addActionListener(e -> {\n setUsername();\n });\n }", "@Override\r\n\tpublic void login_interviewer() {\n\t\trender(\"interviewer/login.jsp\");\r\n\t}", "public LoginPOJO() {\n\n\t\tPageFactory.initElements(driver, this);\t\n\t}", "void loginDetails(LoginSuccess loginSuccess);", "public Login() {\n inicializarUsuarios();\n }", "public LoginPage() {\n }", "protected void doLogin(Authentication authentication) throws AuthenticationException {\n \n }", "@Override\n public void onClick(View v) {\n loginUser(\"999999\");\n }", "@OnClick(R.id.login_login_btn)\r\n protected void login(View view) {\n String username = StringsOperations.getTextFromEditText(mUsername);\r\n if (!GenericDialogs.isFieldValidAndShowValidMessage(username, R.string.validate_email, mContext)) {\r\n return;\r\n }\r\n\r\n String password = StringsOperations.getTextFromEditText(mPassword);\r\n if (!GenericDialogs.isFieldValidAndShowValidMessage(password, R.string.validate_password, mContext)) {\r\n return;\r\n }\r\n\r\n LoginDto loginDto = new LoginDto(username, password);\r\n mCustomProgressBar.showHideProgressBar(true, getString(R.string.loading_login));\r\n mLoginService.loginWithEmail(new ResponseCallBackHandler() {\r\n @Override\r\n public void returnResponse(ResponseHandler responseHandler) {\r\n mCustomProgressBar.showHideProgressBar(false, null);\r\n if (responseHandler.isExecuted()) {\r\n mUserSession.login((User) responseHandler.getValue());\r\n ChangeActivityHelper.changeActivityClearStack((Activity) mContext, HomeActivity.class, true);\r\n return;\r\n }\r\n\r\n // Not verified\r\n if (getString(R.string.email_not_verified).equalsIgnoreCase(responseHandler.getMessage())) {\r\n GenericDialogs.getGenericConfirmDialog(mContext, \"\", getString(R.string.login_service_failed),\r\n \"Verify Email\", GenericDialogs.OK, false, new GenericConfirmationDialogBoxCallback() {\r\n @Override\r\n public void PositiveMethod(DialogInterface dialog, int id) {\r\n Uri uri = Uri.parse(\"https://mysnsi.scubasnsi.com/verify-email\"); // missing 'http://' will cause crashed\r\n Intent intent = new Intent(Intent.ACTION_VIEW, uri);\r\n startActivity(intent);\r\n dialog.dismiss();\r\n\r\n }\r\n\r\n @Override\r\n public void NegativeMethod(DialogInterface dialog, int id) {\r\n dialog.dismiss();\r\n }\r\n });\r\n } else {\r\n //Wrong username password\r\n GenericDialogs.showInformativeDialog(responseHandler.getMessage(), mContext);\r\n }\r\n\r\n }\r\n }, loginDto);\r\n\r\n }", "@Public\n\t@Get(\"/login\")\n\tpublic void login() {\n\t\tif (userSession.isLogged()) {\n\t\t\tresult.redirectTo(HomeController.class).home();\n\t\t}\n\t}" ]
[ "0.8071522", "0.7920992", "0.77781737", "0.7647376", "0.75355715", "0.7428613", "0.7419732", "0.73825747", "0.73685384", "0.7354472", "0.7337283", "0.7329271", "0.7295023", "0.7249549", "0.7241722", "0.7192654", "0.71792126", "0.71647906", "0.7112407", "0.71118695", "0.71101207", "0.70919603", "0.7074686", "0.70596874", "0.7045319", "0.7026798", "0.70083237", "0.7001343", "0.6995199", "0.6961438", "0.6940001", "0.69326645", "0.6931325", "0.6915038", "0.6912293", "0.69066197", "0.6883967", "0.68819535", "0.68781424", "0.686005", "0.68542117", "0.6830458", "0.6818883", "0.6814951", "0.67908305", "0.67905766", "0.677818", "0.67689383", "0.6759453", "0.675771", "0.6741531", "0.67335624", "0.67291397", "0.6724697", "0.67116016", "0.6705471", "0.67051464", "0.66693956", "0.66618496", "0.6659908", "0.6655592", "0.66528535", "0.66496164", "0.6644797", "0.6642009", "0.66396457", "0.6626748", "0.6626359", "0.6625584", "0.6618905", "0.66046506", "0.65958685", "0.65952647", "0.65941304", "0.6588641", "0.65783465", "0.6576717", "0.6573231", "0.6572513", "0.6572513", "0.6566337", "0.6558632", "0.65556026", "0.65556026", "0.65536743", "0.6552548", "0.65517074", "0.6547583", "0.654419", "0.6543809", "0.6539239", "0.6537518", "0.6537314", "0.65292287", "0.6527315", "0.65260136", "0.65234756", "0.6515529", "0.6512922", "0.650274" ]
0.74133015
7
TODO Autogenerated method stub
@Override public void onClick(View v) { FragmentHelper.replaceFragment(R.id.fl_fragment_holder, getFragmentManager(), ShareFansFragment.class); }
{ "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 protected void getUserList(boolean isRefresh) { super.getUserList(isRefresh); DamiInfo.getFollowerList(mLogin.uid, searchHolder.getPage(), searchHolder.searchText, new MyListener( getActivity(), isRefresh)); }
{ "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 onResume() { super.onResume(); getShareActivity().setTitleText(R.string.follow); getShareActivity().setBackListener(null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
Nothing to do here
protected void handlePurchaseFinished(AmazonPurchaseType purchase) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n\tprotected void interr() {\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\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "private stendhal() {\n\t}", "public void smell() {\n\t\t\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "private void poetries() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\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}", "private static void cajas() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}", "private void kk12() {\n\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "private void getStatus() {\n\t\t\n\t}", "protected void mo6255a() {\n }", "public void mo38117a() {\n }", "public void baocun() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\tprotected void prepare()\r\n\t{\r\n\r\n\t}", "private void strin() {\n\n\t}", "@Override\n\tprotected void prepare() {\n\t\t\n\t}", "@Override\n protected void prot() {\n }", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "public void mo4359a() {\n }", "@Override\n\tpublic void einkaufen() {\n\t}", "public void method_4270() {}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "public void redibujarAlgoformers() {\n\t\t\n\t}", "@Override\n\tpublic void apply() {\n\t\t\n\t}", "@Override\n public void preprocess() {\n }", "@Override\n\tpublic void emprestimo() {\n\n\t}", "private void m50366E() {\n }", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\r\n\tprotected void compute() {\n\t\t\r\n\t}", "@Override\n\tpublic void processing() {\n\n\t}", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\n protected void init() {\n }", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void doNext() {\n\t\t\r\n\t}", "@Override\n public void memoria() {\n \n }", "private static void iterator() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void crawl_data() {\n\t\t\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\t\r\n\t\t\t}", "protected void additionalProcessing() {\n\t}", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n public void preprocess() {\n }", "@Override\r\n\tpublic void runn() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void processInit() {\n\r\n\t}", "@Override\n public int describeContents() { return 0; }", "public void mo12628c() {\n }", "@Override\r\n\tprotected void processInit() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void doF6() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\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 }", "private void parseData() {\n\t\t\r\n\t}" ]
[ "0.65027386", "0.64400053", "0.6435486", "0.6430571", "0.63487476", "0.63076884", "0.6240374", "0.6240374", "0.62271625", "0.61729383", "0.61623496", "0.61500907", "0.6111769", "0.61006016", "0.60868824", "0.6081051", "0.60508543", "0.60442185", "0.6023228", "0.60147023", "0.6006567", "0.59808314", "0.59742886", "0.5969572", "0.5969572", "0.59400845", "0.59398544", "0.5937743", "0.5936227", "0.59198403", "0.5904511", "0.58683056", "0.58518475", "0.5851267", "0.5847452", "0.5843994", "0.5804087", "0.57968515", "0.57875687", "0.57870054", "0.5784466", "0.57764775", "0.5775679", "0.57687235", "0.57666314", "0.57498425", "0.57498425", "0.57393026", "0.5737812", "0.57283133", "0.57214046", "0.57078314", "0.57078314", "0.570711", "0.57047766", "0.5703634", "0.57025415", "0.56998044", "0.5695179", "0.56935096", "0.56909245", "0.5681309", "0.56786865", "0.5671961", "0.5669103", "0.56548536", "0.5654734", "0.56507444", "0.564659", "0.5641312", "0.56394565", "0.5638138", "0.56345594", "0.56328833", "0.563125", "0.563125", "0.562094", "0.5619388", "0.5613634", "0.5611167", "0.56109047", "0.56076306", "0.5607608", "0.5604322", "0.5601616", "0.5600412", "0.559659", "0.55924207", "0.55924207", "0.55924207", "0.55924207", "0.55924207", "0.55924207", "0.5587246", "0.5587246", "0.5587246", "0.5587246", "0.5587246", "0.5587246", "0.5587246", "0.55855614" ]
0.0
-1
move the cursor to the left until left gap end is hit while also shifting chars to the right
private void left(int pos) { while (pos < gapLeft) { gapLeft--; gapRight--; buffer[gapRight+1] = buffer[gapLeft]; buffer[gapLeft] = '\0'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void moveLeft(){\n if(currentText != null) {\n //The saved character index should no longer be restored\n savedCharacterIndex = -1;\n\n //Try to move the cursor\n characterIndex -= 1;\n //If the cursor did not wrap onto a new line then update it's position\n if (characterIndex >= 0) {\n updateXPosition(true);\n }\n //If the cursor wrapped onto a new line\n else {\n //If this was not the very first line move to the end of the previous line\n if (lineIndex > 0) {\n lineIndex--;\n currentText = texts.get(lineIndex);\n characterIndex = currentText.getCharacterEdges().length - 1;\n if (characterIndex < 0) {\n characterIndex = 0;\n }\n updatePosition();\n }\n //If this is the first line character index should not change and position does not need to be updated\n else {\n characterIndex = 0;\n }\n }\n }\n }", "public void moveSelectionLeft(){\n Cursor c = getCursor();\n int line = c.getLeftLine();\n int column = c.getLeftColumn();\n if(column - 1 >= 0){\n int toLeft = 1;\n if(column - 2 >= 0) {\n char ch = mText.charAt(line,column - 2);\n if(isEmoji(ch)) {\n column--;\n toLeft++;\n }\n }\n setSelection(line, column - 1);\n if(mACPanel.isShowing()) {\n String prefix = mACPanel.getPrefix();\n if(prefix.length() > toLeft) {\n prefix = prefix.substring(0,prefix.length() - toLeft);\n mACPanel.setPrefix(prefix);\n }else{\n mACPanel.hide();\n }\n }\n if(column - 1 <= 0) {\n mACPanel.hide();\n }\n }else{\n if(line == 0){\n setSelection(0, 0);\n }else{\n int c_column = getText().getColumnCount(line - 1);\n setSelection(line - 1, c_column);\n }\n }\n }", "public void moveCursorLeft();", "public void moveLeft()\n {\n if (!this.search_zone.isLeftBorder(this.x_position))\n {\n this.x_position = (this.x_position - 1);\n }\n }", "public void moveCursorRight();", "public void moveSelectionRight(){\n Cursor c = getCursor();\n int line = c.getLeftLine();\n int column = c.getLeftColumn();\n int c_column = getText().getColumnCount(line);\n if(column + 1 <= c_column){\n char ch = mText.charAt(line,column);\n boolean emoji;\n if(emoji = isEmoji(ch)) {\n column ++;\n if(column + 1 > c_column){\n column--;\n }\n }\n if(!emoji && mACPanel.isShowing()) {\n if(!mLanguage.isAutoCompleteChar(ch)) {\n mACPanel.hide();\n }else{\n String prefix = mACPanel.getPrefix() + ch;\n mACPanel.setPrefix(prefix);\n }\n }\n setSelection(line, column + 1);\n }else{\n if(line + 1 == getLineCount()){\n setSelection(line, c_column);\n }else{\n setSelection(line + 1, 0);\n }\n }\n }", "public void moveRight(){\n if(currentText != null) {\n //The saved character index should no longer be restored\n savedCharacterIndex = -1;\n\n //Try to move the cursor\n characterIndex += 1;\n //If the cursor did not wrap onto a new line then update it's position\n if (characterIndex < currentText.getCharacterEdges().length) {\n updateXPosition(true);\n }\n //If the cursor wrapped onto a new line\n else {\n //If this was not the very last line move to the beginning of the next line\n if (lineIndex < texts.size() - 1) {\n lineIndex++;\n currentText = texts.get(lineIndex);\n characterIndex = 0;\n updatePosition();\n }\n //If this is the last line character index should not change and position does not need to be updated\n else {\n characterIndex = currentText.getCharacterEdges().length - 1;\n }\n }\n }\n }", "public void moveShiftLeft();", "public void moveLeft() {\r\n\t\tif (x > 0) x--; \r\n\t}", "public static String moveLeft(int n) {\n return CSI + n + \"D\";\n }", "public void moveLeft() {\n locX = locX - 1;\n }", "public void moveLeft() {\n if (rec.getUpperLeft().getX() - 5 < leftBorder) {\n rec.getUpperLeft().setX(leftBorder);\n } else {\n rec.getUpperLeft().setX(rec.getUpperLeft().getX() - 5);\n }\n\n }", "private void right(int pos) {\n while (pos > gapLeft) {\n gapLeft++;\n gapRight++;\n buffer[gapLeft-1] = buffer[gapRight];\n buffer[gapRight] = '\\0';\n }\n }", "public void moveLeft()\n\t{\n\t\tx = x - STEP_SIZE;\n\t}", "public void moveLeft()\n {\n if (this.x >= 2) {\n --x;\n } else {\n System.out.println(\"Move is outside of the field! Try again.\");\n }\n }", "private void cursorMoveRightest() {\n\t\td(\"Warn cursorMoveRightest() NOT implemented\");\r\n\t}", "@Override\n\tpublic void moveLeft()\n\t{\n\t\tif (!isAtStart()) right.push(left.pop());\n\n\t}", "public void moveLeft() {\r\n\t\t\r\n\t\tint leftSteps=10;\r\n\t\t\ttopX-= leftSteps;\r\n\t}", "public void left(){\n\t\tmoveX=-1;\n\t\tmoveY=0;\n\t}", "public void moveLeft()\n\t{\n\t\tcol--;\n\t}", "public void cursorDown() throws IndexOutOfBoundsException {\n if(cursor == size()-1)\n throw new IndexOutOfBoundsException(\"Exception: Current line is size()-1!\");\n //Setting the cursor to be the text line after its current position.\n cursor++;\n }", "private int huntLeft(String in, int offset) {\n char temp = 0;\n for(int i = offset - 1; i >= 0; i--) {\n temp = in.charAt(i);\n if(temp == '\\n' || temp == '\\r')\n return i;\n }\n return 0; //eof counts\n }", "public void moveLeft() {\n this.x -= 10;\n repaint();\n }", "public void shiftRangeFarLeft() {\n Range r = new Range(1, getRange().getLength());\n setLocation(r);\n }", "void moveLeft() {\n\t\tsetX(x-1);\r\n\t\tdx=-1;\r\n\t\tdy=0;\r\n\t}", "public String shiftLeft(String text, int x) {\n\t\tString toShift = text.substring(text.length() - x , text.length());\n\t\tString newCipher = toShift += text;\n\t\tString result = newCipher.substring(0, toShift.length() - x);\n\t\t\n\t\treturn result;\n\t}", "public void cursorUp() throws IndexOutOfBoundsException {\n if(cursor <= 0)\n throw new IndexOutOfBoundsException(\"Exception: Cursor is currently at line \"+cursor);\n //Setting the cursor to be the text line before its current position.\n cursor--;\n }", "public void moveRight()\n {\n if (!this.search_zone.isRightBorder(this.x_position))\n {\n this.x_position = (this.x_position + 1);\n }\n }", "public void moveLeft() {\n Coordinate leftCoord = new Coordinate(getX() - 1, getY());\n handleMove(leftCoord, InteractionHandler.LEFT);\n }", "public void moveLeft() {\n\t\tsetPosX(getPosX() - steps);\n\t}", "public void moveLeft() {\n this.accelerateXL();\n this.moveX(this.getxSpeed());\n this.setPicX(0);\n this.setPicY(141);\n this.setLoopCells(true);\n }", "public static char getsLeft() {\n\t\t\treturn sLeft;\n\t\t}", "@Override\n\tpublic void backspace()\n\t{\n\t\tif (!isAtStart()) left.pop();\n\t}", "public void moveLeft() {\n\t\t\n\t}", "private AminoAction AlignLeft(final SketchDocument doc) {\n return named(\"Align Left\", groupOnly(doc, new AminoAction() {\n @Override\n public void execute() throws Exception {\n double val = apply(doc.getSelection(), Double.MAX_VALUE, new Accumulate<Double>() {\n public Double accum(SketchNode node, Double value) {\n return Math.min(value, node.getInputBounds().getX() + node.getTranslateX());\n }\n });\n \n apply(doc.getSelection(), val, new Accumulate<Double>() {\n public Double accum(SketchNode node, Double value) {\n double x = node.getInputBounds().getX() + node.getTranslateX();\n node.setTranslateX(node.getTranslateX() + value - x);\n return value;\n }\n });\n }\n }));\n }", "public Dir moveLeft() {\n\t\t\tint newDir = (this.ordinal() + SIZE - 1) % SIZE;\n\t\t\treturn dirArray[newDir];\n\t\t}", "public void moveRight() {\r\n\t\tif (x < space.getSize() - 1) x++; \r\n\t}", "private void moveRightLeft(int Width) {\n if (goingRight) {\n if (getX() + wolfWidth >= Width) turnAround();\n else setX(getX() + Width / 40);\n } else {\n if (getX() <= 0) turnAround();\n else setX(getX() - Width / 40);\n }\n }", "private Position nextPositionLeftToRight(Position pos) {\n return (pos.getColNum() == nCols - 1\n ? new Position(pos.getRowNum(), 0)\n : new Position(pos.getRowNum(), pos.getColNum() + 1));\n }", "public void moveSelectionHome(){\n setSelection(mCursor.getLeftLine(), 0);\n }", "public void moveSelectionDown(){\n if(mACPanel.isShowing()) {\n mACPanel.moveDown();\n return;\n }\n Cursor c = getCursor();\n int line = c.getLeftLine();\n int column = c.getLeftColumn();\n int c_line = getText().getLineCount();\n if(line + 1 >= c_line){\n setSelection(line, getText().getColumnCount(line));\n }else{\n int c_column = getText().getColumnCount(line + 1);\n if(column > c_column){\n column = c_column;\n }\n setSelection(line + 1, column);\n }\n }", "public void shiftRangeLeft() {\n shiftRange(false, 0.5);\n }", "public void moveShiftRight();", "private int jumpCursor() {\n if (cc == columns) {\n if (cl + 1 == lines)\n cl = 0;\n else\n ++cl;\n\n cc = 0;\n }\n\n return cc++;\n }", "public void selectionLeft() {\n\t\tselectedSlotPosX = (selectedSlotPosX == 0) ? C.MENU_INVENTORY_ITEM_SLOT_WIDTH - 1 : selectedSlotPosX-1;\n\t}", "@Override\r\n\tpublic String moveLeft() {\n\r\n\t\tif((0<x && x<=50) && (0<=y && y<=10) && (0<=z && z<=50))\r\n\t\t{\r\n\t\t\tx--;\r\n\t\t}\r\n\t\telse if((0<x && x<=50) && (40<=y && y<=50) && (0<=z && z<=50))\r\n\t\t{\r\n\t\t\tx--;\r\n\t\t}\r\n\t\telse if((0<x && x<=50) && (0<=y && y<=50) && (0<=z && z<=10))\r\n\t\t{\r\n\t\t\tx--;\r\n\t\t}\r\n\t\telse if((0<x && x<=10) && (0<=y && y<=50) && (0<=z && z<=50))\r\n\t\t{\r\n\t\t\tx--;\r\n\t\t}\r\n\t\telse if((0<x && x<=50) && (0<=y && y<=50) && (40<=z && z<=50))\r\n\t\t{\r\n\t\t\tx--;\r\n\t\t}\r\n\t\telse if((40<x && x<=50) && (0<=y && y<=50) && (0<=z && z<=50))\r\n\t\t{\r\n\t\t\tx--;\r\n\t\t}\r\n\t\treturn getFormatedCoordinates();\r\n\t}", "public void insertBeforeCursor(String s) {\n if(this.isEmpty() || cursor==-1)\n {\n lines.addFirst(s);\n }\n else\n lines.addBefore(new PositionObject<>(lines.get(cursor)), s);\n //cursor--;\n }", "public Vertex moveLeft() {\n for (Edge e : current.outEdges) {\n move(e.to.x == current.x - 1, e);\n }\n return current;\n }", "public void goLeft() {\n\t\tx -= dx;\n\t\tbgBack.setDx(true);\n\t\tbgBack.move();\n\t\tif(x < 200) {\n\t\t\tif(!bgBack.getReachBegin()) {\n\t\t\t\tx = 200;\n\t\t\t\tbgFront.setDx(true);\n\t\t\t\tbgFront.move();\n\t\t\t}\n\t\t\telse if(x < 50) {\n\t\t\t\tx = 50;\n\t\t\t}\n\t\t}\n\n\t}", "public void turnLeft() {\r\n setDirection( modulo( myDirection-1, 4 ) );\r\n }", "public void moveSelectionEnd(){\n int line = mCursor.getLeftLine();\n setSelection(line, getText().getColumnCount(line));\n }", "public void moveLeft() {\n \tif(!move.moveLeft()) {\n \t\tif(physinteractor(getX()-1,getY())) {\n \t\t\tmove.moveLeft();\n \t\t\tnonphysinteractor(getX(),getY());\n \t\t\tupdatemove();\n \t\t}\n }else {\n \tupdatemove();\n \tnonphysinteractor(getX(),getY());\n }\n }", "protected void left() {\n move(positionX - 1, positionY);\n orientation = BattleGrid.RIGHT_ANGLE * 2;\n }", "public void moveLeft(){\n myRectangle.setX(myRectangle.getX() - PADDLE_SPEED);\n }", "public void removeByLeftShift(int pos) {\r\n if (pos > 0 || pos < size - 1) {\r\n int nshift = size - pos - 1;\r\n int from = ((start + pos) + 1) % cir.length;\r\n int to = from - 1;\r\n if (to < 0) {\r\n to = cir.length - 1;\r\n }\r\n // int to=from--;\r\n for (int i = 0; i < nshift; i++) {\r\n cir[to % cir.length] = cir[from % cir.length];\r\n to = from;\r\n from++;\r\n }\r\n cir[(start + size - 1) % cir.length] = \"null\";\r\n // start++;\r\n size--;\r\n }\r\n }", "public void moveLeft()\n\t{\n\t\tmoveLeft = true;\n\t}", "public void moveLeft(){\n\t\tif(GameSystem.TWO_PLAYER_MODE){\n\t\t\tif(Game.getPlayer2().dying){\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif(animation==ANIMATION.DAMAGED||Game.getPlayer().dying||channelling||charging) return;\n\t\tmoving=true;\n\t\tbuttonReleased=false;\n\t\torientation=ORIENTATION.LEFT;\n\t\tif(animation!=ANIMATION.MOVELEFT) {\n\t\t\tanimation=ANIMATION.MOVELEFT;\n\t\t\tif(run!=null) sequence.startSequence(run);\n\t\t}\n\t\tfacing=FACING.LEFT;\n\t\tdirection=\"left\";\n\t\tsetNextXY();\n\t\tsetDestination(nextX,nextY);\n\t\tvelX=-1*spd/2;\n\t\tvelY=0;\n\t}", "void putLeftWordToRight(int end) {\n\n String word = bufferLeft.pop();\n int index = end - word.length() + 1;\n System.arraycopy(word.toCharArray(), 0, words, index, word.length());\n words[index-1] = ' ';\n\n }", "private void lineJumpHelper(int curX) {\n int accX = 0;\n while (true) {\n if (textBuffer.isEnd()) {\n textBuffer.decreCurrent(false);\n return;\n }\n if (textBuffer.currentPos_current().getText().equals(\"\\n\")) {\n textBuffer.decreCurrent(false);\n return;\n }\n Text text = textBuffer.currentPos_current();\n accX += round(text.getLayoutBounds().getWidth());\n if (accX > curX) {\n textBuffer.decreCurrent(false);\n return;\n }\n textBuffer.increCurrent(false);\n }\n }", "private void moveTo(int position) {\n if (position < gapLeft) {\n left(position);\n }\n else {\n right(position);\n }\n }", "public void moveDown(){\n if(currentText != null) {\n //If this is not the very last text\n if (lineIndex < texts.size() - 1) {\n //Move down\n lineIndex++;\n currentText = texts.get(lineIndex);\n\n //Try to use the saved character index as the character index\n if (savedCharacterIndex != -1) {\n characterIndex = savedCharacterIndex;\n }\n\n //Ensure that character index is within the bounds of the text\n if (characterIndex > currentText.getCharacterEdges().length - 1) {\n //Save the character index\n if (characterIndex > savedCharacterIndex) {\n savedCharacterIndex = characterIndex;\n }\n characterIndex = currentText.getCharacterEdges().length - 1;\n }\n\n //Update the position\n updatePosition();\n }\n //If this is the last line then the cursor should be moved to the end of the line\n else {\n //The saved character index should no longer be restored\n savedCharacterIndex = -1;\n\n characterIndex = currentText.getCharacterEdges().length - 1;\n updateXPosition(true);\n }\n }\n }", "void movePrev()\n\t{\n\t\tif (cursor != null) \n\t\t{\n\t\t\tif (cursor == front) \n\t\t\t{\n\t\t\t\tcursor = null;\n index = -1; //added this because i kept failing the test cases on the grading script\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcursor = cursor.prev; //moves cursor toward front of the list\n index--; //added this because i kept failing the test cases on the grading script\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic boolean moveLeft() {\n\t\tboolean rs = super.moveLeft();\n\t\tif(rs == true){\n\t\t}\n\t\treturn rs;\n\t}", "private void moveLeft(){\n \n setGlobalLocation(getGlobalX() - speed, getGlobalY());\n animationSpeedLeft();\n }", "@Override\n public void onDirectLeftKeyPress() {\n \n }", "@Override\n public void onDirectLeftKeyPress() {\n \n }", "public void moveFromHandToStartOfWord() {\n\t\t//check letters in hand\n\t\tif(hand.size() == 0) {\n\t\t\treturn;\n\t\t}\n\t\t// remove letter from hand\n\t\tLetter temp = hand.leftmost;\n\t\thand.remove();\n\t\ttemp.next = null;\n\n\t\t// add letter to start of word\n\t\tword.addToStart(temp);\n\t}", "private void LeftRightLeft() {\n \tRobot.cubebase.stopall();\n \twhile (true) \n \t{\n \t\t//first.take cube down and lift to high\n \t\tif (Robot.autotime.get()<1) {\n\t\t\t\tRobot.drivebase.run(.53, -.53);\n\t\t\t}\n \t\tif (Robot.autotime.get()>=1) {\n\t\t\t\tRobot.drivebase.Stop();\n\t\t\t\tbreak;\n\t\t\t}\n \t\t\n \t\n \t}\n \t}", "public static void setLeft(char left) {\n\t\t\tGamePreferences.left = left;\n\t\t}", "public void moveLeft()\n {\n if (xPos == 0)\n {\n movementY = 0;\n movementX = 0;\n }\n\n // Set the movement factor - negative X because we are moving LEFT! \n movementX = -0.5;\n movementY = 0;\n }", "protected void refillLeft(){\n\t\tif(!shouldRepeat && isSrollingDisabled) return; //prevent next layout calls to override first init to scrolling disabled by falling to this branch\n\t\tif(getChildCount() == 0) return;\n\t\t\n\t\tfinal int leftScreenEdge = getScrollX();\n\t\t\n\t\tView child = getChildAt(0);\n\t\tint childLeft = child.getLeft();\n\t\tint currLayoutRight = childLeft - ((LoopLayoutParams)child.getLayoutParams()).leftMargin;\n\t\twhile(currLayoutRight > leftScreenEdge){\n\t\t\tmFirstItemPosition--;\n\t\t\tif(mFirstItemPosition < 0) mFirstItemPosition = mAdapter.getCount()-1;\n\t\t\t\n\t\t\tchild = mAdapter.getView(mFirstItemPosition, getCachedView(), this);\n Validate.notNull(child,\"Your adapter has returned null from getView.\");\n\t\t\tchild = addAndMeasureChildHorizontal(child, LAYOUT_MODE_TO_BEFORE);\n\t\t\tcurrLayoutRight = layoutChildHorizontalToBefore(child, currLayoutRight, (LoopLayoutParams) child.getLayoutParams());\n\t\t\tchildLeft = child.getLeft() - ((LoopLayoutParams)child.getLayoutParams()).leftMargin;\n\t\t\t//update left edge of children in container\n\t\t\tmLeftChildEdge = childLeft;\n\t\t\t\n\t\t\t//if selected view is going to screen, set selected state on him\n\t\t\tif(mFirstItemPosition == mSelectedPosition){\n\t\t\t\tchild.setSelected(true);\n\t\t\t}\n\t\t}\n\t}", "public boolean moveLeft() {\r\n\t\tif (this.x <= 0 == true) {\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\tthis.x -= 5;\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "private void LeftLeftRight() {\n \tRobot.cubebase.stopall();\n \twhile (true) \n \t{\n \t\t//first.take cube down and lift to high\n \t\tif (Robot.autotime.get()<1) {\n\t\t\t\tRobot.drivebase.run(.53, -.53);\n\t\t\t}\n \t\tif (Robot.autotime.get()>=1) {\n\t\t\t\tRobot.drivebase.Stop();\n\t\t\t\tbreak;\n\t\t\t}\n \t\t\n \t\n \t}\n \t}", "public void justifyLeft() {\n\t\tleft.left();\n\t}", "public void shiftLeft() {\n int currentPointer = this.registerPointer;\n\n if (currentPointer == 0)\n this.registerPointer = this.registerCapacity - 1;\n else\n this.registerPointer -= 1;\n }", "private void moveLeft(int index) {\n for (int i = index; i < dataSize; i++) {\n array[i] = array[i + 1];\n }\n\n array[dataSize] = 0;\n }", "public void shiftCompressedWordsLeft(final int startWord, final int shift) {\n\t\tSystem.arraycopy(this.buffer, startWord, this.buffer,\n\t\t\t\tstartWord - shift, actualsizeinwords - startWord);\n\n\t\t// zero remaining words\n\t\tfor (int i = actualsizeinwords - 1; i >= actualsizeinwords - shift; i--)\n\t\t\tthis.buffer[i] = 0;\n\n\t\tactualsizeinwords -= shift;\n\t\tif (startWord <= rlw.position)\n\t\t\trlw.position -= shift;\n\t}", "@Override\r\n\tpublic void moveLeft() {\n\t\tswitch(state) {\r\n\t\tcase 0: case 2:\r\n\t\t\t{\r\n\t\t\t\tboolean ok = true;\r\n\t\t\t\tfor(Case c: cases) {\r\n\t\t\t\t\tif(!grille.isEmpty(c.getX()+x-1, c.getY()+y))\r\n\t\t\t\t\t\tok = false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(ok)\r\n\t\t\t\t\t--x;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase 1:\r\n\t\t{\r\n\t\t\tint x3 = cases.get(3).getX()-1, y3 = cases.get(3).getY();\r\n\t\t\tif(grille.isEmpty(x+x3, y+y3))\r\n\t\t\t\t--x;\r\n\t\t\t\r\n\t\t}\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase 3:\r\n\t\t{\r\n\t\t\tint x0 = cases.get(0).getX()-1, y0 = cases.get(0).getY();\r\n\t\t\tif(grille.isEmpty(x+x0, y+y0))\r\n\t\t\t\t--x;\r\n\t\t}\r\n\t\tbreak;\r\n\t\t\r\n\t\tdefault : \r\n\t\t\treturn;\r\n\t\t}\r\n\t}", "public void goLeft()\r\n\t{\r\n\t\tthis.X--;\r\n\t}", "void moveBack()\n\t{\n\t\tif (length != 0) \n\t\t{\n\t\t\tcursor = back; \n\t\t\tindex = length - 1; //cursor will be at the back\n\t\t\t\n\t\t}\n\t}", "public void goLeft() {\n if(page.left == null)\n {\n if(editText.getText().toString().equals(\"\")) {\n return;\n }\n page.addRelation(\"left\",editText.getText().toString());\n editText.setText(\"\");\n }\n\n page = page.left;\n addQueue();\n }", "public void left() {\n if (x - movementSpeed > -55) {\r\n x = x - movementSpeed;\r\n }\r\n }", "public boolean slideLeft() {\n\t\tif (currentCol > 0) {\n\t\t\tboard[currentRow][currentCol] = board[currentRow][currentCol - 1];\n\t\t\tcurrentCol--;\n\t\t\tboard[currentRow][currentCol] = '0';\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public void moveAsteroidLeftToRight() {\t\r\n\t\tsetY(this.getY()+1);\r\n\t}", "public static String getWordLeftOfOffset(CharSequence text, int cursorOffset) {\n\t\treturn grabWord(text, cursorOffset - 1, false);\n\t}", "void positionToStart () {\n currentRow = 0 - currentPiece.getOffset();\n currentColumn = board.columns / 2 - currentPiece.width / 2;\n }", "private void selectHelper(int curX, boolean type) {\n int accX = 0;\n while (true) {\n if (textBuffer.isEnd()) {\n textBuffer.decreCurrent(false);\n selectByType(type);\n return;\n }\n if (textBuffer.currentPos_current().getText().equals(\"\\n\")) {\n textBuffer.decreCurrent(false);\n selectByType(type);\n return;\n }\n Text text = textBuffer.currentPos_current();\n accX += round(text.getLayoutBounds().getWidth());\n if (accX > curX) {\n textBuffer.decreCurrent(false);\n selectByType(type);\n return;\n }\n textBuffer.increCurrent(false);\n }\n }", "public boolean moveLeft() {\n\t\tif (check(col-1, row)) {\n\t\t\tHiVolts.board.squares[row][col] = 0;\n\t\t\tcol = col - 1;\n\t\t\tHiVolts.board.squares[row][col] = 2;\n\t\t\tsuper.moveLeft();\n\t\t}\n\t\treturn true;\n\t}", "public void\nshiftToOrigin()\n{\n\tthis.setLine(0.0, 0.0,\n\t\tthis.getP2().getX() - this.getP1().getX(),\n\t\tthis.getP2().getY() - this.getP1().getY());\n}", "public void leftPressed() {\n System.out.println(\"leftPressed()\");\n current.translate(0, -1);\n display.showBlocks();\n }", "void moveFront()\n\t{\n\t\tif (length != 0)\n\t\t {\n\t\t\tcursor = front;\n\t\t\tindex = 0; //cursor will be at the front\n\t\t\t\n\n\t\t}\n\t}", "void moveLeft();", "public static String moveHorizontal(int n) {\n\n if (n <= 0)\n n = 1;\n\n return CSI + n + 'G';\n }", "public void moveRight() {\n\t\tif (x1 < 24 && x2 < 24 && x3 < 24 && x4 < 24) {\n\t\t\tclearPiece();\n\t\t\tx1 += 1;\n\t\t\tx2 += 1;\n\t\t\tx3 += 1;\n\t\t\tx4 += 1;\n\t\t\tsetPiece();\n\t\t\trepaint();\n\t\t}\n\t}", "private static void OnFlowDirectionCommand(TextEditor This, Key key) \r\n { \r\n //\r\n\r\n using (This.Selection.DeclareChangeBlock())\r\n {\r\n if (key == Key.LeftShift)\r\n { \r\n if (This.AcceptsRichContent && (This.Selection is TextSelection))\r\n { \r\n // NOTE: We do not call OnApplyProperty to avoid recursion for FlushPendingInput \r\n ((TextSelection)This.Selection).ApplyPropertyValue(FlowDocument.FlowDirectionProperty, FlowDirection.LeftToRight, /*applyToParagraphs*/true);\r\n } \r\n else\r\n {\r\n Invariant.Assert(This.UiScope != null);\r\n UIElementPropertyUndoUnit.Add(This.TextContainer, This.UiScope, FrameworkElement.FlowDirectionProperty, FlowDirection.LeftToRight); \r\n This.UiScope.SetValue(FrameworkElement.FlowDirectionProperty, FlowDirection.LeftToRight);\r\n } \r\n } \r\n else\r\n { \r\n Invariant.Assert(key == Key.RightShift);\r\n\r\n if (This.AcceptsRichContent && (This.Selection is TextSelection))\r\n { \r\n // NOTE: We do not call OnApplyProperty to avoid recursion for FlushPendingInput\r\n ((TextSelection)This.Selection).ApplyPropertyValue(FlowDocument.FlowDirectionProperty, FlowDirection.RightToLeft, /*applyToParagraphs*/true); \r\n } \r\n else\r\n { \r\n Invariant.Assert(This.UiScope != null);\r\n UIElementPropertyUndoUnit.Add(This.TextContainer, This.UiScope, FrameworkElement.FlowDirectionProperty, FlowDirection.RightToLeft);\r\n This.UiScope.SetValue(FrameworkElement.FlowDirectionProperty, FlowDirection.RightToLeft);\r\n } \r\n }\r\n ((TextSelection)This.Selection).UpdateCaretState(CaretScrollMethod.Simple); \r\n } \r\n }", "public void setCursor(int l, int c);", "private int handleGeneratedSpaces(char[] dest,\n int start,\n int length) {\n\n int lenOptionsLamAlef = options & LAMALEF_MASK;\n int lenOptionsTashkeel = options & TASHKEEL_MASK;\n boolean lamAlefOn = false;\n boolean tashkeelOn = false;\n\n if (!isLogical & !spacesRelativeToTextBeginEnd) {\n switch (lenOptionsLamAlef) {\n case LAMALEF_BEGIN: lenOptionsLamAlef = LAMALEF_END; break;\n case LAMALEF_END: lenOptionsLamAlef = LAMALEF_BEGIN; break;\n default: break;\n }\n switch (lenOptionsTashkeel){\n case TASHKEEL_BEGIN: lenOptionsTashkeel = TASHKEEL_END; break;\n case TASHKEEL_END: lenOptionsTashkeel = TASHKEEL_BEGIN; break;\n default: break;\n }\n }\n\n\n if (lenOptionsLamAlef == LAMALEF_NEAR) {\n for (int i = start, e = i + length; i < e; ++i) {\n if (dest[i] == LAMALEF_SPACE_SUB) {\n dest[i] = SPACE_CHAR;\n }\n }\n\n } else {\n\n final int e = start + length;\n int wL = countSpaceSub(dest, length, LAMALEF_SPACE_SUB);\n int wT = countSpaceSub(dest, length, TASHKEEL_SPACE_SUB);\n\n if (lenOptionsLamAlef == LAMALEF_END){\n lamAlefOn = true;\n }\n if (lenOptionsTashkeel == TASHKEEL_END){\n tashkeelOn = true;\n }\n\n\n if (lamAlefOn && (lenOptionsLamAlef == LAMALEF_END)) {\n shiftArray(dest, start, e, LAMALEF_SPACE_SUB);\n while (wL > start) {\n dest[--wL] = SPACE_CHAR;\n }\n }\n\n if (tashkeelOn && (lenOptionsTashkeel == TASHKEEL_END)){\n shiftArray(dest, start, e, TASHKEEL_SPACE_SUB);\n while (wT > start) {\n dest[--wT] = SPACE_CHAR;\n }\n }\n\n lamAlefOn = false;\n tashkeelOn = false;\n\n if (lenOptionsLamAlef == LAMALEF_RESIZE){\n lamAlefOn = true;\n }\n if (lenOptionsTashkeel == TASHKEEL_RESIZE){\n tashkeelOn = true;\n }\n\n if (lamAlefOn && (lenOptionsLamAlef == LAMALEF_RESIZE)){\n shiftArray(dest, start, e, LAMALEF_SPACE_SUB);\n wL = flipArray(dest,start,e, wL);\n length = wL - start;\n }\n if (tashkeelOn && (lenOptionsTashkeel == TASHKEEL_RESIZE)) {\n shiftArray(dest, start, e, TASHKEEL_SPACE_SUB);\n wT = flipArray(dest,start,e, wT);\n length = wT - start;\n }\n\n lamAlefOn = false;\n tashkeelOn = false;\n\n if ((lenOptionsLamAlef == LAMALEF_BEGIN) ||\n (lenOptionsLamAlef == LAMALEF_AUTO)){\n lamAlefOn = true;\n }\n if (lenOptionsTashkeel == TASHKEEL_BEGIN){\n tashkeelOn = true;\n }\n\n if (lamAlefOn && ((lenOptionsLamAlef == LAMALEF_BEGIN)||\n (lenOptionsLamAlef == LAMALEF_AUTO))) { // spaces at beginning\n shiftArray(dest, start, e, LAMALEF_SPACE_SUB);\n wL = flipArray(dest,start,e, wL);\n while (wL < e) {\n dest[wL++] = SPACE_CHAR;\n }\n }\n if(tashkeelOn && (lenOptionsTashkeel == TASHKEEL_BEGIN)){\n shiftArray(dest, start, e, TASHKEEL_SPACE_SUB);\n wT = flipArray(dest,start,e, wT);\n while (wT < e) {\n dest[wT++] = SPACE_CHAR;\n }\n }\n }\n\n return length;\n }", "public String left() {\n if (!(this.styledValueElements instanceof ShiftedText)) {\n this.styledValueElements = new ShiftedText(this.styledValue);\n } else {\n ((ShiftedText) this.styledValueElements).shiftLeft();\n }\n\n this.value = this.styledValueElements.stringify();\n return this.value;\n }", "@Override\n public void beforeTextChanged(CharSequence s, int start, int count, int after) {\n cursorComplement = s.length() - campoTelefono.getSelectionStart();\n //we check if the user ir inputing or erasing a character\n if (count > after) {\n backspacingFlag = true;\n } else {\n backspacingFlag = false;\n }\n }", "public void moveRight() {\n locX = locX + 1;\n }" ]
[ "0.7420903", "0.7390789", "0.7329771", "0.6772517", "0.66507256", "0.6474027", "0.6419076", "0.63760585", "0.61960745", "0.6192656", "0.619231", "0.6170128", "0.6150303", "0.6144912", "0.6100825", "0.6085334", "0.60779405", "0.6031845", "0.601916", "0.5977885", "0.59698725", "0.5962101", "0.5948028", "0.5900803", "0.589575", "0.58919865", "0.5888034", "0.5884779", "0.5858486", "0.5857162", "0.5839537", "0.583124", "0.58284557", "0.5805729", "0.5788921", "0.57673573", "0.5760131", "0.5753728", "0.5752297", "0.5740108", "0.5733675", "0.57325304", "0.570704", "0.5700962", "0.5697653", "0.56590986", "0.5656145", "0.5640229", "0.5621589", "0.56060624", "0.55946016", "0.559309", "0.5593021", "0.5593003", "0.5579366", "0.5576188", "0.5568756", "0.55685186", "0.55627733", "0.5558543", "0.55450016", "0.5540845", "0.55332917", "0.5532738", "0.5531154", "0.5531154", "0.55266297", "0.54963344", "0.5494098", "0.54841757", "0.5480007", "0.54770947", "0.5467958", "0.546241", "0.54616576", "0.54461956", "0.5442887", "0.54278326", "0.54247856", "0.54166013", "0.5415513", "0.54151255", "0.5412343", "0.5407212", "0.5402994", "0.5401225", "0.5391053", "0.53879124", "0.53876173", "0.53867364", "0.53857744", "0.538149", "0.5370909", "0.5367429", "0.53639364", "0.5359074", "0.5350433", "0.53490216", "0.534406", "0.5338883" ]
0.71013796
3
move the cursor to the right until right gap end is hit while shifting chars to the left
private void right(int pos) { while (pos > gapLeft) { gapLeft++; gapRight++; buffer[gapLeft-1] = buffer[gapRight]; buffer[gapRight] = '\0'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void moveCursorRight();", "public void moveRight(){\n if(currentText != null) {\n //The saved character index should no longer be restored\n savedCharacterIndex = -1;\n\n //Try to move the cursor\n characterIndex += 1;\n //If the cursor did not wrap onto a new line then update it's position\n if (characterIndex < currentText.getCharacterEdges().length) {\n updateXPosition(true);\n }\n //If the cursor wrapped onto a new line\n else {\n //If this was not the very last line move to the beginning of the next line\n if (lineIndex < texts.size() - 1) {\n lineIndex++;\n currentText = texts.get(lineIndex);\n characterIndex = 0;\n updatePosition();\n }\n //If this is the last line character index should not change and position does not need to be updated\n else {\n characterIndex = currentText.getCharacterEdges().length - 1;\n }\n }\n }\n }", "public void moveSelectionRight(){\n Cursor c = getCursor();\n int line = c.getLeftLine();\n int column = c.getLeftColumn();\n int c_column = getText().getColumnCount(line);\n if(column + 1 <= c_column){\n char ch = mText.charAt(line,column);\n boolean emoji;\n if(emoji = isEmoji(ch)) {\n column ++;\n if(column + 1 > c_column){\n column--;\n }\n }\n if(!emoji && mACPanel.isShowing()) {\n if(!mLanguage.isAutoCompleteChar(ch)) {\n mACPanel.hide();\n }else{\n String prefix = mACPanel.getPrefix() + ch;\n mACPanel.setPrefix(prefix);\n }\n }\n setSelection(line, column + 1);\n }else{\n if(line + 1 == getLineCount()){\n setSelection(line, c_column);\n }else{\n setSelection(line + 1, 0);\n }\n }\n }", "private void cursorMoveRightest() {\n\t\td(\"Warn cursorMoveRightest() NOT implemented\");\r\n\t}", "public void moveRight()\n {\n if (!this.search_zone.isRightBorder(this.x_position))\n {\n this.x_position = (this.x_position + 1);\n }\n }", "public void moveRight() {\r\n\t\tif (x < space.getSize() - 1) x++; \r\n\t}", "public void moveShiftRight();", "public void moveCursorLeft();", "public void moveRight() {\n if (rec.getUpperLeft().getX() + rec.getWidth() + 5 > rightBorder) {\n rec.getUpperLeft().setX(rightBorder - rec.getWidth());\n } else {\n rec.getUpperLeft().setX(rec.getUpperLeft().getX() + 5);\n }\n }", "public void moveRight() {\n\t\tif (x1 < 24 && x2 < 24 && x3 < 24 && x4 < 24) {\n\t\t\tclearPiece();\n\t\t\tx1 += 1;\n\t\t\tx2 += 1;\n\t\t\tx3 += 1;\n\t\t\tx4 += 1;\n\t\t\tsetPiece();\n\t\t\trepaint();\n\t\t}\n\t}", "public void cursorDown() throws IndexOutOfBoundsException {\n if(cursor == size()-1)\n throw new IndexOutOfBoundsException(\"Exception: Current line is size()-1!\");\n //Setting the cursor to be the text line after its current position.\n cursor++;\n }", "public void moveRight() {\n locX = locX + 1;\n }", "public void right(){\n\t\tmoveX=1;\n\t\tmoveY=0;\n\t}", "public void moveRight() {\n this.position.addColumn(1);\n }", "public void moveRight()\n\t{\n\t\tx = x + STEP_SIZE;\n\t}", "void moveRight() {\n\t\ttry {\n\t\t\twhile(x + 60 < getWidth()) {\n\t\t\t\tx += 10;\n\t\t\t\twin.repaint();\n\t\t\t\tThread.sleep(100);\n\t\t\t}\n\t\t} catch(InterruptedException e) {\n\t\t}\n\t}", "public static String moveRight(int n) {\n return CSI + n + \"C\";\n }", "void moveRight() {\n\t\tsetX(x+1);\r\n\t\tdx=1;\r\n\t\tdy=0;\r\n\t}", "public void moveRight() {\n\t\t\n\t}", "public void moveDown(){\n if(currentText != null) {\n //If this is not the very last text\n if (lineIndex < texts.size() - 1) {\n //Move down\n lineIndex++;\n currentText = texts.get(lineIndex);\n\n //Try to use the saved character index as the character index\n if (savedCharacterIndex != -1) {\n characterIndex = savedCharacterIndex;\n }\n\n //Ensure that character index is within the bounds of the text\n if (characterIndex > currentText.getCharacterEdges().length - 1) {\n //Save the character index\n if (characterIndex > savedCharacterIndex) {\n savedCharacterIndex = characterIndex;\n }\n characterIndex = currentText.getCharacterEdges().length - 1;\n }\n\n //Update the position\n updatePosition();\n }\n //If this is the last line then the cursor should be moved to the end of the line\n else {\n //The saved character index should no longer be restored\n savedCharacterIndex = -1;\n\n characterIndex = currentText.getCharacterEdges().length - 1;\n updateXPosition(true);\n }\n }\n }", "protected void right() {\n move(positionX + 1, positionY);\n orientation = 0;\n }", "public void moveLeft(){\n if(currentText != null) {\n //The saved character index should no longer be restored\n savedCharacterIndex = -1;\n\n //Try to move the cursor\n characterIndex -= 1;\n //If the cursor did not wrap onto a new line then update it's position\n if (characterIndex >= 0) {\n updateXPosition(true);\n }\n //If the cursor wrapped onto a new line\n else {\n //If this was not the very first line move to the end of the previous line\n if (lineIndex > 0) {\n lineIndex--;\n currentText = texts.get(lineIndex);\n characterIndex = currentText.getCharacterEdges().length - 1;\n if (characterIndex < 0) {\n characterIndex = 0;\n }\n updatePosition();\n }\n //If this is the first line character index should not change and position does not need to be updated\n else {\n characterIndex = 0;\n }\n }\n }\n }", "public void moveRight() {\n Coordinate rightCoord = new Coordinate(getX() + 1, getY());\n handleMove(rightCoord, InteractionHandler.RIGHT);\n }", "public void moveRight() {\r\n\t\r\n\t\tint rightSteps=10;\r\n\t\t\ttopX+= rightSteps;\r\n\t}", "public void shiftRangeFarRight() {\n Range r = new Range(getMaxRangeEnd() - getRange().getLength() + 1, getMaxRangeEnd());\n setLocation(r);\n }", "public void goRight() {\n\t\tx += dx;\n\t\tbgBack.setDx(false);\n\t\tbgBack.move();\n\t\tif(x > Game.WIDTH - 200) {\n\t\t\tif(!bgBack.getReachEnd()) {\n\t\t\t\tx = Game.WIDTH - 200;\n\t\t\t\tbgFront.setDx(false);\n\t\t\t\tbgFront.move();\n\t\t\t}\n\t\t\telse if(x > Game.WIDTH - 50) {\n\t\t\t\tx = Game.WIDTH - 50;\n\t\t\t}\n\t\t}\n\t}", "public void moveRight()\n\t{\n\t\tcol++;\n\t}", "@Override\n\tpublic void moveRight()\n\t{\n\t\tif (!isAtEnd()) left.push(right.pop());\n\t}", "public void moveSelectionLeft(){\n Cursor c = getCursor();\n int line = c.getLeftLine();\n int column = c.getLeftColumn();\n if(column - 1 >= 0){\n int toLeft = 1;\n if(column - 2 >= 0) {\n char ch = mText.charAt(line,column - 2);\n if(isEmoji(ch)) {\n column--;\n toLeft++;\n }\n }\n setSelection(line, column - 1);\n if(mACPanel.isShowing()) {\n String prefix = mACPanel.getPrefix();\n if(prefix.length() > toLeft) {\n prefix = prefix.substring(0,prefix.length() - toLeft);\n mACPanel.setPrefix(prefix);\n }else{\n mACPanel.hide();\n }\n }\n if(column - 1 <= 0) {\n mACPanel.hide();\n }\n }else{\n if(line == 0){\n setSelection(0, 0);\n }else{\n int c_column = getText().getColumnCount(line - 1);\n setSelection(line - 1, c_column);\n }\n }\n }", "void putLeftWordToRight(int end) {\n\n String word = bufferLeft.pop();\n int index = end - word.length() + 1;\n System.arraycopy(word.toCharArray(), 0, words, index, word.length());\n words[index-1] = ' ';\n\n }", "public void moveRight() {\n\t\tsetPosX(getPosX() + steps);\n\t}", "public boolean moveRight() {\r\n\t\tif (this.x >= 1050 == true) {\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\tthis.x += 5;\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public void moveRight()\n\t{\n\t\tmoveRight = true;\n\t}", "public void moveSelectionEnd(){\n int line = mCursor.getLeftLine();\n setSelection(line, getText().getColumnCount(line));\n }", "public void makeRightVisible() {\n makeCharVisible(getCursor().getRightLine(),getCursor().getRightColumn());\n }", "public void moveRight()\n {\n if (xPos == xBound)\n {\n movementY = 0;\n movementX = 0;\n }\n\n // Set the movement factor - positive X because we are moving RIGHT! \n movementX = 0.5;\n movementY = 0;\n }", "@Override\n\tpublic void backspace()\n\t{\n\t\tif (!isAtStart()) left.pop();\n\t}", "@Override\n public void onDirectRightKeyPress() {\n \n }", "@Override\n public void onDirectRightKeyPress() {\n \n }", "private void right() {\n lastMovementOp = Op.RIGHT;\n rotate(TURNING_ANGLE);\n }", "void moveRight();", "private void left(int pos) {\n while (pos < gapLeft) {\n gapLeft--;\n gapRight--;\n buffer[gapRight+1] = buffer[gapLeft];\n buffer[gapLeft] = '\\0';\n }\n }", "void moveBack()\n\t{\n\t\tif (length != 0) \n\t\t{\n\t\t\tcursor = back; \n\t\t\tindex = length - 1; //cursor will be at the back\n\t\t\t\n\t\t}\n\t}", "public void moveRight(){\n myRectangle.setX(myRectangle.getX() + PADDLE_SPEED);\n }", "public void turnRight() {\r\n setDirection( modulo( myDirection+1, 4 ) );\r\n }", "public void cursorUp() throws IndexOutOfBoundsException {\n if(cursor <= 0)\n throw new IndexOutOfBoundsException(\"Exception: Cursor is currently at line \"+cursor);\n //Setting the cursor to be the text line before its current position.\n cursor--;\n }", "public void moveAsteroidLeftToRight() {\t\r\n\t\tsetY(this.getY()+1);\r\n\t}", "public String shiftRight(String text, int x) {\n\t\t\n\t\tString toShift = text.substring(0, x);\n\t\tString newCipher = text += toShift;\n\t\tString result = newCipher.substring(toShift.length(), newCipher.length());\n\t\t\n\t\treturn result;\n\t\t\n\t}", "private void moveRightLeft(int Width) {\n if (goingRight) {\n if (getX() + wolfWidth >= Width) turnAround();\n else setX(getX() + Width / 40);\n } else {\n if (getX() <= 0) turnAround();\n else setX(getX() - Width / 40);\n }\n }", "public void moveShiftLeft();", "public void moveRight() {\n this.accelerateXR();\n this.moveX(this.getxSpeed());\n this.setPicX(0);\n this.setPicY(74);\n this.setLoopCells(true);\n }", "public void moveSelectionDown(){\n if(mACPanel.isShowing()) {\n mACPanel.moveDown();\n return;\n }\n Cursor c = getCursor();\n int line = c.getLeftLine();\n int column = c.getLeftColumn();\n int c_line = getText().getLineCount();\n if(line + 1 >= c_line){\n setSelection(line, getText().getColumnCount(line));\n }else{\n int c_column = getText().getColumnCount(line + 1);\n if(column > c_column){\n column = c_column;\n }\n setSelection(line + 1, column);\n }\n }", "public void moveRight() {\n if (xcoor <= Game.widthOfGameBoard - movingSpeed) {\n xcoor = xcoor + movingSpeed * 2;\n }\n }", "public void moveRight(){\n\t\tif(GameSystem.TWO_PLAYER_MODE){\n\t\t\tif(Game.getPlayer2().dying){\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif(animation==ANIMATION.DAMAGED||Game.getPlayer().dying||channelling||charging) return;\n\t\tmoving=true;\n\t\tbuttonReleased=false;\n\t\torientation=ORIENTATION.RIGHT;\n\t\tif(animation!=ANIMATION.MOVERIGHT) {\n\t\t\tanimation=ANIMATION.MOVERIGHT;\n\t\t\tif(run!=null) sequence.startSequence(run);\n\t\t}\n\t\tfacing=FACING.RIGHT;\n\t\tdirection=\"right\";\n\t\tsetNextXY();\n\t\tsetDestination(nextX,nextY);\n\t\tvelX=spd/2;\n\t\tvelY=0;\n\t}", "public void shiftRangeRight() {\n shiftRange(true, 0.5);\n }", "public void justifyRight() {\n\t\tleft.right();\n\t}", "private int huntRight(String in, int offset) {\n char temp = 0;\n for(int i = offset + 1; i < in.length(); i++) {\n temp = in.charAt(i);\n if(temp == '\\n' || temp == '\\r')\n return i;\n }\n return in.length(); //eof counts. Note this is the length because we increased it by one!\n }", "public void backSpace(){\n if(currentText != null) {\n //The saved character index should no longer be restored\n savedCharacterIndex = -1;\n\n //If a character is being removed from a single line\n if (characterIndex > 0) {\n currentText = codeWindow.getTextLineController().backspace(currentText, characterIndex, true);\n characterIndex--;\n }\n //If a newline character is being removed two lines need to be merged\n else if (lineIndex > 0) {\n characterIndex = codeWindow.getTextLineController().getCodeWindowTextLines().get(lineIndex - 1).getCharacterEdges().length - 1;\n currentText = codeWindow.getTextLineController().merge(codeWindow.getTextLineController().getCodeWindowTextLines().get(lineIndex - 1), currentText, codeWindow);\n lineIndex--;\n }\n //The cursors character or line index changed, update accordingly\n updatePosition();\n }\n }", "public Vertex moveRight() {\n for (Edge e : current.outEdges) {\n move(e.to.x == current.x + 1, e);\n }\n return current;\n }", "public void rightPressed() {\n System.out.println(\"rightPressed()\");\n current.translate(0, 1);\n display.showBlocks();\n }", "private Position nextPositionLeftToRight(Position pos) {\n return (pos.getColNum() == nCols - 1\n ? new Position(pos.getRowNum(), 0)\n : new Position(pos.getRowNum(), pos.getColNum() + 1));\n }", "@Override\r\n\tpublic String moveRight() {\n\t\tif((0<=x && x<50) && (0<=y && y<=10) && (0<=z && z<=50))\r\n\t\t{\r\n\t\t\tx++;\r\n\t\t}\r\n\t\telse if((0<=x && x<50) && (40<=y && y<=50) && (0<=z && z<=50))\r\n\t\t{\r\n\t\t\tx++;\r\n\t\t}\r\n\t\telse if((0<=x && x<50) && (0<=y && y<=50) && (0<=z && z<=10))\r\n\t\t{\r\n\t\t\tx++;\r\n\t\t}\r\n\t\telse if((0<=x && x<10) && (0<=y && y<=50) && (0<=z && z<=50))\r\n\t\t{\r\n\t\t\tx++;\r\n\t\t}\r\n\t\telse if((0<=x && x<50) && (0<=y && y<=50) && (40<=z && z<=50))\r\n\t\t{\r\n\t\t\tx++;\r\n\t\t}\r\n\t\telse if((40<=x && x<50) && (0<=y && y<=50) && (0<=z && z<=50))\r\n\t\t{\r\n\t\t\tx++;\r\n\t\t}\r\n\t\treturn getFormatedCoordinates();\r\n\t}", "@Override\n\tpublic boolean moveRight() {\n\t\tboolean rs = super.moveRight();\n\t\tif(rs == true){\n\t\t}\n\t\treturn rs;\n\t}", "private Position nextPositionRightToLeft(Position pos) {\n return (pos.getColNum() == 0\n ? new Position(pos.getRowNum(), nCols - 1)\n : new Position(pos.getRowNum(), pos.getColNum() - 1));\n }", "public void removeByRightShift(int pos) {\r\n if (pos > 0 || pos < size - 1) {\r\n int nshift = pos;\r\n int from = ((start + pos) - 1) % cir.length;\r\n int to = (from + 1) % cir.length;\r\n // int to=from--;\r\n for (int i = 0; i < nshift; i++) {\r\n cir[to % cir.length] = cir[from % cir.length];\r\n to = from;\r\n from--;\r\n if (from < 0) {\r\n from = cir.length - 1;\r\n }\r\n }\r\n cir[start] = \"null\";\r\n start++;\r\n size--;\r\n }\r\n }", "public void moveRight() {\n for(int i=0;i<this.body.size();i++){\n// TranslateTransition translate = new TranslateTransition();\n// translate.setNode(this.body.get(i));\n// smoothSnake obj=new smoothSnake();\n// obj.swiftSnake(translate,i,this,1);\n this.body.get(i).setCenterX(this.body.get(i).getCenterX()+10);\n }\n\n \tsetScoreText();\n }", "public void turnRight(int ticks){\n\t\tposition = (position - ticks)%40;\n\t\tif (position < 0)\n\t\t\tposition+=40;\n\t\tcount++;\n\t\tcheckTurn(ticks);\n\t}", "void moveToEnd();", "public void moveRight() {\n \t\n \tif(!move.moveRight()) {\n \t\tif(physinteractor(getX()+1,getY())) {\n \t\t\tmove.moveRight();\n \t\t\tnonphysinteractor(getX(),getY());\n \t\t\tupdatemove();\n \t\t}\n }else {\n \t//System.out.print(\"I moved right\" + getX() + getY());\n \tupdatemove();\n \tnonphysinteractor(getX(),getY());\n }\n }", "protected void refillRight(){\n\t\tif(!shouldRepeat && isSrollingDisabled) return; //prevent next layout calls to override override first init to scrolling disabled by falling to this branch\n\t\tif(getChildCount() == 0) return;\n\t\t\n\t\tfinal int leftScreenEdge = getScrollX();\n\t\tfinal int rightScreenEdge = leftScreenEdge + getWidth();\n\t\t\n\t\tView child = getChildAt(getChildCount() - 1);\n\t\tint right = child.getRight();\n\t\tint currLayoutLeft = right + ((LoopLayoutParams)child.getLayoutParams()).rightMargin;\n\t\twhile(right < rightScreenEdge){\n\t\t\tmLastItemPosition++;\n\t\t\tif(mLastItemPosition >= mAdapter.getCount()) mLastItemPosition = 0;\n\t\t\t\n\t\t\tchild = mAdapter.getView(mLastItemPosition, getCachedView(), this);\n Validate.notNull(child,\"Your adapter has returned null from getView.\");\n\t\t\tchild = addAndMeasureChildHorizontal(child, LAYOUT_MODE_AFTER);\n\t\t\tcurrLayoutLeft = layoutChildHorizontal(child, currLayoutLeft, (LoopLayoutParams) child.getLayoutParams());\n\t\t\tright = child.getRight();\n\t\t\t\n\t\t\t//if selected view is going to screen, set selected state on him\n\t\t\tif(mLastItemPosition == mSelectedPosition){\n\t\t\t\tchild.setSelected(true);\n\t\t\t}\n\t\t}\n\t}", "public void right() {\n if (x + movementSpeed < 450) {\r\n x = x + movementSpeed;\r\n }\r\n }", "public void changeContentBetween(char left, char right) {\n String line = getLine(cursor.getY());\n char c = line.charAt(cursor.getX());\n // If we're already on a bounding character then don't go past it.\n int findPreviousInitialDepth = c == right ? 0 : 1;\n int findNextInitialDepth = c == left ? 0 : 1;\n \n Point leftBound = file.findPrevious(cursor.getY(), cursor.getX(), right, left,\n findPreviousInitialDepth);\n Point rightBound = file.findNext(cursor.getY(), cursor.getX(), left, right,\n findNextInitialDepth);\n if (leftBound == null || rightBound == null) {\n return;\n }\n startPatch();\n file.removeTextExclusive(leftBound, rightBound);\n cursor.moveTo(leftBound);\n append();\n }", "private static void OnFlowDirectionCommand(TextEditor This, Key key) \r\n { \r\n //\r\n\r\n using (This.Selection.DeclareChangeBlock())\r\n {\r\n if (key == Key.LeftShift)\r\n { \r\n if (This.AcceptsRichContent && (This.Selection is TextSelection))\r\n { \r\n // NOTE: We do not call OnApplyProperty to avoid recursion for FlushPendingInput \r\n ((TextSelection)This.Selection).ApplyPropertyValue(FlowDocument.FlowDirectionProperty, FlowDirection.LeftToRight, /*applyToParagraphs*/true);\r\n } \r\n else\r\n {\r\n Invariant.Assert(This.UiScope != null);\r\n UIElementPropertyUndoUnit.Add(This.TextContainer, This.UiScope, FrameworkElement.FlowDirectionProperty, FlowDirection.LeftToRight); \r\n This.UiScope.SetValue(FrameworkElement.FlowDirectionProperty, FlowDirection.LeftToRight);\r\n } \r\n } \r\n else\r\n { \r\n Invariant.Assert(key == Key.RightShift);\r\n\r\n if (This.AcceptsRichContent && (This.Selection is TextSelection))\r\n { \r\n // NOTE: We do not call OnApplyProperty to avoid recursion for FlushPendingInput\r\n ((TextSelection)This.Selection).ApplyPropertyValue(FlowDocument.FlowDirectionProperty, FlowDirection.RightToLeft, /*applyToParagraphs*/true); \r\n } \r\n else\r\n { \r\n Invariant.Assert(This.UiScope != null);\r\n UIElementPropertyUndoUnit.Add(This.TextContainer, This.UiScope, FrameworkElement.FlowDirectionProperty, FlowDirection.RightToLeft);\r\n This.UiScope.SetValue(FrameworkElement.FlowDirectionProperty, FlowDirection.RightToLeft);\r\n } \r\n }\r\n ((TextSelection)This.Selection).UpdateCaretState(CaretScrollMethod.Simple); \r\n } \r\n }", "public void selectionRight() {\n\t\tselectedSlotPosX = (selectedSlotPosX == (C.MENU_INVENTORY_ITEM_SLOT_WIDTH - 1)) ? 0 : selectedSlotPosX+1;\n\t}", "private void LeftRightRight() {\n \tRobot.cubebase.stopall();\n \twhile (true) \n \t{\n \t\t//first.take cube down and lift to high\n \t\tif (Robot.autotime.get()<1) {\n\t\t\t\tRobot.drivebase.run(.53, -.53);\n\t\t\t}\n \t\tif (Robot.autotime.get()>=1) {\n\t\t\t\tRobot.drivebase.Stop();\n\t\t\t\tbreak;\n\t\t\t}\n \t\t\n \t\n \t}\n\t\t\n\t}", "void keyRight();", "public void goRight()\r\n\t{\r\n\t\tthis.X++;\r\n\t}", "public void goRight() {\n if(page.right == null)\n {\n if(editText.getText().toString().equals(\"\")) {\n return;\n }\n page.addRelation(\"right\",editText.getText().toString());\n editText.setText(\"\");\n }\n\n page = page.right;\n addQueue();\n }", "public void moveLeft()\n\t{\n\t\tcol--;\n\t}", "public static char getsRight() {\n\t\t\treturn sRight;\n\t\t}", "void pushRightWord(int end) {\n\n int index = end;\n while (true) {\n if (words[--index] == ' ') break;\n }\n\n bufferRight.push(new String(Arrays.copyOfRange(\n words, index+1, end+1)));\n\n }", "public void slideRight() {\n turnRight();\n move();\n turnLeft();\n }", "public void left(){\n\t\tmoveX=-1;\n\t\tmoveY=0;\n\t}", "@Override\r\n\tpublic void rotateRight() {\n\t\tfinal int THETA = 10;\r\n\t\tint dir = this.getDirection();\r\n\t\tthis.setDirection(dir + THETA);\r\n\t\t\r\n\t}", "public boolean slideRight() {\n\t\tif (currentCol < COLS - 1) {\n\t\t\tboard[currentRow][currentCol] = board[currentRow][currentCol + 1];\n\t\t\tcurrentCol++;\n\t\t\tboard[currentRow][currentCol] = '0';\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "@Override\n \tpublic void move(int keycode) {\n \t\t\n \t\tif (keycode == Keyboard.KEY_D) {\n \t\t\tsetRight(true);\n \t\t} else if (keycode == Keyboard.KEY_A) {\n \t\t\tsetRight(false);\n \t\t}\n \t\t\n \t\tcheckBorders(keycode);\n \t\t\n \t\tif (checkCollisions(keycode))\n \t\t\tsuper.move(keycode);\n \t\t\n \t}", "public void\nshiftToOrigin()\n{\n\tthis.setLine(0.0, 0.0,\n\t\tthis.getP2().getX() - this.getP1().getX(),\n\t\tthis.getP2().getY() - this.getP1().getY());\n}", "@Override\r\n\tpublic void rotateRight() {\n\t\tsetDirection((this.getDirection() + 1) % 4);\r\n\t}", "public void moveCursor(int x, int y) {\n int pos = x + (y * COLS);\n this.x = x;\n this.y = y;\n writeCursor(0x0F, pos);\n writeCursor(0x0E, pos >>> 8);\n }", "public void rightPressed() {\n\t\tif (edit) {\n\t\t\tcurrentDeck.right();\n\t\t}\n\t}", "private int jumpCursor() {\n if (cc == columns) {\n if (cl + 1 == lines)\n cl = 0;\n else\n ++cl;\n\n cc = 0;\n }\n\n return cc++;\n }", "public void moveLeft()\n {\n if (!this.search_zone.isLeftBorder(this.x_position))\n {\n this.x_position = (this.x_position - 1);\n }\n }", "public void moveRight() {\n\t\tposX += speed;\n\t}", "public void insertByRightShift(Object elem, int pos){\n if(size==cir.length){\n resizeStartUnchanged(cir.length+3);\n }\n int nshift=size-pos;\n int from=(start+size-1)%cir.length;\n int to=(from+1)%cir.length;\n for(int i=0;i<nshift;i++){\n cir[to]=cir[from];\n to=from;\n from--;\n if(from==-1){\n from=cir.length-1;\n }\n }\n int index=(start+pos)%cir.length;\n cir[index]=elem;\n size++;\n }", "public void moveFromHandToEndOfWord() {\n\t\t//check letters in hand \n\t\tif(hand.size() == 0) {\n\t\t\treturn;\n\t\t}\n\t\t// remove letter from hand\n\t\tLetter temp = hand.leftmost;\n\t\thand.remove();\n\t\ttemp.next = null;\n\n\t\t// add letter to end of word\n\t\tword.addToEnd(temp);\n\t}", "public void moveRight() {\n speedX += (speedX < 0) ? acceleration * 2 : acceleration;\n if (speedX > maxSpeed) {\n speedX = maxSpeed;\n }\n direction = Direction.RIGHT;\n }", "private void turnRight() {\n\n if(currentPosition.getX() == -1 && currentPosition.getY() == -1) {\n System.out.println(\"Robot is not placed, yet.\");\n return;\n }\n\n Position.Direction direction = currentPosition.getDirection();\n switch (direction) {\n case EAST:\n direction = Position.Direction.SOUTH;\n break;\n case WEST:\n direction = Position.Direction.NORTH;\n break;\n case NORTH:\n direction = Position.Direction.EAST;\n break;\n case SOUTH:\n direction = Position.Direction.WEST;\n break;\n }\n\n currentPosition.setDirection(direction);\n }", "private void RightLeftRight() {\n \tRobot.cubebase.stopall();\n \twhile (true) \n \t{\n \t\t//first.take cube down and lift to high\n \t\tif (Robot.autotime.get()<.5) {\n\t\t\t\tRobot.cubebase.clickdown();//pay attention: maybe this is clickup()!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\t\t\t}\n \t\tif (Robot.autotime.get()>=.5&&Robot.autotime.get()<2.5) {\n \t\t\tRobot.cubebase.clickstop();\n\t\t\t\tRobot.cubebase.liftdown();//pay attention: maybe this is liftdown()!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\t\t\t}\n \t\t //about 300cm note: 0.08*2->90*2=180cm 0.08*3->90*3=270cm 270+45=315cm->0.08*3+0.08/2=0.28s\n \t\tif (Robot.autotime.get()>=2.5&&Robot.autotime.get()<3.9) {\n\t\t\t\tRobot.cubebase.stoplift();\n\t\t\t\tRobot.drivebase.run(.53, -.53 );\n\t\t\t}\n \t\tif (Robot.autotime.get()>=3.9&&Robot.autotime.get()<5.9) {\n\t\t\t\tRobot.cubebase.stopall();\n\t\t\t\tRobot.drivebase.Stop();\n\t\t\t}\n \t\tif (Robot.autotime.get()>5.9&&Robot.autotime.get()<6.2) {\n\t\t\t\tRobot.pneumatics_drive.close1();\n\t\t\t}\n \t\tif (Robot.autotime.get()>6.2) {\n \t\t\tRobot.cubebase.stopall();\n\t\t\t\tRobot.drivebase.Stop();\n\t\t\t\tbreak;\n \t\t}}\n \t\t\n\t\t\n\t}", "public void shiftCompressedWordsRight(final int startWord, final int shift) {\n\t\t// need to enlarge buffer?\n\t\twhile (buffer.length < actualsizeinwords + shift) {\n\t\t\tfinal long oldbuffer[] = this.buffer;\n\t\t\tthis.buffer = new long[oldbuffer.length * 2];\n\t\t\tSystem.arraycopy(oldbuffer, 0, this.buffer, 0, actualsizeinwords);\n\t\t\tthis.rlw.array = this.buffer;\n\t\t}\n\t\tSystem.arraycopy(this.buffer, startWord, this.buffer,\n\t\t\t\tstartWord + shift, actualsizeinwords - startWord);\n\t\tfor (int i = 0; i < shift; i++)\n\t\t\tthis.buffer[startWord + i] = 0;\n\n\t\tactualsizeinwords += shift;\n\t\tif (log.isDebugEnabled())\n\t\t\tif (log.isDebugEnabled()) {log.debug(this.rlw.getNumberOfLiteralWords());};\n\n\t\t// adapt position of last RLW unless we shifted literal words from the\n\t\t// last RLW\n\t\tif (this.rlw.position >= startWord)\n\t\t\tthis.rlw.position += shift;\n\t}", "public void moveRight(int x){\r\n \tbox.translate(x,0);\r\n \tif (selfmove){ //if the frog is moving itself\r\n \t\timg = imgs[1]; //draw a moving animation\r\n \t\tdelay = 10; //for 10 frames\r\n \t}\r\n \t\r\n }" ]
[ "0.779449", "0.77263516", "0.73956174", "0.7170683", "0.7025348", "0.68479335", "0.66964746", "0.6630854", "0.6505961", "0.65009975", "0.6465821", "0.6463899", "0.6442945", "0.6399096", "0.63357276", "0.6306075", "0.63010955", "0.62856686", "0.6235879", "0.62115026", "0.620703", "0.61878145", "0.6177186", "0.6165272", "0.61642927", "0.61495805", "0.614066", "0.61311686", "0.6127874", "0.61278135", "0.6105583", "0.6097526", "0.6078765", "0.6060122", "0.6033547", "0.6032519", "0.60113716", "0.59894884", "0.59894884", "0.59860754", "0.5973008", "0.596642", "0.59276974", "0.5923782", "0.5900666", "0.5892448", "0.5879762", "0.58647275", "0.5845428", "0.5821598", "0.5817958", "0.5809125", "0.58076274", "0.5800251", "0.57971704", "0.57878834", "0.5777442", "0.5769129", "0.5760452", "0.5746601", "0.5717232", "0.570783", "0.5705382", "0.5690382", "0.56761765", "0.56738853", "0.56702507", "0.5661212", "0.5658165", "0.5647808", "0.56474876", "0.5639514", "0.5635066", "0.56308085", "0.5626208", "0.56159204", "0.5611928", "0.561002", "0.56030184", "0.5598748", "0.55792874", "0.55580676", "0.55379325", "0.55255663", "0.55075574", "0.55052274", "0.5497149", "0.5492105", "0.5488069", "0.5487152", "0.54867256", "0.5478042", "0.5460351", "0.54588336", "0.5453886", "0.54503566", "0.54372007", "0.54343474", "0.54255587", "0.5420073" ]
0.7178073
3
move the gap location to the start of the provided position
private void moveTo(int position) { if (position < gapLeft) { left(position); } else { right(position); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void positionToStart () {\n currentRow = 0 - currentPiece.getOffset();\n currentColumn = board.columns / 2 - currentPiece.width / 2;\n }", "public void goToStart() {\n\t\tsetPosition(0);\n\t}", "public void\nshiftToOrigin()\n{\n\tthis.setLine(0.0, 0.0,\n\t\tthis.getP2().getX() - this.getP1().getX(),\n\t\tthis.getP2().getY() - this.getP1().getY());\n}", "Position<T> before(Position<T> p) throws IllegalStateException;", "private void left(int pos) {\n while (pos < gapLeft) {\n gapLeft--;\n gapRight--;\n buffer[gapRight+1] = buffer[gapLeft];\n buffer[gapLeft] = '\\0';\n }\n }", "void moveToStart();", "void moveTo(int dx, int dy);", "public void move() {\n\t\tGrid<Actor> gr = getGrid();\n\t\tif (gr == null) {\n\t\t\treturn;\n\t\t}\n\t\tLocation loc = getLocation();\n\t\tLocation next = loc.getAdjacentLocation(getDirection());\n\t\t\n\t\tLocation next2 = next.getAdjacentLocation(getDirection());\n\t\tif (gr.isValid(next2)) {\n\t\t\tmoveTo(next2);\n\t\t} else {\n\t\t\tremoveSelfFromGrid();\n\t\t}\n\t}", "public void addGap() {\n this.openGaps++;\n }", "public void moveToLastAcceptableLocation(){\n\t\tthis.x=this.xTemp;\n\t\tthis.y=this.yTemp;\n\t}", "public void startPosition();", "public void moveLeft() {\n locX = locX - 1;\n }", "@Override\n public void move() {\n _location.x++;\n }", "abstract public void reorganizePositions(Vector2 start, Vector2 newPos);", "protected void move() {\n\t\tx += dx;\n\t\ty += dy;\n\t\tif (distance() > range) remove();\n\t}", "public void testMovToPos() {\n for (int i = 0; i < 10; i++) {\n test1.append(new Buffer(i, rec));\n }\n assertTrue(test1.moveToPos(5));\n assertTrue(test1.getValue().inRange(5));\n assertFalse(test1.moveToPos(-5));\n assertFalse(test1.getValue().inRange(-5));\n assertFalse(test1.moveToPos(50));\n assertFalse(test1.getValue().inRange(50));\n }", "private void move() {\n\n if(currentPosition.getX() == -1 && currentPosition.getY() == -1) {\n System.out.println(\"Robot is not placed, yet.\");\n return;\n }\n\n Position.Direction direction = currentPosition.getDirection();\n int newX = -1;\n int newY = -1;\n switch (direction) {\n case EAST:\n newX = currentPosition.getX() + 1;\n newY = currentPosition.getY();\n break;\n case WEST:\n newX = currentPosition.getX() - 1;\n newY = currentPosition.getY();\n break;\n case NORTH:\n newX = currentPosition.getX();\n newY = currentPosition.getY() + 1;\n break;\n case SOUTH:\n newX = currentPosition.getX();\n newY = currentPosition.getY() - 1;\n break;\n }\n\n if(newX < lowerBound.getX() || newY < lowerBound.getY()\n || newX > upperBound.getX() || newY > upperBound.getY()) {\n System.out.println(\"Cannot move to \" + direction);\n return;\n }\n\n currentPosition.setX(newX);\n currentPosition.setY(newY);\n }", "public void move() {\n this.pposX = this.posX;\n this.pposY = this.posY;\n this.posX = newPosX;\n this.posY = newPosY;\n }", "int getNextGap(int gap)\n {\n gap = (gap*10)/13;\n if (gap < 1)\n return 1;\n return gap;\n }", "public abstract void moveTo(double x, double y);", "public void testMoveToStart() {\n for (int i = 0; i < 10; i++) {\n test1.append(new Buffer(i, rec));\n }\n test1.moveToStart();\n assertTrue(test1.getValue().inRange(0));\n }", "public void moveLeft()\n {\n if (!this.search_zone.isLeftBorder(this.x_position))\n {\n this.x_position = (this.x_position - 1);\n }\n }", "public void alignLocation();", "public void move(int distance);", "void moveToEnd();", "public void move() {\n\t\tx+= -1;\n\t\tif (x < 0) {\n\t\t\tx = (processing.width - 1);\n\t\t}\n\t\ty+= 1;\n\t\tif (y > processing.height-1)\n\t\t\ty=0;\n\t}", "public void moveUp()\n {\n if (!this.search_zone.isTopBorder(this.y_position))\n {\n this.y_position = (this.y_position - 1);\n }\n }", "public void resetPaddleToStartingPosition(){\n myRectangle.setX(initialXLocation);\n }", "Position<T> addBefore(Position<T> p, T data) throws IllegalStateException;", "public void originalSpace() {\n\t\tpos.x = 65;\n\t\tpos.y = p.height/2 + 100;\n\t\t\n\t}", "public static void move() {\r\n\t\t\r\n\t\tif (ths.page == 1) {\r\n\t\t\tths.page++;\r\n\t\t}\r\n\t}", "@Override\n\tpublic void moveToStart()\n\t{\n\t\twhile (!left.isEmpty())\n\t\t{\n\t\t\tright.push(left.pop());\n\t\t}\n\t}", "public void stepForward() {\n\t\tposition = forwardPosition();\n\t}", "public void move() {\n\t\tthis.position.stepForwad();\n\t\tthis.position.spin();\n\t}", "private int moveForward(int i, int s) {\n if (i + s >= items.length) {\n return ((i + s) - items.length);\n }\n return i + s;\n }", "private int[] moveVerticalPositionTo(int moveTo, int[] position) {\n moveTo++;\n\n //Get the position of the crane end using the height of the tower and subtracting the drop\n int verticalPosition = position[0] - position[2];\n\n while (verticalPosition != moveTo) {\n verticalPosition = position[0] - position[2];\n //If we are trying to move higher than the horizontal bar's height(ending up with a negative value for the drop), increment the height.\n if (moveTo > position[0]) {\n r.up();\n position[0]++;\n }\n //Don't try to move outside bounds of application.\n else if (moveTo <= 14 && moveTo >= 0) {\n //If we are lower than the move to height, raise the drop arm.\n if (verticalPosition < moveTo) {\n r.raise();\n position[2]--;\n }\n //Otherwise if the position we want to move to is lower than the current height, lower the drop arm.\n else if (verticalPosition > moveTo) {\n r.lower();\n position[2]++;\n }\n //If neither of those statements caught anything, we must already be at our destination. Do nothing.\n\n }\n //If trying to move too high set to acceptable height\n else if (moveTo > 14) {\n moveTo = 14;\n }\n //If the previous if failed, we must be trying to move too low. Move to 0.\n else {\n moveTo = 0;\n }\n }\n return (position);\n }", "public void increaseStartPos(int num) {\r\n this.startPos += num;\r\n }", "@Override\n public long getPosition() {\n return startPosition + super.getPosition();\n }", "public abstract void move(Position position);", "@Override\r\n\tpublic void moveTo(float x, float y) {\n\t\t\r\n\t}", "public void startSnake()\n {\n int thisA = (150+1260)/2; //705\n int thisB = (150+630)/2 -195; //195\n \n for(int i=0 ; i<3; i++)\n {\n list.add(new Location(thisA,thisB));\n //drawSegment(g,thisA,thisB);\n thisB += 15;\n \n }\n head.setA(thisA);\n head.setB(thisB-15); //to adjust for the extra +15 at the end of the last for loop run through \n }", "public void move() {\n\n\tGrid<Actor> gr = getGrid();\n\tif (gr == null) {\n\n\t return;\n\t}\n\n\tLocation loc = getLocation();\n\tif (gr.isValid(next)) {\n\n\t setDirection(loc.getDirectionToward(next));\n\t moveTo(next);\n\n\t int counter = dirCounter.get(getDirection());\n\t dirCounter.put(getDirection(), ++counter);\n\n\t if (!crossLocation.isEmpty()) {\n\t\t\n\t\t//reset the node of previously occupied location\n\t\tArrayList<Location> lastNode = crossLocation.pop();\n\t\tlastNode.add(next);\n\t\tcrossLocation.push(lastNode);\t\n\t\t\n\t\t//push the node of current location\n\t\tArrayList<Location> currentNode = new ArrayList<Location>();\n\t\tcurrentNode.add(getLocation());\n\t\tcurrentNode.add(loc);\n\n\t\tcrossLocation.push(currentNode);\t\n\t }\n\n\t} else {\n\t removeSelfFromGrid();\n\t}\n\n\tFlower flower = new Flower(getColor());\n\tflower.putSelfInGrid(gr, loc);\n\t\n\tlast = loc;\n\t\t\n }", "public void moveUp() {\n locY = locY + 1;\n }", "public void move_to_gantry() {\n\t\tstop_moving();\n\t\ttry {\n\t\t\tThread.sleep(1000);\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tmove(gpX, gpY, gpZ);\n\t}", "public abstract Point move(Point position);", "public void nextMove(Field field) {\n for (int i = 1; i <= 9; i++) {\n if (field.setMarker(i, marker)) {\n break;\n }\n }\n }", "private void MoveArrow(int NewPosition)\n {\n Log.i(\"anim\", arrowViewPosition + \"-->\" + NewPosition);\n TranslateAnimation anim = new TranslateAnimation(10, 0, arrowViewPosition, arrowViewPosition-100);\n arrowViewPosition=NewPosition;\n anim.setDuration(10);\n anim.setFillAfter(true);\n arrowView.startAnimation(anim);\n if(NewPosition < -900)\n {\n popBalloon();\n }\n }", "private int move(int position) {\n\t\tremoveQueue(queues[position]);\n\t\tint angriness = queues[position].queue.poll();\n\t\tallQueues.add(queues[position]);\n\t\tif (queues[position].queue.size() > 0) {\n\t\t\tallHeads.add(queues[position]);\n\t\t}\n\t\treturn insert(angriness);\n\t}", "public int move(int from, int to) {\n // Gracefully handle items beyond end\n final int size = mItems.size();\n from = constrain(from, 0, size - 1);\n to = constrain(to, 0, size - 1);\n\n final Path item = mItems.remove(from);\n mItems.add(to, item);\n return to;\n }", "public void beforeFirst() {\n\t\tmoveTo(0);\n\t}", "public void movePiece(Coordinate from, Coordinate to);", "private void move(double newXPos){\n this.setX(newXPos);\n }", "private static Point moveTo(Point p, int d) {\n switch (d) {\n case 0:\n return new Point(p.x, p.y - 1);\n case 1:\n return new Point(p.x + 1, p.y - 1);\n case 2:\n return new Point(p.x + 1, p.y);\n case 3:\n return new Point(p.x + 1, p.y + 1);\n case 4:\n return new Point(p.x, p.y + 1);\n case 5:\n return new Point(p.x - 1, p.y + 1);\n case 6:\n return new Point(p.x - 1, p.y);\n default:\n return new Point(p.x - 1, p.y - 1);\n }\n }", "Position getNewPosition();", "public static void setDefaultGap(int x) {\n gap = x;\n }", "public void shiftRangeFarLeft() {\n Range r = new Range(1, getRange().getLength());\n setLocation(r);\n }", "public void moveTo(Vector position) {\n }", "public void move() {\r\n\t\tmoveCount++;\r\n\t}", "public void move() {\n\t\t// tolerance of angle at which the Base starts moving\n\t\tint tolerance = 10;\n\t\tif(Math.abs(angle) < Math.abs(angleDesired)+tolerance && Math.abs(angleDesired)-tolerance < Math.abs(angle)) {\n\t\t\tdouble vX = Math.cos(Math.toRadians(this.angle + 90)) * v;\n\t\t\tdouble vY = Math.sin(Math.toRadians(this.angle + 90)) * v;\n\t\t\t\n\t\t\tthis.x += vX;\n\t\t\tthis.y += vY;\t\n\t\t\tthis.rectHitbox = new Rectangle((int)(x-rectHitbox.width/2),(int)(y-rectHitbox.height/2),rectHitbox.width,rectHitbox.height);\n\t\t}\n\t\t// curTargetPathBoardRectangle\n\t\tRectangle curTPBR = pathBoardRectangles.get(curTargetPathCellIndex).rect;\n\t\tRectangle rectSmallerBR = new Rectangle((int)curTPBR.getCenterX()-5,(int)curTPBR.getCenterY()-5,10,10);\n\t\t// updates the index when it crosses a pathCell so it counts down from pathCell to pathCell,\n\t\t// always having the next pathCell in the array as the target until the end is reached then it stops\n\t\tif(rectSmallerBR.contains(new Point((int)x,(int)y))) {\n\t\t\tif(curTargetPathCellIndex < pathBoardRectangles.size()-1) {\n\t\t\t\tcurTargetPathCellIndex++;\n\t\t\t\tparentGP.boardRect = pathBoardRectangles.get(curTargetPathCellIndex-1);\n\t\t\t\ttAutoDirectionCorrection.restart();\n\t\t\t}else {\n\t\t\t\tparentGP.isMoving = false;\n\t\t\t\tparentGP.boardRect = pathBoardRectangles.get(curTargetPathCellIndex);\n\t\t\t\tpathBoardRectangles.clear();\n\t\t\t\ttAutoDirectionCorrection.stop();\n\t\t\t\tStagePanel.tryCaptureGoldMine(parentGP);\n\t\t\t}\n\t\t}\n\t}", "public void move() {\n\t\t// Override move so we don't move, then get location set by owner.\n\t}", "private void shiftAndCopyIfNeeded(int newSize, int pos) {\n\t\tif (array.length < newSize) {\n\t\t\t// create new array of desired size, at least newSize big\n\t\t\tObject[] newArray = new Object[newSize + EXTRA_SPACE];\n\t\t\t// copy all elements from array into newArray\n\t\t\tSystem.arraycopy(array, 0, newArray, 0, size);\n\t\t\t// use the newArray instead of the old \n\t\t\tarray = newArray;\n\t\t}\n\t\t// if there are elements above pos\n\t\tif (pos < size) {\n\t\t\t// shift content from pos and above\n\t\t\t// if newSize is greater than size, makes room for (newSize - size) elements at pos\n\t\t\t// in this case, make sure to fill the gap with new elements\n\t\t\t// if newSize is less than size, overwrites (newSize - size) elements below pos\n\t\t\tSystem.arraycopy(array, pos, array, newSize - (size - pos), size - pos);\n\t\t}\n\t\t// finally, use the new size\n\t\tsize = newSize;\n\t}", "public void moveToPos(int pos) {\r\n\t\tassert (pos >= 0) && (pos <= cnt) : \"Position out of range\";\r\n\t\tcurr = head;\r\n\t\tfor (int i = 0; i < pos; i++)\r\n\t\t\tcurr = curr.next();\r\n\t}", "public void moveTo(GJPoint2D p) {\n\t\tthis.segments.add(new MoveSegment(p));\n\t\tthis.lastType = Type.MOVE;\n\t}", "private void reposition(){\n int lastBackgroundIndex = firstBackgroundIndex-1;\n if(firstBackgroundIndex == 0){\n lastBackgroundIndex = backgrounds.length-1;\n }\n backgrounds[firstBackgroundIndex].getPosition().x = backgrounds[lastBackgroundIndex].getPosition().x + drawingWidth;\n firstBackgroundIndex = (firstBackgroundIndex+1) % backgrounds.length;\n }", "public void move() {\n\t\t\tar.setAhead(10 * fahrtrichtung);\n\n\t\t\t// Wie schnell sich der Roboter drehen soll\n\t\t\tar.setTurnRight(45 * drehrichtung);\n\t\t\tar.execute();\n\t\t\tfarbschema = farbschema * (-1);\n\t\t}", "public void moveForward()\r\n\t{\r\n\t\tif(loc[1] > 1)\r\n\t\t{\r\n\t\t\tthis.loc[0] -= Math.sin(Math.toRadians(heading-90))*distance; \r\n\t\t\tthis.loc[2] -= Math.cos(Math.toRadians(heading-90))*distance;\r\n\t\t}\r\n\t}", "public void setStartPos(int startPos) {\r\n this.startPos = startPos;\r\n }", "private long moveOn(int amount) {\n\t\t\tthis.position += amount;\n\t\t\treturn amount;\n\t\t}", "public void setStartPos(int startPos) {\n this.startPos = startPos;\n }", "public void move(Vector start,Vector dist);", "public void move(){\n\t\t\n\t}", "public Builder setStartPosition(int value) {\n bitField0_ |= 0x00000008;\n startPosition_ = value;\n onChanged();\n return this;\n }", "public void setPosition(){\r\n currentPosition = 0; \r\n }", "void move(int dx, int dy) {\n position = position.addX(dx);\n position = position.addY(dy);\n }", "public void move() {\n\n int move_position_x = 0;\n int move_postion_y = 0;\n Random random = new Random();\n do {\n\n move_position_x = 0;\n move_postion_y = 0;\n int direction = random.nextInt(6);\n switch (direction) {\n case 0:\n move_postion_y = -1;\n break;\n case 1:\n case 4:\n move_postion_y = 1;\n break;\n case 2:\n case 5:\n move_position_x = 1;\n break;\n case 3:\n move_position_x = -1;\n }\n } while ((this.positionX + move_position_x < 0) || (this.positionX + move_position_x >= size_of_map) || (\n this.positionY + move_postion_y < 0) || (this.positionY + move_postion_y >= size_of_map));\n this.positionX += move_position_x;\n this.positionY += move_postion_y;\n }", "public void moveLeft()\n\t{\n\t\tx = x - STEP_SIZE;\n\t}", "public void move() {\n\r\n\t}", "Position<T> after(Position<T> p) throws IllegalStateException;", "public void movePoint(int slots) {\n if (0 >= this.pointInventory + slots) {\n this.pointInventory = 0;\n }\n else this.pointInventory = Math.min(this.lenInventory - 1, this.pointInventory + slots);\n }", "public void moveUp() {\r\n\t\tmy_cursor_location.y--;\r\n\t}", "public Cell gap(int x, int y, Cell parent) {\n return new Cell(Boolean.FALSE, x, y, parent, parent.globalScore - 1);\n }", "public void Move(float offset) {\n\t\tif(mApplications.get(CurIndex).getZ() == Constants.displayedPlace)\r\n\t\t{\r\n\t\t\tLog.d(TAG, \"Move offset:\"+offset);\r\n\t\t\tif(offset > 0)\r\n\t\t\t{\r\n\t\t\t\tsetReadyNext();\r\n\t\t\t}\r\n\t\t\telse if(offset < 0)\r\n\t\t\t{\r\n\t\t\t\tsetReadyPre();\r\n\t\t\t}\r\n\t\t}\r\n\t\tApplicationInfo.setOffset(offset);\r\n\t}", "private boolean move(int startRow, int startCol, int toRow, int toCol) {\n return model.getPiece(startRow, startCol).moveTo(toRow, toCol);\n }", "private void setPosition(int startPosition) {\n switch (direction) {\n case UP:\n case DOWN:\n this.posX = componentToMove.getX();\n this.posY = componentToMove.getY() + (direction == Direction.UP ? startPosition : -startPosition);\n break;\n default:\n this.posX = componentToMove.getX() + (direction == Direction.LEFT ? startPosition : -startPosition);\n this.posY = componentToMove.getY();\n }\n }", "public abstract void move(int p_index) ;", "protected abstract void moveTo(final float x, final float y);", "public void moveRobber(HexLocation loc) {\n\n\t}", "public void move()\n\t{\n\t\tx = x + logDx;\n\t}", "public void wrap(){\n\t\tif(this.y_location >=99){\n\t\t\tthis.y_location = this.y_location%99;\n\t\t}\n\t\telse if(this.y_location <=0){\n\t\t\tthis.y_location = 99 - (this.y_location%99);\n\t\t}\n\t\tif(this.x_location >= 99){\n\t\t\tthis.x_location = this.x_location%99;\n\t\t}\n\t\telse if(this.x_location <=0){\n\t\t\tthis.x_location = 99-(this.x_location%99);\n\t\t}\n\t}", "public void moveTo(int newX, int newY) {\n xPosition = newX-radius;\n yPosition = newY-radius;\n }", "public void moveDown()\n {\n if (!this.search_zone.isDownBorder(this.y_position))\n {\n this.y_position = (this.y_position + 1);\n }\n }", "public void setIndicatorGap(float gap) {\n this.gap = gap;\n invalidate();\n }", "public void move() {\n\t\tif ( board.getLevel() == 5 )\n\t\t\tmovementIndex = ( movementIndex + 1 ) % movement.length;\n\t}", "public void moveTo(Position newPosition)\n\t{\n\t\tcurrentPosition = newPosition;\n\t}", "public void trim(long position);", "public void move()\n {\n if(!pause)\n {\n if(up)\n { \n list.remove(0); \n head = new Location(head.getA(),head.getB()-15); \n list.add(head); \n }\n else if(down)\n {\n list.remove(0); \n head = new Location(head.getA(),head.getB()+15); \n list.add(head); \n }\n else if(left)\n {\n list.remove(0); \n head = new Location(head.getA()-15,head.getB()); \n list.add(head);\n }\n else if(right)\n {\n list.remove(0); \n head = new Location(head.getA()+15,head.getB()); \n list.add(head); \n }\n \n repaint();\n }\n }", "public void moveUp()\n\t{\n\t\trow++;\n\t}", "@Override\n\tpublic void moveTo(int x, int y) {\n\t\tstartPoint.moveTo(x,y);\n\t\tendPoint.moveTo(x,y);\n\t}", "protected void moveTo (int x, int y) {\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\t}", "public void RotateStarpathToNextPos(){\n starpathPosition++;\n\n //if next pos is 6, reset back to 0\n if(starpathPosition == 6){\n StarpathToIntake();\n }\n //if next pos is 3, go to the shooter\n else if(starpathPosition == 3) StarPathToShooter();\n //else, add with the interval\n else if(starpathPosition < 3) StarpathAddIntervalIntake();\n else if(starpathPosition > 3) StarpathAddIntervalShooter();\n }" ]
[ "0.653957", "0.61929667", "0.5965378", "0.58920467", "0.5883077", "0.5880848", "0.5878212", "0.58548486", "0.5851386", "0.5813902", "0.57955456", "0.57918733", "0.57879156", "0.578641", "0.5744098", "0.5689621", "0.5636573", "0.5628693", "0.56166977", "0.5610482", "0.55957454", "0.5595544", "0.5595435", "0.5591916", "0.55823326", "0.5579637", "0.55683744", "0.5554071", "0.55346", "0.5532297", "0.551814", "0.5517769", "0.5499919", "0.5498253", "0.5472135", "0.54687005", "0.5460371", "0.54578334", "0.5456707", "0.5452883", "0.544813", "0.54447305", "0.54386497", "0.54341286", "0.5430026", "0.5427684", "0.54211164", "0.5414974", "0.54114336", "0.54007304", "0.53998286", "0.53966707", "0.53907514", "0.53893507", "0.53867567", "0.5385396", "0.53723955", "0.53695965", "0.5355955", "0.5354328", "0.5354131", "0.53501433", "0.5337346", "0.5330983", "0.53277886", "0.5322308", "0.532214", "0.5317456", "0.531637", "0.53156143", "0.53124875", "0.53056103", "0.52930945", "0.5289833", "0.5283018", "0.5280483", "0.5278387", "0.5277129", "0.527493", "0.5273955", "0.52708644", "0.5261148", "0.5258487", "0.52581143", "0.52429175", "0.5241538", "0.52389216", "0.5236524", "0.5229694", "0.52239275", "0.5222278", "0.522207", "0.5219572", "0.52147454", "0.52134955", "0.52105635", "0.52026165", "0.52025867", "0.52013415", "0.51953626" ]
0.7679224
0
Inflate the menu; this adds items to the action bar if it is present.
@Override public boolean onCreateOptionsMenu(Menu 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) { switch (item.getItemId()) { case android.R.id.home: onBackPressed(); return true; default: 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 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 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\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\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.79041183", "0.7805934", "0.77659106", "0.7727251", "0.7631684", "0.7621701", "0.75839096", "0.75300384", "0.74873656", "0.7458051", "0.7458051", "0.7438486", "0.742157", "0.7403794", "0.7391802", "0.73870087", "0.7379108", "0.7370295", "0.7362194", "0.7355759", "0.73454577", "0.734109", "0.73295504", "0.7327726", "0.73259085", "0.73188347", "0.731648", "0.73134047", "0.7303978", "0.7303978", "0.7301588", "0.7298084", "0.72932935", "0.7286338", "0.7283324", "0.72808945", "0.72785115", "0.725962", "0.7259136", "0.7249966", "0.7224023", "0.721937", "0.7216621", "0.72045326", "0.7200649", "0.71991026", "0.71923256", "0.71851367", "0.7176769", "0.7168457", "0.71675026", "0.7153402", "0.71533287", "0.71352696", "0.71350807", "0.71350807", "0.7129153", "0.7128639", "0.7124181", "0.7123387", "0.7122983", "0.71220255", "0.711715", "0.711715", "0.711715", "0.711715", "0.7117043", "0.71169263", "0.7116624", "0.71149373", "0.71123946", "0.7109806", "0.7108778", "0.710536", "0.7098968", "0.70981944", "0.7095771", "0.7093572", "0.7093572", "0.70862055", "0.7082207", "0.70808214", "0.7080366", "0.7073644", "0.7068183", "0.706161", "0.7060019", "0.70598614", "0.7051272", "0.70374316", "0.70374316", "0.7035865", "0.70352185", "0.70352185", "0.7031749", "0.703084", "0.7029517", "0.7018633" ]
0.72597474
39
Verifies the developer payload of a purchase.
boolean verifyDeveloperPayload(Purchase p) { String payload = p.getDeveloperPayload(); String messageAfterDecrypt = "not_empty_line"; String password = getString(R.string.check_token); ; try { messageAfterDecrypt = AESCrypt.decrypt(password, payload); //Log.e(TAG, "messageAfterDecrypt " + messageAfterDecrypt); //Log.e(TAG, "email " + email); } catch (GeneralSecurityException e) { e.printStackTrace(); //handle error - could be due to incorrect password or tampered encryptedMsg } // if (messageAfterDecrypt.equals(email)){ // return true; // } if (Utils.isEmailValid(messageAfterDecrypt)) { return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean verifyDeveloperPayload(Purchase p) {\n String payload = p.getDeveloperPayload();\n\n /*\n * TODO: verify that the developer payload of the purchase is correct. It will be\n * the same one that you sent when initiating the purchase.\n *\n * WARNING: Locally generating a random string when starting a purchase and\n * verifying it here might seem like a good approach, but this will fail in the\n * case where the user purchases an item on one device and then uses your app on\n * a different device, because on the other device you will not have access to the\n * random string you originally generated.\n *\n * So a good developer payload has these characteristics:\n *\n * 1. If two different users purchase an item, the payload is different between them,\n * so that one user's purchase can't be replayed to another user.\n *\n * 2. The payload must be such that you can verify it even when the app wasn't the\n * one who initiated the purchase flow (so that items purchased by the user on\n * one device work on other devices owned by the user).\n *\n * Using your own server to store and verify developer payloads across app\n * installations is recommended.\n */\n\n return true;\n }", "boolean verifyDeveloperPayload(Purchase p) {\n\t\t/*String payload = */p.getDeveloperPayload();\n\n\t\t/*\n\t\t * TODO: verify that the developer payload of the purchase is correct.\n\t\t * It will be the same one that you sent when initiating the purchase.\n\t\t * \n\t\t * WARNING: Locally generating a random string when starting a purchase\n\t\t * and verifying it here might seem like a good approach, but this will\n\t\t * fail in the case where the user purchases an item on one device and\n\t\t * then uses your app on a different device, because on the other device\n\t\t * you will not have access to the random string you originally\n\t\t * generated.\n\t\t * \n\t\t * So a good developer payload has these characteristics:\n\t\t * \n\t\t * 1. If two different users purchase an item, the payload is different\n\t\t * between them, so that one user's purchase can't be replayed to\n\t\t * another user.\n\t\t * \n\t\t * 2. The payload must be such that you can verify it even when the app\n\t\t * wasn't the one who initiated the purchase flow (so that items\n\t\t * purchased by the user on one device work on other devices owned by\n\t\t * the user).\n\t\t * \n\t\t * Using your own server to store and verify developer payloads across\n\t\t * app installations is recommended.\n\t\t */\n\n\t\treturn true;\n\t}", "protected boolean verifyDeveloperPayload(final Purchase purchase) {\n\t\tString payload = purchase.getDeveloperPayload();\n\t\tLog.w(TAG, \"Payload: \" + payload);\n\n\t\tHandler handler = new Handler() {\n\t\t\t@Override\n\t\t\tpublic void handleMessage(Message msg) {\n\t\t\t\tif (msg != null) {\n\t\t\t\t\tif (msg.what == Constants.OK) {\n\t\t\t\t\t\tafterVerify(purchase, true);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tUtils.makeError(PurchaseActivity.this, getResources()\n\t\t\t\t\t\t\t.getString(R.string.comm_error));\n\t\t\t\t}\n\n\t\t\t\tafterVerify(purchase, false);\n\t\t\t};\n\t\t};\n\n\t\tMessenger messenger = new Messenger(handler);\n\n\t\tIntent intent = new Intent(PurchaseActivity.this, WebService.class);\n\t\tintent.putExtra(WebService.PARAM_OPERATION,\n\t\t\t\tWebService.OPERATION_VALIDATE_TOKEN);\n\t\tintent.putExtra(WebService.PARAM_TOKEN, purchase.getDeveloperPayload());\n\t\tintent.putExtra(WebService.PARAM_PURCHASE_TOKEN, purchase.getToken());\n\t\tintent.putExtra(WebService.PARAM_MESSENGER_SERVICE, messenger);\n\t\tstartService(intent);\n\n\t\treturn true;\n\t}", "boolean verifyDeveloperPayload(Purchase p) {\n\t String payload = p.getDeveloperPayload();\n\n\t return true;\n\t }", "boolean verifyDeveloperPayload(Purchase p) {\n\t\tString payload = p.getDeveloperPayload();\n\n\t\t/*\n\t\t * TODO: verify that the developer payload of the purchase is correct.\n\t\t * It will be the same one that you sent when initiating the purchase.\n\t\t * \n\t\t * WARNING: Locally generating a random string when starting a purchase\n\t\t * and verifying it here might seem like a good approach, but this will\n\t\t * fail in the case where the user purchases an item on one device and\n\t\t * then uses your app on a different device, because on the other device\n\t\t * you will not have access to the random string you originally\n\t\t * generated.\n\t\t * \n\t\t * So a good developer payload has these characteristics:\n\t\t * \n\t\t * 1. If two different users purchase an item, the payload is different\n\t\t * between them, so that one user's purchase can't be replayed to\n\t\t * another user.\n\t\t * \n\t\t * 2. The payload must be such that you can verify it even when the app\n\t\t * wasn't the one who initiated the purchase flow (so that items\n\t\t * purchased by the user on one device work on other devices owned by\n\t\t * the user).\n\t\t * \n\t\t * Using your own server to store and verify developer payloads across\n\t\t * app installations is recommended.\n\t\t */\n\n\t\treturn true;\n\t}", "boolean verifyDeveloperPayload(Purchase p) {\n return DEVELOPER_PAYLOAD.equals(p.getDeveloperPayload());\n }", "private static boolean verifyDeveloperPayload(Purchase p) {\n RequestParams params = new RequestParams();\n params.put(\"signed_data\", p.getOriginalJson());\n params.put(\"signature\", p.getSignature());\n\n String url = \"http://54.218.122.252/api/receipt/android\";\n\n AsyncHttpClient client = new AsyncHttpClient();\n\n client.post(url, params, new ResponseHandlerInterface() {\n @Override\n public void sendResponseMessage(HttpResponse httpResponse) throws IOException {\n\n }\n\n @Override\n public void sendStartMessage() {\n\n }\n\n @Override\n public void sendFinishMessage() {\n\n }\n\n @Override\n public void sendProgressMessage(long l, long l1) {\n\n }\n\n @Override\n public void sendCancelMessage() {\n\n }\n\n @Override\n public void sendSuccessMessage(int i, Header[] headers, byte[] bytes) {\n\n }\n\n @Override\n public void sendFailureMessage(int i, Header[] headers, byte[] bytes, Throwable throwable) {\n\n }\n\n @Override\n public void sendRetryMessage(int i) {\n\n }\n\n @Override\n public URI getRequestURI() {\n return null;\n }\n\n @Override\n public void setRequestURI(URI uri) {\n\n }\n\n @Override\n public Header[] getRequestHeaders() {\n return new Header[0];\n }\n\n @Override\n public void setRequestHeaders(Header[] headers) {\n\n }\n\n @Override\n public boolean getUseSynchronousMode() {\n return false;\n }\n\n @Override\n public void setUseSynchronousMode(boolean b) {\n\n }\n\n @Override\n public boolean getUsePoolThread() {\n return false;\n }\n\n @Override\n public void setUsePoolThread(boolean b) {\n\n }\n\n @Override\n public void onPreProcessResponse(ResponseHandlerInterface responseHandlerInterface, HttpResponse httpResponse) {\n\n }\n\n @Override\n public void onPostProcessResponse(ResponseHandlerInterface responseHandlerInterface, HttpResponse httpResponse) {\n try {\n String result = EntityUtils.toString(httpResponse.getEntity());\n JSONObject myObject = new JSONObject(result);\n if(myObject.getInt(\"status\") == 1) {\n unlockContentSuccess();\n } else {\n complain(\"Error purchasing. Authenticity verification failed.\");\n }\n }catch (Exception ex) {\n Log.d(TAG, ex.getMessage());\n }\n }\n\n @Override\n public Object getTag() {\n return null;\n }\n\n @Override\n public void setTag(Object o) {\n\n }\n });\n return false;\n\n /*\n * TODO: verify that the developer payload of the purchase is correct.\n * It will be the same one that you sent when initiating the purchase.\n *\n * WARNING: Locally generating a random string when starting a purchase\n * and verifying it here might seem like a good approach, but this will\n * fail in the case where the user purchases an item on one device and\n * then uses your app on a different device, because on the other device\n * you will not have access to the random string you originally\n * generated.\n *\n * So a good developer payload has these characteristics:\n *\n * 1. If two different users purchase an item, the payload is different\n * between them, so that one user's purchase can't be replayed to\n * another user.\n *\n * 2. The payload must be such that you can verify it even when the app\n * wasn't the one who initiated the purchase flow (so that items\n * purchased by the user on one device work on other devices owned by\n * the user).\n *\n * Using your own server to store and verify developer payloads across\n * app installations is recommended.\n */\n //return true;\n }", "@Override\n public int consumePurchase(int apiVersion, String packageName, String purchaseToken) throws RemoteException {\n return apiVersion < 3 ? RESULT_DEVELOPER_ERROR : _db.consume(purchaseToken);\n }", "@Test\r\n public void testVerify() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n byte[] sign = instance.sign(data, keys);\r\n boolean result = instance.verify(data, sign, keys);\r\n assertTrue(result);\r\n }", "public VerificationMethod verifyPurchase(String expectedText) {\n String successPurchaseMessage = readText(successGuestPurchaseBy);\n assertStringEquals(successPurchaseMessage, expectedText);\n return this;\n }", "private void verify(APDU apdu) {\n\n byte[] buffer = apdu.getBuffer();\n // retrieve the PIN data for validation.\n byte byteRead =\n (byte)(apdu.setIncomingAndReceive());\n\n // check pin\n // the PIN data is read into the APDU buffer\n // at the offset ISO7816.OFFSET_CDATA\n // the PIN data length = byteRead\n if ( pin.check(buffer, ISO7816.OFFSET_CDATA,\n byteRead) == false )\n ISOException.throwIt\n (SW_VERIFICATION_FAILED);\n\n}", "public void purchase() {\r\n\t\tdo {\r\n\t\t\tString id = getToken(\"Enter customer id: \");\r\n\t\t\tString brand = getToken(\"Enter washer brand: \");\r\n\t\t\tString model = getToken(\"Enter washer model: \");\r\n\t\t\tint quantity = getInteger(\"Enter quantity to purchase: \");\r\n\t\t\tboolean purchased = store.purchaseWasher(id, brand, model, quantity);\r\n\t\t\tif (purchased) {\r\n\t\t\t\tSystem.out.println(\"Purchased \" + quantity + \" of \" + brand + \" \" + model + \" for customer \" + id);\r\n\t\t\t} else {\r\n\t\t\t\tSystem.out.println(\"Purchase unsuccessful.\");\r\n\t\t\t}\r\n\t\t} while (yesOrNo(\"Make another Purchase?\"));\r\n\t}", "boolean hasPaymentDetailsVersion();", "public void startNewPurchase() throws VerificationFailedException {\n\t}", "public void startNewPurchase() throws VerificationFailedException {\n\t}", "public boolean verify();", "void purchaseMade();", "@Test\n\tpublic void testInvalidMerchantTransaction() {\n\n\t\tString customerCpr = \"111111-0000\";\n\t\tString merchantCpr = \"000000-1111\";\n\t\tString uuid = \"123412345\";\n\t\tdouble amount = 100;\n\t\t\n\t\tCustomer customer = new Customer(customerCpr,\"customer\",\"bankid\");\n\t\tCustomer merchant = new Customer(merchantCpr,\"merchant\",\"bankid\");\n\t\tdatabase.addCustomer(customer);\n\t\t//database.addCustomer(merchant); Merchant not in database\n\t\tdatabase.addBarcode(customerCpr, uuid);\n\t\t\n\t\tTransactionRequest transRequest = new TransactionRequest(uuid,merchantCpr,amount,\"comment\");\n\t\tTransactionHandler transHandle = new TransactionHandler(transRequest);\n\t\t\n\t\tString verifyParticipants = transHandle.verifyTransactionParticipants();\n\t\tdatabase.deleteCustomer(customerCpr);\n\t\tdatabase.deleteCustomer(merchantCpr);\n\t\t\n\t\tassertEquals(\"This merchant is not a DTUPay user\",verifyParticipants);\n\t}", "public static void verify() {\n\n\t\t\t\n\t\t\t\n\t\t\n\t}", "boolean hasSerializedPaymentDetails();", "public boolean testVerify(Synth synth2, String key, Object obj1, Object obj2)\n {\n return false;\n }", "public void verifySignature(SignatureVerifier verifier) {\n\t\tverifier.verify(signingInput(), crypto);\n \t}", "Entry<StatusType, String> verifyInternalSignature(final Document document);", "public void verifyProduct() throws Throwable{\r\n\t\twdlib.waitForElement(getProductText());\r\n\t\t\r\n\t\tif(!getProductText().getText().equals(\"None Included\"))\r\n\t\t{\r\n\t\t\tReporter.log(getProductText().getText()+\" was deleted\",true);\r\n\t\t\tdeleteProduct();\r\n\t\t}\r\n\t\t\r\n\t}", "boolean hasMerchantData();", "boolean hasMerchantData();", "public ResultMessage checkPurchase(PurchaseVO vo) throws RemoteException{\r\n\t\tif(RemoteHelper.getInstance().getPurchaseBillDataService().checkPurchaseBill(toPurchaseBillPO(vo))==feedback.Success){\r\n\t\t\treturn ResultMessage.SUCCESS;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn ResultMessage.FAILED;\r\n\t\t}\r\n\t}", "public boolean verify(byte[] paramArrayOfbyte) throws XMLSignatureException {\n/* 305 */ return this.signatureAlgorithm.engineVerify(paramArrayOfbyte);\n/* */ }", "@Override\n public void onIabPurchaseFinished(IabResult result, Purchase purchase) {\n if (result.isSuccess()) {\n Toast.makeText(getApplicationContext(), \"!! Purchase Success !!\" + result,\n Toast.LENGTH_SHORT).show();\n return;\n } else if (result.isFailure()) {\n Toast.makeText(getApplicationContext(), \"!! Purchase Failed !!\" + result,\n Toast.LENGTH_SHORT).show();\n MainConsumer();\n try {\n mHelper.launchPurchaseFlow(MainActivity.this, inappId, 1001,\n mPurchaseFinishedListener, null);\n } catch (Exception e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n return;\n } else if (purchase.getSku().equals(\"SKU_GAS\")) {\n Toast.makeText(getApplicationContext(), \"!! Gas \\n Consumed !!\",\n Toast.LENGTH_SHORT).show();\n // consume the gas and update the UI\n } else if (purchase.getSku().equals(\"SKU_PREMIUM\")) {\n Toast.makeText(getApplicationContext(), \"!! Premium !!\",\n Toast.LENGTH_SHORT).show();\n // give user access to premium content and update the UI\n } else if (purchase.getSku().equals(inappId)) {\n Toast.makeText(getApplicationContext(), \"!! Android.Test.Purchased !!\",\n Toast.LENGTH_SHORT).show();\n }\n }", "public void verify_only(Transaction t) {\n verify_transaction(t);\n }", "@Override\r\n\tprotected void doVerify() {\n\t\t\r\n\t}", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.VERIFY_PAYMENT);\n // var 1 is from date\n payUChecksum.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.VERIFY_PAYMENT);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n if((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n VerifyPaymentTask verifyPaymentTask = new VerifyPaymentTask(PayUVerifyApiActivity.this);\n verifyPaymentTask.execute(payuConfig);\n\n verifyPaymentDialog.dismiss();\n\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "public void payedConfirmation(){\n\t\tassert reserved: \"a seat also needs to be reserved when bought\";\n\t\tassert customerId != -1: \"this seat needs to have a valid user id\";\n\t\tpayed = true;\n\t}", "int verify(Requirement o);", "public abstract boolean verify();", "public SetupIntent verifyMicrodeposits() throws StripeException {\n return verifyMicrodeposits((Map<String, Object>) null, (RequestOptions) null);\n }", "@Test\r\n public void testVerifyCryptoType() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n byte[] sign = instance.sign(data, keys);\r\n boolean result = instance.verify(data, sign, keys);\r\n assertTrue(result);\r\n }", "@Test\n\tpublic void testValidTransaction() {\n\t\t\n\t\tString customerCpr = \"111111-0000\";\n\t\tString merchantCpr = \"000000-1111\";\n\t\tString uuid = \"123412345\";\n\t\tdouble amount = 100;\n\t\t\n\t\tCustomer customer = new Customer(customerCpr,\"customer\",\"bankid\");\n\t\tCustomer merchant = new Customer(merchantCpr,\"merchant\",\"bankid\");\n\t\tdatabase.addCustomer(customer);\n\t\tdatabase.addCustomer(merchant);\n\t\tdatabase.addBarcode(customerCpr, uuid);\n\t\t\n\t\tTransactionRequest transRequest = new TransactionRequest(uuid,merchantCpr,amount,\"comment\");\n\t\tTransactionHandler transHandle = new TransactionHandler(transRequest);\n\t\t\n\t\tString verifyParticipants = transHandle.verifyTransactionParticipants();\n\t\tString transJMSMessage = transHandle.generateTransactionJMSRequest();\n\t\tdatabase.deleteCustomer(customerCpr);\n\t\tdatabase.deleteCustomer(merchantCpr);\n\n\t\tassertEquals(\"Transaction participants are valid\",verifyParticipants);\n\t\tassertEquals(transJMSMessage,customer.getBankId()+\" \"+ merchant.getBankId()+ \" \" + amount + \" \" + \"comment\");\n\t}", "@Test\n\tpublic void testInvalidCustomerTransaction() {\n\n\t\tString customerCpr = \"111111-0000\";\n\t\tString merchantCpr = \"000000-1111\";\n\t\tString uuid = \"123412345\";\n\t\tdouble amount = 100;\n\t\t\n\t\tCustomer customer = new Customer(customerCpr,\"customer\",\"bankid\");\n\t\tCustomer merchant = new Customer(merchantCpr,\"merchant\",\"bankid\");\n\t\t\n\t\t//database.addCustomer(customer); not registered\n\t\tdatabase.addCustomer(merchant);\n\t\tdatabase.addBarcode(customerCpr, uuid);\n\t\t\n\t\tTransactionRequest transRequest = new TransactionRequest(uuid,merchantCpr,amount,\"comment\");\n\t\tTransactionHandler transHandle = new TransactionHandler(transRequest);\n\t\t\n\t\tString verifyParticipants = transHandle.verifyTransactionParticipants();\n\t\tdatabase.deleteCustomer(customerCpr);\n\t\tdatabase.deleteCustomer(merchantCpr);\n\t\t\n\t\tassertEquals(\"This barcode does not belong to any of DTUPay users\",verifyParticipants);\n\t}", "@Override\r\n\tpublic void validate(Product p) throws CustomBadRequestException {\r\n\t\tif(p.getName() == null || p.getName().equals(\"\") || p.getBarcode() == null || p.getBarcode().equals(\"\") || p.getMeasure_unit() == null ||\r\n\t\t\t\tp.getMeasure_unit().equals(\"\") || p.getQuantity() == null || p.getQuantity().equals(\"\")|| p.getBrand() == null || p.getBrand().equals(\"\")){\r\n\t\t\tthrow new CustomBadRequestException(\"Incomplete Information about the product\");\r\n\t\t}\r\n\r\n\t\tString eanCode = p.getBarcode();\r\n\t\tString ValidChars = \"0123456789\";\r\n\t\tchar digit;\r\n\t\tfor (int i = 0; i < eanCode.length(); i++) { \r\n\t\t\tdigit = eanCode.charAt(i); \r\n\t\t\tif (ValidChars.indexOf(digit) == -1) {\r\n\t\t\t\tthrow new CustomBadRequestException(\"Invalid Barcode\");\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Add five 0 if the code has only 8 digits\r\n\t\tif (eanCode.length() == 8 ) {\r\n\t\t\teanCode = \"00000\" + eanCode;\r\n\t\t}\r\n\t\t// Check for 13 digits otherwise\r\n\t\telse if (eanCode.length() != 13) {\r\n\t\t\tthrow new CustomBadRequestException(\"Invalid Barcode\");\r\n\t\t}\r\n\r\n\t\t// Get the check number\r\n\t\tint originalCheck = Integer.parseInt(eanCode.substring(eanCode.length() - 1));\r\n\t\teanCode = eanCode.substring(0, eanCode.length() - 1);\r\n\r\n\t\t// Add even numbers together\r\n\t\tint even = Integer.parseInt((eanCode.substring(1, 2))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(3, 4))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(5, 6))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(7, 8))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(9, 10))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(11, 12))) ;\r\n\t\t// Multiply this result by 3\r\n\t\teven *= 3;\r\n\r\n\t\t// Add odd numbers together\r\n\t\tint odd = Integer.parseInt((eanCode.substring(0, 1))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(2, 3))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(4, 5))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(6, 7))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(8, 9))) + \r\n\t\t\t\tInteger.parseInt((eanCode.substring(10, 11))) ;\r\n\r\n\t\t// Add two totals together\r\n\t\tint total = even + odd;\r\n\r\n\t\t// Calculate the checksum\r\n\t\t// Divide total by 10 and store the remainder\r\n\t\tint checksum = total % 10;\r\n\t\t// If result is not 0 then take away 10\r\n\t\tif (checksum != 0) {\r\n\t\t\tchecksum = 10 - checksum;\r\n\t\t}\r\n\r\n\t\t// Return the result\r\n\t\tif (checksum != originalCheck) {\r\n\t\t\tthrow new CustomBadRequestException(\"Invalid Barcode\");\r\n\t\t}\r\n\r\n\t\tif(Float.parseFloat(p.getQuantity()) <= 0){\r\n\t\t\tthrow new CustomBadRequestException(\"Invalid Quantity\");\r\n\t\t}\r\n\r\n\r\n\t}", "private boolean validaCompra() {\n\n List<Purchase> purchasesList = billingClient.queryPurchases(INAPP).getPurchasesList();\n if (purchasesList != null && !purchasesList.isEmpty()) {\n for (Purchase purchase : purchasesList) {\n if (purchase.getSku().equals(skuId)) {\n return true;\n }\n }\n }\n return false;\n\n }", "protected void acceptedPaymentVerification() {\n BillingSummaryPage.tableBillingGeneralInformation.getRow(1)\n .getCell(\"Current Due\").waitFor(cell -> !cell.getValue().equals(\"Calculating...\"));\n\n assertThat(BillingSummaryPage.tableBillingGeneralInformation.getRow(1))\n .hasCellWithValue(\"Current Due\", BillingHelper.DZERO.toString())\n .hasCellWithValue(\"Total Due\", BillingHelper.DZERO.toString())\n .hasCellWithValue(\"Total Paid\", modalPremiumAmount.get().toString());\n\n assertThat(BillingSummaryPage.tableBillsAndStatements.getRow(1).getCell(\"Status\")).valueContains(PAID_IN_FULL);\n\n assertThat(BillingSummaryPage.tablePaymentsOtherTransactions)\n .with(POLICY_NUMBER, masterPolicyNumber.get())\n .with(TYPE, PAYMENT)\n .with(TableConstants.BillingPaymentsAndTransactionsGB.AMOUNT, String.format(\"(%s)\", modalPremiumAmount.get().toString()))\n .containsMatchingRow(1);\n\n }", "public boolean verifiySignature() {\n\t\tString data = StringUtil.getStringFromKey(sender) + StringUtil.getStringFromKey(reciepient)\n\t\t\t\t+ Float.toString(value);\n\t\treturn StringUtil.verifyECDSASig(sender, data, signature);\n\t}", "public void verifyProductDetailAttribute(String Sku, String totalGemAmount, String MetalType, String height, String width,\r\n\r\n\t\t\tString MetalWeight, String Catagory, String TypeOfProduct, String DiamondShape, String NoOfDiamonds,\r\n\r\n\t\t\tString Collection, String GemstoneType, String GemstoneShape, String NoOfGemstones, String TotalGemWeight,\r\n\r\n\t\t\tString TotalDiamondWeight, Product productItms) {\n\r\n\t\tif (productItms.getTGemAmount() != null && !productItms.getTGemAmount().trim().equals(\"N/A\")) {\r\n\r\n\t\t\tString actualTGemAmount = utility.converPrice(productItms.getTGemAmount());\r\n\r\n\t\t\tif (!(actualTGemAmount.trim().toUpperCase().equals(totalGemAmount.trim().toUpperCase()))) {\r\n\r\n\t\t\t\tfinalResult.put(\"totalGemAmount\", finalResult.get(\"totalGemAmount\") & false);\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\telse\r\n\r\n\t\t{\r\n\r\n\t\t\tfinalResult.put(totalGemAmount, finalResult.get(\"totalGemAmount\") & false);\r\n\r\n\t\t\ttotalGemAmount = \"N/A\";\r\n\r\n\t\t}\r\n\r\n\t\t// verification of Metal type\r\n\r\n\t\tif (productItms.getmetalPurity() != null && !productItms.getmetalPurity().trim().equals(\"N/A\")) {\r\n\r\n\t\t\tString actualmetalPurity = productItms.getmetalPurity();\r\n\r\n\t\t\tif (!(actualmetalPurity.trim().toUpperCase().equals(MetalType.trim().toUpperCase()))) {\r\n\r\n\t\t\t\tfinalResult.put(\"MetalType\", finalResult.get(\"MetalType\") & false);\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\telse\r\n\r\n\t\t{\r\n\r\n\t\t\tfinalResult.put(MetalType, finalResult.get(\"MetalType\") & false);\r\n\r\n\t\t\tMetalType = \"N/A\";\r\n\r\n\t\t}\r\n\r\n\t\t// Verification of height of the product page\r\n\r\n\t\tif (productItms.getHeight() != null && !productItms.getHeight().trim().equals(\"N/A\")) {\r\n\r\n\t\t\tString actualHeight = utility.convertDecimal(productItms.getHeight());\r\n\r\n\t\t\tString expectedHeight = utility.convertDecimal(height);\r\n\r\n\t\t\tif (!(actualHeight.trim().toUpperCase().equals(expectedHeight.trim().toUpperCase()))) {\r\n\r\n\t\t\t\tfinalResult.put(\"height\", finalResult.get(\"height\") & false);\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\telse if (height == \"0\")\r\n\r\n\t\t{\r\n\r\n\t\t\theight = \"N/A\";\r\n\r\n\t\t\tfinalResult.put(height, finalResult.get(\"height\") & false);\r\n\r\n\t\t}\r\n\r\n\t\t// verification of width of the product page\r\n\r\n\t\tif (productItms.getWidth() != null && !productItms.getWidth().trim().equals(\"N/A\")) {\r\n\r\n\t\t\tString actualWidth = utility.convertDecimal(productItms.getWidth());\r\n\r\n\t\t\tString expectedWidth = utility.convertDecimal(width);\r\n\r\n\t\t\tif (!(actualWidth.trim().toUpperCase().equals(expectedWidth.trim().toUpperCase()))) {\r\n\r\n\t\t\t\tfinalResult.put(\"width\", finalResult.get(\"width\") & false);\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\telse if (width == \"0\")\r\n\r\n\t\t{\r\n\r\n\t\t\tfinalResult.put(\"width\", finalResult.get(\"width\") & false);\r\n\r\n\t\t\twidth = \"N/A\";\r\n\r\n\t\t}\r\n\r\n\t\t// verification of gold weight\r\n\r\n if((Sku.contains(\"RG\")||Sku.contains(\"BR\")))\r\n {\r\n MetalWeight=\"N/A\";\r\n \r\n }\r\n else {\r\n \r\n if(productItms.getGoldWeight() != null && !productItms.getGoldWeight().trim().equals(\"N/A\")){\r\n\r\n\r\n\t\t\tString actualGoldWeight = utility.convertDecimal(productItms.getGoldWeight().split(\" \")[0].toString());\r\n\r\n\t\t\tString expectedGoldWeight = utility.convertDecimal(MetalWeight);\r\n\r\n\t\t\tif (!(actualGoldWeight.trim().toUpperCase().equals(expectedGoldWeight.trim().toUpperCase()))) {\r\n\r\n\t\t\t\tfinalResult.put(\"MetalWeight\", finalResult.get(\"MetalWeight\") & false);\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\telse\r\n\r\n\t\t{\r\n\r\n\t\t\tfinalResult.put(\"MetalWeight\", finalResult.get(\"MetalWeight\") & false);\r\n\r\n\t\t\tMetalWeight = \"N/A\";\r\n\r\n\t\t}\r\n\r\n\t\t// verification of Design Type\r\n\r\n\t\tif (productItms.getDesignType() != null && !productItms.getDesignType().trim().equals(\"N/A\")) {\r\n\r\n\t\t\tString actualDesignType = productItms.getDesignType();\r\n\r\n\t\t\tif (!(actualDesignType.trim().toUpperCase().equals(Catagory.trim().toUpperCase()))) {\r\n\r\n\t\t\t\tfinalResult.put(\"Catagory\", finalResult.get(\"Catagory\") & false);\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\telse\r\n\r\n\t\t{\r\n\r\n\t\t\tfinalResult.put(\"Catagory\", finalResult.get(\"Catagory\") & false);\r\n\r\n\t\t\tCatagory = \"N/A\";\r\n\r\n\t\t}\r\n\r\n\t\t// Verification of style of the product in Product Page. String\r\n\r\n\t\tif (productItms.getstyle() != null && !productItms.getstyle().trim().equals(\"N/A\")) {\r\n\r\n\t\t\tif (!(utility.matchTwoString(productItms.getstyle(), TypeOfProduct)))\r\n\r\n\t\t\t\tfinalResult.put(\"TypeOfProduct\", finalResult.get(\"TypeOfProduct\") & false);\r\n\r\n\t\t}\r\n\r\n\t\telse\r\n\r\n\t\t{\r\n\r\n\t\t\tfinalResult.put(\"TypeOfProduct\", finalResult.get(\"TypeOfProduct\") & false);\r\n\r\n\t\t\tTypeOfProduct = \"N/A\";\r\n\r\n\t\t}\r\n\r\n\t\t// verification of Diamond shape\r\n\r\n\t\tif (productItms.getDshape() != null && !productItms.getDshape().trim().equals(\"N/A\")) {\r\n\r\n\t\t\tif (!(utility.matchTwoString(productItms.getDshape(), DiamondShape)))\r\n\r\n\t\t\t\tfinalResult.put(\"DiamondShape\", finalResult.get(\"DiamondShape\") & false);\r\n\r\n\t\t}\r\n\r\n\t\telse\r\n\r\n\t\t{\r\n\r\n\t\t\tfinalResult.put(\"DiamondShape\", finalResult.get(\"TypeOfProduct\") & false);\r\n\r\n\t\t\tDiamondShape = \"N/A\";\r\n\r\n\t\t}\r\n\r\n\t\t// verification of Total number of Diamonds\r\n\r\n\t\tString actualTotalnoDiamonds = productItms.getTotalnoDiamonds();\r\n\r\n\t\tif (!(actualTotalnoDiamonds.trim().toUpperCase().equals(NoOfDiamonds.trim().toUpperCase()))) {\r\n\r\n\t\t\tfinalResult.put(\"NoOfDiamonds\", finalResult.get(\"NoOfDiamonds\") & false);\r\n\r\n\t\t}\r\n\r\n\t\t// verification of Diamond total Weight\r\n\r\n\t\tString actualDtotalWeight = utility.convertDecimal(productItms.getDtotalWeight().split(\"ct\")[0].toString());\r\n\r\n\t\tString expetedDtotalWeight1 = utility.convertDecimal(TotalDiamondWeight.trim());\r\n\r\n\t\tif (!(actualDtotalWeight.trim().toUpperCase().equals(expetedDtotalWeight1.trim().toUpperCase()))) {\r\n\r\n\t\t\tfinalResult.put(\"TotalDiamondWeight\", finalResult.get(\"TotalDiamondWeight\") & false);\r\n\r\n\t\t}\r\n\r\n\t\t// verification of Collections\r\n\r\n\t\tif (!(utility.matchTwoString(productItms.getCollections(), Collection)))\r\n\r\n\t\t\tfinalResult.put(\"Collection\", finalResult.get(\"Collection\") & false);\r\n\r\n\t\t// verification of Gemstone Type\r\n\r\n\t\tif (GemstoneType.length() > 0)\r\n\r\n\t\t\tif (!(utility.matchTwoString(productItms.getGemType(), GemstoneType)))\r\n\r\n\t\t\t\tfinalResult.put(\"GemstoneType\", finalResult.get(\"GemstoneType\") & false);\r\n\r\n\t\t// verification of Gemstone shape\r\n\r\n\t\tif (GemstoneShape.length() > 0)\r\n\r\n\t\t\tif (!(utility.matchTwoString(productItms.getGemShape(), GemstoneShape)))\r\n\r\n\t\t\t\tfinalResult.put(\"GemstoneShape\", finalResult.get(\"GemstoneShape\") & false);\r\n\r\n\t\t// verification of Number of Gemstones\r\n\r\n\t\tif (!(NoOfGemstones.equals(\"0\"))) {\r\n\r\n\t\t\tString actualTotalNoGem = productItms.getTotalNoGem();\r\n\r\n\t\t\tif (!(actualTotalNoGem.trim().toUpperCase().equals(NoOfGemstones.trim().toUpperCase()))) {\r\n\r\n\t\t\t\tfinalResult.put(\"NoOfGemstones\", finalResult.get(\"NoOfGemstones\") & false);\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t// verification of Total Gemstone weight\r\n\r\n\t\tif (!(TotalGemWeight.equals(\"0\"))) {\r\n\r\n\t\t\tString actualTotalGemWeight = utility\r\n\r\n\t\t\t\t\t.convertDecimal(productItms.getTotalGemWeight().split(\"ct\")[0].toString());\r\n\r\n\t\t\tString expectedTotalGemWeight = utility.convertDecimal(TotalGemWeight);\r\n\r\n\t\t\tif (!(actualTotalGemWeight.trim().toUpperCase().equals(expectedTotalGemWeight.trim().toUpperCase()))) {\r\n\r\n\t\t\t\tfinalResult.put(\"TotalGemWeight\", finalResult.get(\"TotalGemWeight\") & false);\r\n\r\n\t\t\t}\r\n\t\t}\r\n }\r\n\r\n\t\t\r\n\r\n\t}", "private boolean validatePuchase() {\n if (TextUtils.isEmpty(editextPurchaseSupplierName.getText().toString())) {\n editextPurchaseSupplierName.setError(getString(R.string.supplier_name));\n editextPurchaseSupplierName.requestFocus();\n return false;\n }\n\n if (TextUtils.isEmpty(edittextPurchaseAmount.getText().toString())) {\n if (flowpurchaseReceivedOrPaid == 2) {\n edittextPurchaseAmount.setError(getString(R.string.menu_purchasePaid));\n edittextPurchaseAmount.requestFocus();\n\n } else {\n edittextPurchaseAmount.setError(getString(R.string.purchase_amount));\n edittextPurchaseAmount.requestFocus();\n }\n return false;\n }\n\n if (TextUtils.isEmpty(edittextPurchasePurpose.getText().toString())) {\n edittextPurchasePurpose.setError(getString(R.string.remark_bill_number));\n edittextPurchasePurpose.requestFocus();\n return false;\n }\n\n\n return true;\n }", "@Test\n public void verifyAppleOfferApplied() {\n \tProduct product = new Product(\"Apple\", 0.2);\n \tBasket basket = new Basket();\n \tbasket.getProducts().put(product, 5);\n \tassertTrue(\"Have to get the price of 3 items = 0.6 ==> \", \n \t\t\tDouble.compare(calculator.calculatePrice(basket), 0.6) == 0);\n }", "@Test\n public void testConfirmPurchaseOrder() throws Exception {\n System.out.println(\"confirmPurchaseOrder\");\n String userId = \"F1000001\";\n Long purchaseOrderId = 1L;\n String result = PurchaseOrderManagementModule.confirmPurchaseOrder(userId, purchaseOrderId);\n assertEquals(\"Purchase Order Confirmed!\", result);\n }", "@Override\n\tpublic boolean verify(RowStruct row) {\n\t\treturn true;\n\t}", "boolean hasPayment();", "boolean hasPayment();", "public boolean verifySignature() {\r\n\t\t\r\n\t\tString data;\r\n\t\t\r\n\t\tif(isTypeCreation){\r\n\t\t\t\r\n\t\t\tdata = StringUtil.getStringFromKey(creator) + name +\r\n\t\t\t\t\tdescription + begin + end+end_subscription+\r\n\t\t\t\t\tlocation+min_capacity+max_capacity;\r\n\t\t\treturn StringUtil.verifyECDSASig(creator, data, signature);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdata = StringUtil.getStringFromKey(subscriber)+id_event;\r\n\t\t\treturn StringUtil.verifyECDSASig(subscriber, data, signature);\r\n\t\t}\r\n//\t\tSystem.out.println(\"signature \"+signature);\r\n\t\t\r\n\t}", "@Test\n public void verifyOffersApplied() {\n \tProduct product = new Product(\"Watermelon\", 0.8);\n \tProduct product2 = new Product(\"Apple\", 0.2);\n \tProduct product3 = new Product(\"Orange\", 0.5);\n \tBasket basket = new Basket();\n \tbasket.getProducts().put(product, 6);\n \tbasket.getProducts().put(product2, 4);\n \tbasket.getProducts().put(product3, 5);\n \tassertTrue(\"Have to get the price of 15 items = 6.1 ==> \", (calculator.calculatePrice(basket) - 6.1) < 0.0001);\n }", "public void checkLicense(String base64key)\n {\n String deviceId = Secure.getString(getContentResolver(), Secure.ANDROID_ID);\n\n // Library calls this when it's done.\n mLicenseCheckerCallback = new CustomLicenseCheckerCallback();\n // Construct the LicenseChecker with a policy.\n mPolicy = new ServerManagedPolicy(this, new AESObfuscator(SALT, getPackageName(), deviceId));\n\t\tmChecker = new LicenseChecker(this, mPolicy, base64key);\n\t\tmChecker.checkAccess(mLicenseCheckerCallback);\n }", "public void validateRpd3s12()\n {\n // This guideline cannot be automatically tested.\n }", "@Test(groups = {\"smoke tests\"})\n public void validPurchase() {\n page.GetInstance(CartPage.class)\n .clickProceedToCheckoutButton() //to OrderAddressPage\n .clickProceedToCheckoutButton() //to OrderShippingPage\n .acceptTermsAndProceedToCheckout() //to OrderPaymentPage\n .clickPayByBankWireButton() //to OrderSummaryPage\n .clickIConfirmMyOrderButton(); //to OrderConfirmationPage\n\n // Then\n page.GetInstance(OrderConfirmationPage.class).confirmValidOrder(\"Your order on My Store is complete.\");\n }", "boolean hasPlainRedeem();", "public void checkLicense(String base64key)\n {\n String deviceId = Secure.getString(getContentResolver(), Secure.ANDROID_ID);\n\n // Library calls this when it's done.\n mLicenseCheckerCallback = new CustomLicenseCheckerCallback();\n // Construct the LicenseChecker with a policy.\n mChecker = new LicenseChecker(this, new ServerManagedPolicy(this, new AESObfuscator(SALT, getPackageName(), deviceId)), base64key);\n\t\tmChecker.checkAccess(mLicenseCheckerCallback);\n }", "@Test\r\n public void testVerifyInvalidPk() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n byte[] sign = instance.sign(data, keys);\r\n keys.verkey = \"AnnxV4t3LUHKZaxVQDWoVaG44NrGmeDYMA4Gz6C2tCZd\";\r\n Assertions.assertThrows(SodiumException.class, () -> {\r\n instance.verify(data, sign, keys);\r\n });\r\n }", "public int wasPurchased() {\n return wasPurchased;\n }", "@Test\n\tpublic void testVerify() {\n\t\t\n\t\tSystem.out.println(\"Before Verfiy\");\n\t\tSoftAssert assert1 = new SoftAssert();\n\t\t\n\t\tassert1.fail();\n\t\t\n\t\tSystem.out.println(\"After Assertion\");\n\t}", "public void verify(java.security.PublicKey r1) throws java.security.cert.CertificateException, java.security.NoSuchAlgorithmException, java.security.InvalidKeyException, java.security.NoSuchProviderException, java.security.SignatureException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.verify(java.security.PublicKey):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.verify(java.security.PublicKey):void\");\n }", "boolean additionalPayerInfoVerification(final String email) {\n return Log.altVerify(email, lblEMail().getText(), true, \"E-mail address\");\n }", "@Override\n\t\t\tpublic void mainBuyPro() {\n\t\t\t\tif (iap_is_ok && mHelper != null) {\n\t\t\t\t\t\n\t\t\t\t\t String payload = \"\";\n\t\t\t\t\t mHelper.launchPurchaseFlow(MainActivity.this, Paid_Id_VF, RC_REQUEST, mPurchaseFinishedListener);\n\t\t\t\t}else{\n\t\t\t\t}\n\t\t\t}", "@Override\n public ResponseEntity<PaymentInfo> purchase(@RequestBody PaymentInfo request) {\n return new ResponseEntity<PaymentInfo>(request, HttpStatus.OK);\n }", "public void submitCurrentPurchase(List<SoldItem> goods) throws VerificationFailedException {\n\n\t}", "@Test\n public void checkUpdateCampaignTest() {\n ObjectIdentityData buyer = ObjectIdentityData.getAnyObjectFromList(buyers);\n // select any not own campaign\n ObjectIdentityData campaign = ObjectIdentityData.getAnyObjectFromList(campaigns);\n RequestData requestData = new CampaignRequestData(campaign, buyer, false);\n GrantsVerification.checkUpdateRequest(requestData, isAdmin());\n }", "public String getDeveloperPayload(){\n return developerPayload;\n }", "@Override\r\n\tpublic void updatePurchase(Purchase Purchase) throws Exception {\n\t\t\r\n\t}", "public void isPurchased(Player player) {\n\t}", "Entry<StatusType, String> verifyExternalSignature(Document document, Document signature);", "@java.lang.Override\n public boolean hasMerchantData() {\n return instance.hasMerchantData();\n }", "@java.lang.Override\n public boolean hasMerchantData() {\n return instance.hasMerchantData();\n }", "public void testGolden() throws Throwable {\n verifyGolden(this, getData());\n }", "public void setWasPurchased(int wasPurchased) {\n this.wasPurchased = wasPurchased;\n }", "@Test\r\n\tpublic void testMakePurchase_not_enough_money() {\r\n\t\tassertEquals(false, vendMachine.makePurchase(\"A\"));\r\n\t}", "@Then(\"^I should be able to see the Payment button$\")\n\tpublic void i_should_be_able_to_see_the_Payment_button() throws Throwable {\n\t\tbc.checkPayment();\n\t}", "public String verify()\n\t{\n\t\t\treturn null;\n\t}", "@Suspendable\n @Override\n protected void checkTransaction(SignedTransaction stx) throws FlowException {\n }", "@java.lang.Override\n public boolean hasPaymentDetailsVersion() {\n return instance.hasPaymentDetailsVersion();\n }", "@Override\r\n\tpublic void payCheck() {\n\t\t\r\n\t}", "public void verify() throws InternalSkiException {\n if (SERVER_KEY_VALUE==null || \"\".equals(SERVER_KEY_VALUE.trim())) {\n throw new InternalSkiException(\"Cannot validate server key!\");\n }\n\n byte[] tokenKey = getTokenKey();\n byte[] systemKey = getSystemKey();\n\n if (tokenKey==null || systemKey==null) {\n throw new InternalSkiException(\"Cannot validate token or system keys!\");\n }\n }", "private static boolean VerifyInput(String encrypteddata) throws NoSuchAlgorithmException, UnsupportedEncodingException {\n //extract the data and signed message\n String[] data = encrypteddata.split(\"#\");\n String clientdataComputedhash = \"\";\n try {\n clientdataComputedhash = CalHash(data[0].getBytes());\n } catch (UnsupportedEncodingException ex) {\n System.out.println(\"Unsupported Encoding Exception\");\n }\n //compute the hash from the signed message\n byte[] clientHash = data[1].getBytes();\n String clientdecryptHash = RSAdecrypt(clientHash);\n boolean status = false;\n //status if the signature does not matches\n status = clientdecryptHash.equals(clientdataComputedhash);\n return status;\n }", "@java.lang.Override\n public boolean hasMerchantData() {\n return ((bitField0_ & 0x00000020) != 0);\n }", "@Test\n\tvoid purchaseTest() {\n\t\ttestCrew.setMoney(10000);\n\t\tfor(MedicalItem item: itemList) {\n\t\t\tint currentMoney = testCrew.getMoney();\n\t\t\titem.purchase(testCrew);\n\t\t\tassertEquals(testCrew.getMoney(), currentMoney - item.getPrice());\n\t\t\tassertTrue(testCrew.getMedicalItems().get(0).getClass().isAssignableFrom(item.getClass()));\n\t\t\ttestCrew.removeFromMedicalItems(testCrew.getMedicalItems().get(0));\n\t\t}\n\t}", "public SetupIntent verifyMicrodeposits(Map<String, Object> params) throws StripeException {\n return verifyMicrodeposits(params, (RequestOptions) null);\n }", "public boolean testVerify(byte[] message)\n {\n return false;\n }", "@SuppressWarnings(\"unused\")\n\tpublic void submitCurrentPurchase(List<SoldItem> goods) throws VerificationFailedException {\n\t\tif(false)throw new VerificationFailedException(\"Underaged!\");\n\t\t// XXX - Save purchase\n\t}", "@Override\n public void onClick(View view) {\n Bundle ecommerceBundle = new Bundle();\n ecommerceBundle.putString(\"screenName\", \"Confirmation\");\n ecommerceBundle.putString( FirebaseAnalytics.Param.TRANSACTION_ID, \"333444\" );\n ecommerceBundle.putDouble( FirebaseAnalytics.Param.VALUE, 20.49 );\n // (OPTIONAL) For partial refunds, define the item IDs and quantities of products being refunded\n Bundle refundedProduct = new Bundle();\n refundedProduct.putString(FirebaseAnalytics.Param.ITEM_ID, \"ProductId 123\"); // Required for partial refund\n refundedProduct.putLong(FirebaseAnalytics.Param.QUANTITY, 1); // Required for partial refund\n ArrayList items = new ArrayList();\n items.add(refundedProduct);\n ecommerceBundle.putParcelableArrayList( \"items\", items );\n mFirebaseAnalytics.logEvent( FirebaseAnalytics.Event.PURCHASE_REFUND, ecommerceBundle );\n\n toast.show();\n }", "@java.lang.Override\n public boolean hasPaymentDetailsVersion() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "boolean verify(byte[] expected);", "@Override\r\n\tpublic void updateTranCode(Purchase Purchase) throws Exception {\n\t\t\r\n\t}", "@Test\n\tpublic void testInvalidBarcodeTransaction() {\n\n\t\tString customerCpr = \"111111-0000\";\n\t\tString merchantCpr = \"000000-1111\";\n\t\tString uuid = \"123412345\";\n\t\tdouble amount = 100;\n\t\t\n\t\tCustomer customer = new Customer(customerCpr,\"customer\",\"bankid\");\n\t\tCustomer merchant = new Customer(merchantCpr,\"merchant\",\"bankid\");\n\t\tdatabase.addCustomer(merchant); //Merchant not in database\n\t\t//database.addBarcode(customerCpr, uuid);\n\t\t\n\t\tTransactionRequest transRequest = new TransactionRequest(uuid,merchantCpr,amount,\"comment\");\n\t\tTransactionHandler transHandle = new TransactionHandler(transRequest);\n\t\t\n\t\tString verifyParticipants = transHandle.verifyTransactionParticipants();\n\t\tdatabase.deleteCustomer(customerCpr);\n\t\tdatabase.deleteCustomer(merchantCpr);\n\t\t\n\t\tassertEquals(\"This barcode does not exist\",verifyParticipants);\n\t}", "public void verify(java.security.PublicKey r1, java.lang.String r2) throws java.security.cert.CertificateException, java.security.NoSuchAlgorithmException, java.security.InvalidKeyException, java.security.NoSuchProviderException, java.security.SignatureException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.security.keystore.DelegatingX509Certificate.verify(java.security.PublicKey, java.lang.String):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.security.keystore.DelegatingX509Certificate.verify(java.security.PublicKey, java.lang.String):void\");\n }", "private void validateFermatPacketSignature(FermatPacket fermatPacketReceive){\n\n System.out.println(\" WsCommunicationVPNClient - validateFermatPacketSignature\");\n\n /*\n * Validate the signature\n */\n boolean isValid = AsymmectricCryptography.verifyMessageSignature(fermatPacketReceive.getSignature(), fermatPacketReceive.getMessageContent(), vpnServerIdentity);\n\n System.out.println(\" WsCommunicationVPNClient - isValid = \" + isValid);\n\n /*\n * if not valid signature\n */\n if (!isValid){\n throw new RuntimeException(\"Fermat Packet received has not a valid signature, go to close this connection maybe is compromise\");\n }\n\n }", "@Override\n\tpublic void processPayment() {\n\t\t\n\t\tsetIsSuccessful();\n\t}", "public static void verify() {\n intended(toPackage(PelconnerMainActivity.class.getName() + \".vladast\"));\n }", "@Override\n public void verify(@NotNull LedgerTransaction tx) throws IllegalArgumentException {\n }", "public void validateRequestToBuyPage(){\r\n\t\tsearchByShowMeAll();\r\n\t\tclickCheckboxAndRenewBuyButton();\r\n\t\tverifyRequestToBuyPage();\r\n\t}", "private void onPurchaseFinished(IabResult result, com.riotapps.wordbase.billing.Purchase purchase){\n\t\t \n\t\t Logger.d(TAG, \"onPurchaseFinished failed=\" + result.isFailure());\n\t\t \n\t\t if (result.isFailure()) {\n Logger.d(TAG, \"Error purchasing: \" + result);\n return;\n } \n\t\t else {\n\t\t\t StoreService.savePurchase(purchase.getSku(), purchase.getToken());\n\t\t\t \n\t\t\t String thankYouMessage = this.getString(R.string.thank_you);\n\t\t\tif (purchase.getSku().equals(this.getString(R.string.SKU_GOOGLE_PLAY_PREMIUM_UPGRADE))){\n\t\t\t\t thankYouMessage = this.getString(R.string.purchase_thanks_premium_upgrade);\n\t\t\t }\n\t\t\t\t \n\t\t\t //popup a thank you dialog\n\t\t\t DialogManager.SetupAlert(this, this.getString(R.string.thank_you), thankYouMessage);\n\t \n\t\t\t this.resetPriceButtons(purchase.getSku());\n\t\t }\n \n\t }", "@java.lang.Override\n public boolean hasMerchantData() {\n return ((bitField0_ & 0x00000001) != 0);\n }" ]
[ "0.77633524", "0.7717056", "0.7712862", "0.77019256", "0.7629482", "0.7334401", "0.7135012", "0.57475924", "0.54765177", "0.54716784", "0.5441592", "0.53770256", "0.5295385", "0.5277821", "0.5277821", "0.52756935", "0.5275265", "0.52747554", "0.5207311", "0.51871467", "0.5178021", "0.5155512", "0.50840807", "0.50766325", "0.5048524", "0.5048524", "0.5039666", "0.5007602", "0.49744534", "0.49690348", "0.49637896", "0.4957903", "0.4956829", "0.49501574", "0.49488258", "0.49454254", "0.49331397", "0.49292994", "0.49153823", "0.4903157", "0.48912212", "0.48659247", "0.4852964", "0.48445067", "0.48435158", "0.48320678", "0.4815071", "0.48150018", "0.48103938", "0.48103938", "0.4805324", "0.48016083", "0.4799716", "0.47965974", "0.47924557", "0.4786874", "0.47858277", "0.47831956", "0.478283", "0.47787547", "0.47526407", "0.47461343", "0.47412306", "0.4728612", "0.47268215", "0.46950558", "0.46930078", "0.46918324", "0.46761084", "0.4672583", "0.4659909", "0.4659909", "0.46587947", "0.46558315", "0.46499428", "0.46459934", "0.46417463", "0.4639884", "0.4625975", "0.46207464", "0.46193296", "0.46165654", "0.46151918", "0.46138436", "0.46120155", "0.46075195", "0.46048078", "0.46046653", "0.45986575", "0.4597026", "0.4591879", "0.45884418", "0.45862722", "0.45836517", "0.45769453", "0.4574894", "0.45667565", "0.45643055", "0.45622203", "0.45613968" ]
0.68576807
7
"Subscribe to premium" button clicked. Explain to user, then start purchase flow for subscription.
public void onPremiumButtonClicked(String sku) { if (!mHelper.subscriptionsSupported()) { complain("Subscriptions not supported on your device yet. Sorry!"); Toast.makeText(this, R.string.subscription_not_supported, Toast.LENGTH_LONG).show(); return; } startPurchase(sku); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void becomePremium() {\n\t\tif (this.account >= 100 && this.premium == false) {\n\t\t\tthis.account -= 100;\n\t\t\tthis.premium = true;\n\t\t\tSystem.out.println(\"Premium transaction successful\");\n\n\t\t} else if (this.premium == true) {\n\t\t\tSystem.out.println(\"They are already a premium user!\");\n\n\t\t} else {\n\t\t\tSystem.err.println(\n\t\t\t\t\t\"Error - not enough funds in account.\\nPremium charge is $100\\nBalance: $\" + this.getBalance() + \"\\nPlease top up account manually.\\nReturning to main menu.\");\n\t\t}\n\t}", "public void onInfiniteGasButtonClicked(View arg0) {\n\t\tif (!mHelper.subscriptionsSupported()) {\n\t\t\tcomplain(\"Subscriptions not supported on your device yet. Sorry!\");\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * TODO: for security, generate your payload here for verification. See\n\t\t * the comments on verifyDeveloperPayload() for more info. Since this is\n\t\t * a SAMPLE, we just use an empty string, but on a production app you\n\t\t * should carefully generate this.\n\t\t */\n//\t\tString payload = \"\";\n\n\t\tsetWaitScreen(true);\n//\t\tLog.d(TAG, \"Launching purchase flow for infinite gas subscription.\");\n//\t\tmHelper.launchPurchaseFlow(GameRenderer.mStart, SKU_50000, RC_REQUEST,\n//\t\t\t\tmPurchaseFinishedListener, payload);\n\t}", "public static WebElement btn_PACrossPromotion_ClickSubscribe() throws Exception{\r\n \ttry{\r\n \t\telement = driver.findElement(By.xpath(\"//*[contains(@class, 'PAList')]//a[text()='Subscribe']\"));\r\n \t\tAdd_Log.info(\"Subscribe button is click on the page.\");\r\n \t\t\r\n \t}catch(Exception e){\r\n \t\tAdd_Log.error(\"Subscribe button is NOT found on the page.\");\r\n \t\tthrow(e);\r\n \t}\r\n \treturn element;\r\n }", "public void initiateItemPurchase() {\n checkForExistingSubscription(false);\n\n if (useCCAvenue()) {\n //Log.d(TAG, \"Initiating CCAvenue purchase\");\n if (isUserSubscribed()) {\n try {\n showLoadingDialog(true);\n appCMSSubscriptionPlanCall.call(\n currentActivity.getString(R.string.app_cms_get_current_subscription_api_url,\n appCMSMain.getApiBaseUrl(),\n getLoggedInUser(),\n appCMSSite.getGist().getSiteInternalName()),\n R.string.app_cms_subscription_subscribed_plan_key,\n null,\n apikey,\n getAuthToken(),\n listResult -> {\n //Log.v(\"currentActivity\", \"currentActivity\");\n showLoadingDialog(false);\n }, appCMSSubscriptionPlanResults -> {\n showLoadingDialog(false);\n sendCloseOthersAction(null, true, false);\n refreshSubscriptionData(this::sendRefreshPageAction, true);\n },\n appCMSSubscriptionPlanResult -> {\n showLoadingDialog(false);\n try {\n if (appCMSSubscriptionPlanResult != null) {\n upgradePlanAPICall();\n }\n } catch (Exception e) {\n //Log.e(TAG, \"refreshSubscriptionData: \" + e.getMessage());\n }\n }\n );\n } catch (Exception ex) {\n //\n }\n } else {\n initiateCCAvenuePurchase();\n }\n } else {\n if (currentActivity != null &&\n inAppBillingService != null &&\n TextUtils.isEmpty(getRestoreSubscriptionReceipt())) {\n //Log.d(TAG, \"Initiating Google Play Services purchase\");\n try {\n Bundle activeSubs = null;\n try {\n activeSubs = inAppBillingService.getPurchases(3,\n currentActivity.getPackageName(),\n \"subs\",\n null);\n } catch (RemoteException e) {\n //Log.e(TAG, \"Failed to retrieve current active subscriptions: \" + e.getMessage());\n }\n\n ArrayList<String> subscribedSkus = null;\n\n if (activeSubs != null) {\n subscribedSkus = activeSubs.getStringArrayList(\"INAPP_PURCHASE_ITEM_LIST\");\n }\n\n Bundle buyIntentBundle;\n if (subscribedSkus != null && !subscribedSkus.isEmpty()) {\n //Log.d(TAG, \"Initiating upgrade purchase\");\n } else {\n //Log.d(TAG, \"Initiating new item purchase\");\n }\n\n buyIntentBundle = inAppBillingService.getBuyIntentToReplaceSkus(5,\n currentActivity.getPackageName(),\n subscribedSkus,\n skuToPurchase,\n \"subs\",\n null);\n\n if (buyIntentBundle != null) {\n int resultCode = buyIntentBundle.getInt(\"RESPONSE_CODE\");\n if (resultCode == 0) {\n PendingIntent pendingIntent = buyIntentBundle.getParcelable(\"BUY_INTENT\");\n if (pendingIntent != null) {\n //Log.d(TAG, \"Launching intent to initiate item purchase\");\n currentActivity.startIntentSenderForResult(pendingIntent.getIntentSender(),\n RC_PURCHASE_PLAY_STORE_ITEM,\n new Intent(),\n 0,\n 0,\n 0);\n } else {\n showToast(currentActivity.getString(R.string.app_cms_cancel_subscription_subscription_not_valid_message),\n Toast.LENGTH_LONG);\n }\n } else {\n setSelectedSubscriptionPlan(true);\n if (resultCode == IabHelper.BILLING_RESPONSE_RESULT_USER_CANCELED) {\n showDialog(DialogType.SUBSCRIBE, \"Billing response was cancelled by user\", false, null, null);\n } else if (resultCode == IabHelper.BILLING_RESPONSE_RESULT_SERVICE_UNAVAILABLE) {\n showDialog(DialogType.SUBSCRIBE, \"Billing response is unavailable\", false, null, null);\n } else if (resultCode == IabHelper.BILLING_RESPONSE_RESULT_BILLING_UNAVAILABLE) {\n addGoogleAccountToDevice();\n } else if (resultCode == IabHelper.BILLING_RESPONSE_RESULT_ITEM_UNAVAILABLE) {\n showDialog(DialogType.SUBSCRIBE, \"Billing response result item is unavailable\", false, null, null);\n } else if (resultCode == IabHelper.BILLING_RESPONSE_RESULT_DEVELOPER_ERROR) {\n showDialog(DialogType.SUBSCRIBE, \"Billing response result developer error\", false, null, null);\n } else if (resultCode == IabHelper.BILLING_RESPONSE_RESULT_ERROR) {\n showDialog(DialogType.SUBSCRIBE, \"Billing response result error\", false, null, null);\n } else if (resultCode == IabHelper.BILLING_RESPONSE_RESULT_ITEM_ALREADY_OWNED) {\n showDialog(DialogType.SUBSCRIBE, \"Billing response item already purchased\", false, null, null);\n } else if (resultCode == IabHelper.BILLING_RESPONSE_RESULT_ITEM_NOT_OWNED) {\n showDialog(DialogType.SUBSCRIBE, \"Billing response item not owned\", false, null, null);\n }\n }\n }\n } catch (RemoteException | IntentSender.SendIntentException e) {\n //Log.e(TAG, \"Failed to purchase item with sku: \"\n// + skuToPurchase\n// + e.getMessage());\n }\n } else if (!TextUtils.isEmpty(getRestoreSubscriptionReceipt())) {\n //Log.d(TAG, \"Finalizing subscription after signup - existing subscription: \" +\n// getRestoreSubscriptionReceipt());\n try {\n InAppPurchaseData inAppPurchaseData = gson.fromJson(getRestoreSubscriptionReceipt(),\n InAppPurchaseData.class);\n skuToPurchase = inAppPurchaseData.getProductId();\n finalizeSignupAfterSubscription(getRestoreSubscriptionReceipt());\n } catch (Exception e) {\n //Log.e(TAG, \"Could not parse InApp Purchase Data: \" + getRestoreSubscriptionReceipt());\n }\n } else {\n //Log.e(TAG, \"InAppBillingService: \" + inAppBillingService);\n }\n }\n // setSelectedSubscriptionPlan(false);\n }", "@Override\n\t\t\tpublic void mainBuyPro() {\n\t\t\t\tif (iap_is_ok && mHelper != null) {\n\t\t\t\t\t\n\t\t\t\t\t String payload = \"\";\n\t\t\t\t\t mHelper.launchPurchaseFlow(MainActivity.this, Paid_Id_VF, RC_REQUEST, mPurchaseFinishedListener);\n\t\t\t\t}else{\n\t\t\t\t}\n\t\t\t}", "public static WebElement btn_PAEnhancedEntrance_ClickSubscribe() throws Exception{\r\n \ttry{\r\n \t\tWebDriverWait waits = new WebDriverWait(driver, 15);\r\n \t//\twaits.until(ExpectedConditions.visibilityOfElementLocated(By.id(\"subscribeSubmit\")));\r\n \t//\twaits.until(ExpectedConditions.elementToBeClickable(By.id(\"subscribeSubmit\")));\r\n \t\twaits.until(ExpectedConditions.invisibilityOfElementLocated(By.id(\"GS_quotBoxPop\")));\r\n \t\t\r\n \t\telement = driver.findElement(By.id(\"subscribeSubmit\"));\r\n \t\tAdd_Log.info(\"PA Enhanced Entrance Subscribe button is click on the page.\");\r\n \t\t\r\n \t}catch(Exception e){\r\n \t\tAdd_Log.error(\"PA Enhanced Entrance Subscribe button is NOT found on the page.\");\r\n \t\tthrow(e);\r\n \t}\r\n \treturn element;\r\n }", "public void startPurchaseFlow(String skuId, String billingType) {\n }", "public void clickOnPrescriptionStatus() {\n\t\trefreshPage();\n\t\twait.waitForElementToBeVisible(element(\"link_presStatus\"));\n\t\texecuteJavascript(\"document.getElementById('doctor-prescriptions').click();\");\n\t\tlogMessage(\"User clicks on Rx Status on left navigation bar at Physician End\");\n\t}", "private void initiateCCAvenuePurchase() {\n try {\n String strAmount = Double.toString(planToPurchaseDiscountedPrice);\n Intent intent = new Intent(currentActivity, EnterMobileNumberActivity.class);\n //Intent intent = new Intent(currentActivity, WebViewActivity.class);\n //Intent intent = new Intent(currentActivity, PaymentOptionsActivity.class);\n intent.putExtra(AvenuesParams.CURRENCY, currencyCode);\n intent.putExtra(AvenuesParams.AMOUNT, strAmount);\n intent.putExtra(currentActivity.getString(R.string.app_cms_site_name), appCMSSite.getGist().getSiteInternalName());\n intent.putExtra(currentActivity.getString(R.string.app_cms_user_id), getLoggedInUser());\n intent.putExtra(currentActivity.getString(R.string.app_cms_plan_id), planToPurchase);\n intent.putExtra(\"plan_to_purchase_name\", planToPurchaseName);\n intent.putExtra(\"siteId\", appCMSSite.getGist().getSiteInternalName());\n intent.putExtra(\"email\", getLoggedInUserEmail());\n intent.putExtra(\"authorizedUserName\", getLoggedInUser());\n intent.putExtra(\"x-api-token\", apikey);\n intent.putExtra(\"auth_token\", getAuthToken());\n intent.putExtra(\"renewable\", isRenewable);\n intent.putExtra(\"mobile_number\", \"\");\n intent.putExtra(\"api_base_url\", appCMSMain.getApiBaseUrl());\n intent.putExtra(\"si_frequency\", \"2\");\n intent.putExtra(\"si_frequency_type\", renewableFrequency);\n intent.putExtra(\"color_theme\", getAppCMSMain().getBrand().getCta().getPrimary().getBackgroundColor());\n currentActivity.startActivity(intent);\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }", "public void setPrescriptions(String prescriptions) {\r\n\t\tthis.prescriptions = prescriptions;\r\n\t}", "public void subscribeNewsLetter()\n\t{\n\t\trefApplicationGenericUtils.checkForElement(objectRepository.get(\"TaxonomyPage.SubscribeNewsLetter\"), \"SubscribeNewsLetter\");\n\t\t\n\t\t\n\t\t//scroll till the new letter section\n\t\trefApplicationGenericUtils.scrollToViewElement(objectRepository.get(\"TaxonomyPage.SubscribeNewsLetter\"), \"SubscribeNewsLetter\");\n\t\t\n\t\t\n\t\t//Click on the subscribe\n\t\t\n\t\t\n\t}", "public void finalizeSignupAfterCCAvenueSubscription(Intent data) {\n\n if (entitlementPendingVideoData != null) {\n isVideoPlayerStarted = false;\n sendRefreshPageAction();\n sendCloseOthersAction(null, true, false);\n launchButtonSelectedAction(entitlementPendingVideoData.pagePath,\n entitlementPendingVideoData.action,\n entitlementPendingVideoData.filmTitle,\n entitlementPendingVideoData.extraData,\n entitlementPendingVideoData.contentDatum,\n entitlementPendingVideoData.closeLauncher,\n entitlementPendingVideoData.currentlyPlayingIndex,\n entitlementPendingVideoData.relateVideoIds);\n if (entitlementPendingVideoData != null) {\n entitlementPendingVideoData.pagePath = null;\n entitlementPendingVideoData.action = null;\n entitlementPendingVideoData.filmTitle = null;\n entitlementPendingVideoData.extraData = null;\n entitlementPendingVideoData.contentDatum = null;\n entitlementPendingVideoData.closeLauncher = false;\n entitlementPendingVideoData.currentlyPlayingIndex = -1;\n entitlementPendingVideoData.relateVideoIds = null;\n }\n } else {\n sendCloseOthersAction(null, true, false);\n cancelInternalEvents();\n restartInternalEvents();\n\n if (TextUtils.isEmpty(getUserDownloadQualityPref())) {\n setUserDownloadQualityPref(currentActivity.getString(R.string.app_cms_default_download_quality));\n }\n\n NavigationPrimary homePageNavItem = findHomePageNavItem();\n if (homePageNavItem != null) {\n cancelInternalEvents();\n navigateToPage(homePageNavItem.getPageId(),\n homePageNavItem.getTitle(),\n homePageNavItem.getUrl(),\n false,\n true,\n false,\n true,\n true,\n deeplinkSearchQuery);\n }\n }\n\n setIsUserSubscribed(true);\n setActiveSubscriptionId(planToPurchase);\n setActiveSubscriptionCurrency(currencyOfPlanToPurchase);\n setActiveSubscriptionPlanName(planToPurchaseName);\n setActiveSubscriptionPrice(String.valueOf(planToPurchasePrice));\n setActiveSubscriptionProcessor(currentActivity.getString(R.string.subscription_ccavenue_payment_processor_friendly));\n refreshSubscriptionData(null, true);\n }", "public void Admin_Configuration_EmailSubscriptions()\n\t{\n\t\tAdmin_Configuration_EmailSubscriptions.click();\n\t}", "void purchaseMade();", "private void subscribeShortLink() {\n mProductDetailsViewModel.getShortLink().observe(this, shortLink -> {\n Intent intent = new Intent(Intent.ACTION_SEND);\n intent.setType(TEXT_PLAIN);\n intent.putExtra(Intent.EXTRA_SUBJECT, getResources().getString(R.string.app_name));\n intent.putExtra(Intent.EXTRA_TEXT, shortLink.toString());\n startActivity(intent);\n });\n }", "public void continue_billing() {\r\n\t\t\tthis.Continue_Billing.click();\r\n\t\t}", "@Override\n public void onClick(View v) {\n Intent intent = new Intent(AddMemberActivity.this, IndividualSubscription.class);\n if (initial_intent.getParcelableExtra(\"sub_parcel\") != null) {\n SubscriptionParcel sub_parcel = initial_intent.getParcelableExtra(\"sub_parcel\");\n intent.putExtra(\"sub_parcel\", sub_parcel);\n }\n startActivity(intent);\n }", "public void onUpgradeAppButtonClicked(View arg0) {\n\t\tLog.d(TAG,\n\t\t\t\t\"Upgrade button clicked; launching purchase flow for upgrade.\");\n\t\tsetWaitScreen(true);\n\n\t\t/*\n\t\t * TODO: for security, generate your payload here for verification. See\n\t\t * the comments on verifyDeveloperPayload() for more info. Since this is\n\t\t * a SAMPLE, we just use an empty string, but on a production app you\n\t\t * should carefully generate this.\n\t\t */\n//\t\tString payload = \"\";\n\n//\t\tmHelper.launchPurchaseFlow(GameRenderer.mStart, SKU_10000, RC_REQUEST,\n//\t\t\t\tmPurchaseFinishedListener, payload);\n\t}", "public void setCurrentUserPremium() {\n\t\tcurrentUser.setPremium(true);\n\t\tuserCatalog.modifyUser(currentUser);\n\t}", "public /* synthetic */ void m67165a(LiteratureSubscribe literatureSubscribe, BaseSubscribe baseSubscribe, View view) {\n if (literatureSubscribe.hasComment) {\n KmRouterUtils.m57480a(mo84913v(), baseSubscribe.skuId);\n return;\n }\n KmRouterUtils.m57481a(mo84913v(), baseSubscribe.skuId, \"\");\n RxBus.m86979a().mo84367a(new PurchasedItemReviewButtonClickedEvent(getAdapterPosition()));\n }", "@Override\n public void onClick(View v) {\n Intent intent = new Intent(AddMemberActivity.this, Subscriptions.class);\n if (initial_intent.getParcelableExtra(\"sub_parcel\") != null) {\n SubscriptionParcel sub_parcel = initial_intent.getParcelableExtra(\"sub_parcel\");\n intent.putExtra(\"sub_parcel\", sub_parcel);\n }\n startActivity(intent);\n }", "@Override\n public void onClick(View v) {\n Intent intent = new Intent(AddMemberActivity.this, Subscriptions.class);\n if (initial_intent.getParcelableExtra(\"sub_parcel\") != null) {\n SubscriptionParcel sub_parcel = initial_intent.getParcelableExtra(\"sub_parcel\");\n intent.putExtra(\"sub_parcel\", sub_parcel);\n }\n startActivity(intent);\n }", "public static WebElement btn_clickRecommendEmagSubs() throws Exception{\r\n \ttry{\r\n \t\telement = driver.findElement(By.xpath(\"//*[@id='RecomEMagSubButton']/a\"));\r\n \t\tAdd_Log.info(\"Subscribe button is click on the page.\");\r\n \t\t\r\n \t}catch(Exception e){\r\n \t\tAdd_Log.error(\"Subscribe button is NOT found on the page.\");\r\n \t\tthrow(e);\r\n \t}\r\n \treturn element;\r\n }", "public void onBuyGoldButtonClicked(View arg0) {\n\t\tLog.d(TAG, \"Buy gas button clicked.\");\n\n\t\t// if (mSubscribedToInfiniteGas) {\n\t\t// complain(\"No need! You're subscribed to infinite gas. Isn't that awesome?\");\n\t\t// return;\n\t\t// }\n\t\t//\n\t\t// if (mTank >= TANK_MAX) {\n\t\t// complain(\"Your tank is full. Drive around a bit!\");\n\t\t// return;\n\t\t// }\n\n\t\t// launch the gas purchase UI flow.\n\t\t// We will be notified of completion via mPurchaseFinishedListener\n\t\tsetWaitScreen(true);\n\t\tLog.d(TAG, \"Launching purchase flow for gas.\");\n\n\t\t/*\n\t\t * TODO: for security, generate your payload here for verification. See\n\t\t * the comments on verifyDeveloperPayload() for more info. Since this is\n\t\t * a SAMPLE, we just use an empty string, but on a production app you\n\t\t * should carefully generate this.\n\t\t */\n//\t\tString payload = \"\";\n\n//\t\tmHelper.launchPurchaseFlow(GameRenderer.mStart, SKU_350000, RC_REQUEST,mPurchaseFinishedListener, payload);\n\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tClickQuickCoupler();\n\t\t\t}", "public KPAUISignOnFccPage clickRefillPrescriptionLink(){\n getRefillPrescriptionLink().click();\n return new KPAUISignOnFccPage(driver);\n }", "public void subscribe() {\n Fitness.getRecordingClient(this, GoogleSignIn.getLastSignedInAccount(this))\r\n .subscribe(DataType.TYPE_STEP_COUNT_CUMULATIVE)\r\n .addOnCompleteListener(\r\n new OnCompleteListener<Void>() {\r\n @Override\r\n public void onComplete(@NonNull Task<Void> task) {\r\n if (task.isSuccessful()) {\r\n Log.i(TAGFit, \"Successfully subscribed!\");\r\n } else {\r\n Log.w(TAGFit, \"There was a problem subscribing.\", task.getException());\r\n }\r\n }\r\n });\r\n }", "public void setPremium(Boolean premium) {\n\t\tthis.premium = premium;\n\t}", "@Override\n public void onClick(View v) {\n Intent intent = new Intent(AddMemberActivity.this, CommunityBoardMain.class);\n if (initial_intent.getParcelableExtra(\"sub_parcel\") != null) {\n SubscriptionParcel sub_parcel = initial_intent.getParcelableExtra(\"sub_parcel\");\n intent.putExtra(\"sub_parcel\", sub_parcel);\n }\n startActivity(intent);\n }", "public void makePurchaseButton() {\r\n JButton purchase = new JButton(\"Purchase premium currency\");\r\n new Button(purchase, main);\r\n// purchase.setAlignmentX(Component.LEFT_ALIGNMENT);\r\n// purchase.setPreferredSize(new Dimension(2500, 100));\r\n// purchase.setFont(new Font(\"Arial\", Font.PLAIN, 40));\r\n purchase.addActionListener(new ActionListener() {\r\n @Override\r\n public void actionPerformed(ActionEvent e) {\r\n doBuyRiotPoints();\r\n }\r\n });\r\n// main.add(purchase);\r\n }", "public String subscribe() throws SaaSApplicationException,\n IllegalArgumentException, IOException {\n\n String subscriptionId = model.getSubscription().getSubscriptionId();\n SubscriptionStatus status;\n String outcome = null;\n if (!isServiceAccessible(model.getService().getKey())) {\n redirectToAccessDeniedPage();\n return BaseBean.MARKETPLACE_ACCESS_DENY_PAGE;\n }\n try {\n rewriteParametersAndUdas();\n VOSubscription rc = getSubscriptionService().subscribeToService(\n model.getSubscription(), model.getService().getVO(),\n Collections.emptyList(),\n model.getSelectedPaymentInfo(),\n model.getSelectedBillingContact(),\n subscriptionsHelper.getVoUdaFromUdaRows(\n getModel().getSubscriptionUdaRows()));\n model.setDirty(false);\n menuBean.resetMenuVisibility();\n if (rc == null) {\n ui.handleProgress();\n outcome = OUTCOME_PROCESS;\n } else {\n status = rc.getStatus();\n getSessionBean()\n .setSelectedSubscriptionId(rc.getSubscriptionId());\n getSessionBean().setSelectedSubscriptionKey(rc.getKey());\n\n ui.handle(\n status.isPending() ? INFO_SUBSCRIPTION_ASYNC_CREATED\n : INFO_SUBSCRIPTION_CREATED,\n subscriptionId, rc.getSuccessInfo());\n\n // help the navigation to highlight the correct navigation item\n menuBean.setCurrentPageLink(MenuBean.LINK_SUBSCRIPTION_USERS);\n\n outcome = OUTCOME_SUCCESS;\n }\n\n conversation.end();\n\n } catch (NonUniqueBusinessKeyException e) {\n // if subscription name already existed redirect to page\n // confirmation with error message\n ui.handleError(null, SUBSCRIPTION_NAME_ALREADY_EXISTS,\n new Object[] { subscriptionId });\n outcome = SUBSCRIPTION_CONFIRMATION_PAGE;\n } catch (ObjectNotFoundException e) {\n // if service has been deleted in the meantime, give the\n // inaccessible error message\n if (e.getDomainObjectClassEnum()\n .equals(DomainObjectException.ClassEnum.SERVICE)) {\n ui.handleError(null, ERROR_SERVICE_INACCESSIBLE);\n } else {\n ConcurrentModificationException ex = new ConcurrentModificationException();\n ex.setMessageKey(ERROR_SERVICE_CHANGED);\n ExceptionHandler.execute(ex);\n }\n }\n\n return outcome;\n }", "private void payButtonClicked() {\n if (checkBoxAgreedTAC.isChecked()) {\n boolean validCard = validateCard();\n if (validCard) {\n Double payAmount = Double.parseDouble(textViewPrepaidPrice.getText().toString());\n MainActivity.bus.post(new PrepayPaymentAttemptEvent(payAmount, Long.parseLong(litersToBuy.getText().toString())));\n if (PrepayCalculatorFragment.this.payDialog != null) {\n PrepayCalculatorFragment.this.payDialog.dismiss();\n }\n }\n } else {\n Toast.makeText(getActivity(), getResources().getString(R.string.TACMustAgreedMessage), Toast.LENGTH_SHORT).show();\n }\n\n }", "void askBuyResources();", "public Premium() {\r\n\t\titemName = \"Premium\";\r\n\t\titemPrice = 100;\r\n\t\tcount = 10;\r\n\t}", "private void Inscrire() {\n\t\t\r\n\t\tSystem.out.println(\"inscription\");\r\n }", "@Override\n\tprotected void onCancelRequestPurchase() {\n\t\tmTxtStatus.setText(\"requestPurchase onCancel\");\n\t}", "public void clickOnProceedToCheckoutButton()\n \t{\n \t\tproductRequirementsPageLocators.clickOnProceedToCheckoutButton.click();\n\n \t}", "public void onBuyGasButtonClicked(View arg0) {\n\t\tLog.d(TAG, \"Buy gas button clicked.\");\n\t\t// if (mSubscribedToInfiniteGas) {\n\t\t// complain(\"No need! You're subscribed to infinite gas. Isn't that awesome?\");\n\t\t// return;\n\t\t// }\n\t\t// if (mTank >= TANK_MAX) {\n\t\t// complain(\"Your tank is full. Drive around a bit!\");\n\t\t// return;\n\t\t// }\n\t\t// launch the gas purchase UI flow.\n\t\t// We will be notified of completion via mPurchaseFinishedListener\n\t\tsetWaitScreen(true);\n\t\tLog.d(TAG, \"Launching purchase flow for gas.\");\n\t\t/*\n\t\t * TODO: for security, generate your payload here for verification. See\n\t\t * the comments on verifyDeveloperPayload() for more info. Since this is\n\t\t * a SAMPLE, we just use an empty string, but on a production app you\n\t\t * should carefully generate this.\n\t\t */\n//\t\tString payload = \"\";\n//\t\tmHelper.launchPurchaseFlow(GameRenderer.mStart, SKU_150000, RC_REQUEST,mPurchaseFinishedListener, payload);\n\t}", "@Override\n\tpublic String getOffer() {\n\t\treturn \"Get 10% of on your next purchase\";\n\t}", "public void showCreditsButton()\r\n {\r\n Message message = new Message();\r\n message.what = GUIManager.SHOW_CREDITS_BUTTON;\r\n mGUIManager.sendThreadSafeGUIMessage(message);\r\n }", "private void prescribeActionPerformed(java.awt.event.ActionEvent evt) {\n String docname=name.getText();\n String info=profileInfo.getText();\n String email=profileEmail.getText();\n String no=profileContact.getText();\n new PrescriptionFrame(docname,info,email,no).setVisible(true);\n this.setVisible(false);\n }", "public void PurchaseTicket_OnClick(View view){\n\t\tVibrateButton();\n\t\tpurchaseTicket();\n\t}", "public void clickOnContinueShoppingButton()\n \t{\n \t\tproductRequirementsPageLocators.clickOnContinueShoppingButton.click();\n\n \t}", "public void startNewPurchase() throws VerificationFailedException {\n\t}", "public void startNewPurchase() throws VerificationFailedException {\n\t}", "@When ( \"I navigate to the Assign Prescription page\" )\r\n public void navigatePrescriptionOV () {\r\n ( (JavascriptExecutor) driver ).executeScript( \"document.getElementById('assignprescription').click();\" );\r\n }", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tLog.d(TAG, \"[VIEW PRODUCTS OF SUBCRIBE]\");\r\n\t\t\t\t\r\n\t\t\t\tProductsListOfSubcribeActivity.subcribe = item;\r\n\t\t\t\t\r\n\t\t\t\tIntent intent = new Intent(getContext(), ProductsListOfSubcribeActivity.class);\r\n\t\t\t\tintent.putExtra(Global.SUBCRIBE_ID, item.id);\r\n\t\t\t\tgetContext().startActivity(intent);\r\n\t\t\t}", "@Override\n protected void onSuccessRequestPurchase(PurchaseResult result) {\n \tmTxtStatus.setText(\"requestPurchase onSuccess: \"+result.getProductIdentifier());\n\t}", "public org.csapi.schema.parlayx.subscribe.manage.v1_0.local.SubscribeProductResponse subscribeProduct(org.csapi.schema.parlayx.subscribe.manage.v1_0.local.SubscribeProductRequest parameters) {\n throw new UnsupportedOperationException(\"Not implemented yet.\");\r\n }", "private void sendFirebaseLoginSubscribeSuccess() {\n String SUBSCRIPTION_SUBSCRIBED = \"subscribed\";\n mFireBaseAnalytics.setUserProperty(SUBSCRIPTION_STATUS_KEY, SUBSCRIPTION_SUBSCRIBED);\n mFireBaseAnalytics.setUserProperty(LOGIN_STATUS_KEY, LOGIN_STATUS_LOGGED_IN);\n mFireBaseAnalytics.setUserProperty(SUBSCRIPTION_PLAN_ID, getActiveSubscriptionId());\n mFireBaseAnalytics.setUserProperty(SUBSCRIPTION_PLAN_NAME, getActiveSubscriptionPlanName());\n }", "private void subscribeBackButton() {\n mProductDetailsViewModel.onClick().observe(this, result -> {\n switch (result) {\n case CROSS_ICON:\n finish();\n break;\n case OPEN_LOGIN:\n startActivity(new Intent(this, EcomLoginActivity.class));\n break;\n case SIZE_CHART:\n startWebViewAct();\n break;\n case SELLER_INFORMATION:\n break;\n case GOTO_CART:\n startGoToCartAct();\n break;\n case RATING_AND_REVIEWS:\n mBinding.nsPdp.smoothScrollTo(ZERO, (int) mBinding.tvPdpRateOption.getY() - FIFTY);\n break;\n case MORE:\n moreIndex += ONE;\n setLinesCount(mDescription, TRUE);\n break;\n case LOGIN:\n startBoardingAct();\n break;\n case OPEN_SHEET:\n onVariantClick(mVariantsData, mUnitId);\n break;\n }\n });\n }", "@Override\r\n\tpublic void paidBehavior() {\n\t\tSystem.out.println(\"You paid using your Vias card\");\r\n\t\t\r\n\t}", "public void startPayment() {\r\n final Activity activity = this;\r\n\r\n final Checkout co = new Checkout();\r\n\r\n try {\r\n JSONObject options = new JSONObject();\r\n options.put(\"name\", \"Farm2Home\");\r\n options.put(\"description\", \"Consumption charges\");\r\n //You can omit the image option to fetch the image from dashboard\r\n // options.put(\"image\", \"https://rzp-mobile.s3.amazonaws.com/images/rzp.png\");\r\n options.put(\"currency\", \"INR\");\r\n options.put(\"amount\", \"500\");\r\n\r\n // JSONObject preFill = new JSONObject();\r\n // preFill.put(\"email\", \"[email protected]\");\r\n // preFill.put(\"contact\", \"9876543210\");\r\n\r\n // options.put(\"prefill\", preFill);\r\n\r\n co.open(activity, options);\r\n } catch (Exception e) {\r\n Toast.makeText(activity, \"Error in payment: \" + e.getMessage(), Toast.LENGTH_SHORT)\r\n .show();\r\n e.printStackTrace();\r\n }\r\n }", "public void purchaseCart (View view) {\n Utility.showMyToast(\"Purchasing now!\", this);\n\n // Also send an Analytics hit\n sendPurchaseHit();\n }", "void askBuyDevCards();", "private void initiateRiotPointsPurchaseEnter(JFrame frame, JTextField account, JTextField name) {\r\n JButton enter = new JButton(\"Confirm\");\r\n new Confirm(enter);\r\n// enter.setPreferredSize(new Dimension(100, 100));\r\n// enter.setFont(new Font(\"Arial\", Font.PLAIN, 20));\r\n enter.addActionListener(new ActionListener() {\r\n @Override\r\n public void actionPerformed(ActionEvent actionEvent) {\r\n try {\r\n String nameText = name.getText();\r\n displayMessage(runRiotPointsPurchase(selectLeagueOfLegendsAccount(account.getText()), nameText));\r\n runRiotPointsPurchase2(nameText);\r\n } catch (PurchaseFail e) {\r\n displayMessage(\"Champion not purchased, invalid input\");\r\n }\r\n frame.setVisible(false);\r\n }\r\n });\r\n frame.add(enter);\r\n }", "public void acceptAndProceed()\r\n {\r\n\t driver.findElement(By.id(\"PCNChecked\")).click();\r\n\t driver.findElement(By.xpath(\"/html/body/div[1]/div/div/main/div/main/div/div/div[1]/div/div/form/fieldset/div[3]/div[2]/button\")).click();\r\n }", "private void forwardToCreateDemands() {\n Timer additionalAction = new Timer() {\n @Override\n public void run() {\n eventBus.goToCreateDemandModule();\n }\n };\n if (displayThankYouPopup) {\n eventBus.showThankYouPopup(\n Storage.MSGS.thankYouCodeActivatedToDemandCreation(), additionalAction);\n } else {\n eventBus.goToCreateDemandModule();\n }\n }", "public void clickbtnApprove() {\n\t\twaitForElementClickable(10,btnApprove);\n\t\tclickByJavaScript(btnApprove);\n\t\tsleep(1);\n\t}", "public Boolean isPremium() {\n return this.isPremium;\n }", "@Override\n\tpublic void onClick(View v) {\n\t\tswitch (v.getId()) {\n\t\tcase R.id.ibs_button_upgrade:\n\t\t\tif (mUpgradeBillingManager == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!mUpgradeBillingManager.doesDeviceSupportSubscriptions()) {\n\t\t\t\tUtility.toastMessage(getActivity(), getString(R.string.ibs_error_billing_doesNotSupportSubscriptions));\n\t\t\t\t\n\t\t\t} else if (mBillingStateGood) {\n\t\t\t\ttry {\n\t\t\t\t\tmUpgradeBillingManager.purchaseUpgrade(REQUEST_UPGRADE_PURCHASE);\n\t\t\t\t} catch (IllegalStateException e) {\n\t\t\t\t\tLog.w(CLASS_NAME, \"Upgrade purchase click cancelled: \" + e);\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\tbreak;\n\t\t}\n\t}", "public Boolean isPremium() {\n return this.isPremium;\n }", "@Override\n\t\t\tpublic boolean onPreferenceClick(Preference arg0) {\n\n\t\t\t\tbuy(SKU_VITAMIN);\n\t\t\t\treturn true;\n\t\t\t}", "@Override\r\n public void onCompleted() {\n Log.i(TAG, \"subscribed to buyable items\");\r\n }", "public void onShowLicences();", "@When(\"user clicks on checkoutbutton\")\r\n\tpublic void usert_clicks_on_checkoutbutton() {\n\t\tdriver.findElement(By.xpath(\"//*[@id=\\\"cart\\\"]/tfoot/tr[2]/td[5]/a\")).click();\r\n\t}", "public void clickBuy(ExtentTest extentReport) throws Exception {\n\t\ttry {\n\t\t\tbtnBuy.click();\n\t\t\tLog.message(\"Clicked on Buy button\", driver, extentReport);\n\t\t\tWaitUtils.waitForSpinner(driver);\n\t\t} catch (Exception e) {\n\t\t\tthrow new Exception(\"Unable to Click on Buy Button - Premium values could be zero :\" + e);\n\t\t}\n\t}", "public void showUpgradeButton(String cost)\r\n {\r\n \tmGUIManager.newCost(\"Upgrade Tower \" + cost + \" ZP\");\r\n Message message = new Message();\r\n message.what = GUIManager.SHOW_UPGRADE_BUTTON;\r\n mGUIManager.sendThreadSafeGUIMessage(message);\r\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tonInappBilling();\n//\t\t\t\tonBuyPressed();\n\t\t\t}", "public void onPayClick(){\n this.user.updateCreditDec(priceToBePaid);\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\n alert.setTitle(\"Information Dialog\");\n alert.setHeaderText(null);\n alert.setContentText(\"Payment successful! You payed \" + cost.getText());\n alert.showAndWait();\n }", "public abstract void setIncSubscribePolicy(SubscribePolicy paramSubscribePolicy);", "@Override\r\n\t\t\tpublic void startLicense(long nonce) throws RemoteException {\n\r\n\t\t\t BillingService mBillingService = new BillingService();\r\n\t\t mBillingService.setContext(CheckDonation.this);\r\n\r\n\t\t // Check if billing is supported.\r\n\t\t if (mBillingService.checkBillingSupported()) {\r\n\t\t mBillingService.restoreTransactions();\r\n\t\t }\r\n\t\t mBillingService.unbind();\r\n\t\t\t}", "public void startPayment() {\n double ruppes = Double.parseDouble(price);\n final Activity activity = this;\n final Checkout co = new Checkout();\n try {\n JSONObject options = new JSONObject();\n options.put(\"name\", getResources().getString(R.string.application_name));\n options.put(\"description\", \"\");\n //You can omit the image option to fetch the image from dashboard\n options.put(\"image\", getResources().getDrawable(R.mipmap.ic_app_logo));\n options.put(\"currency\", \"INR\");\n options.put(\"amount\", ruppes * 100);\n JSONObject preFill = new JSONObject();\n preFill.put(\"email\", \"[email protected]\");\n preFill.put(\"contact\", \"8758689113\");\n options.put(\"prefill\", preFill);\n co.open(activity, options);\n } catch (Exception e) {\n Toast.makeText(activity, \"Error in payment: \" + e.getMessage(), Toast.LENGTH_SHORT)\n .show();\n e.printStackTrace();\n }\n }", "public static WebElement lnk_clickSubscribeNow() throws Exception{\r\n \ttry{\r\n \t\telement = driver.findElement(By.xpath(\"//Strong[text()='Subscribe now']\"));\r\n \t\tAdd_Log.info(\"Subscribe now hyperlink is click on the page.\");\r\n \t\t\r\n \t}catch(Exception e){\r\n \t\tAdd_Log.error(\"Subscribe now hyperlink is NOT found on the page.\");\r\n \t\tthrow(e);\r\n \t}\r\n \treturn element;\r\n }", "private void startRateProductAct() {\n Intent intent = new Intent(this, ReviewProductActivity.class);\n intent.putExtra(PRODUCT_IMAGE, mProductDetailsViewModel.mPrimaryImage);\n intent.putExtra(PRODUCT_COLOUR, mProductDetailsViewModel.mColor);\n intent.putExtra(PRODUCT_NAME, mBinding.tvPdpProductName.getText().toString());\n intent.putExtra(PRICE, mBinding.tvPdpProductPrice.getText().toString());\n intent.putExtra(PARENT_PRODUCT_ID, mParentProductId);\n intent.putExtra(PRODUCT_ID, mProductId);\n startActivity(intent);\n }", "public void onBuyPressed() {\n PayPalPayment payment = new PayPalPayment(new BigDecimal(String.valueOf(totalAmount)), \"USD\", \"Total Price\",\n PayPalPayment.PAYMENT_INTENT_SALE);\n\n Intent intent = new Intent(this, PaymentActivity.class);\n\n // send the same configuration for restart resiliency\n intent.putExtra(PayPalService.EXTRA_PAYPAL_CONFIGURATION, config);\n\n intent.putExtra(PaymentActivity.EXTRA_PAYMENT, payment);\n\n startActivityForResult(intent, 0);\n }", "public void launchSubPart3(View view) {\n Intent inscrPart3 = new Intent(getApplicationContext(), subscription_part3_Activity.class);\n inscrPart3.putExtra(\"User\", user);\n startActivity(inscrPart3);\n finish();\n\n }", "private void viewPurchases(User user, Scanner sc) {\n\n\t\tboolean run = true;\n\t\tdo {\n\t\t\tlog.info(\"The Following are your Purchases\\n\");\n\t\t\tList<Item> purchased = cService.seeOwnedItems(user);\n\t\t\tpurchased.stream().forEach(item -> log.info(item.toString()));\n\n\t\t\tlog.info(\"Choose an option:\");\n\t\t\tlog.info(\"\t\tPress anything else to exit\");\n\t\t\tString choice = sc.nextLine();\n\t\t\tswitch (choice) {\n\t\t\tdefault:\n\t\t\t\tlog.info(\"\\nGoing back to the Customer Dashboard\\n\");\n\t\t\t\trun = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} while (run);\n\t}", "public void ClickPlansOfferedPage() {\r\n\t\tplansoffered.click();\r\n\t\t\tLog(\"Clicked the \\\"Plans Offered\\\" button on the Birthdays page\");\r\n\t}", "public void purchaseFlights()\r\n\t{\n\t\tdriver.findElement(By.xpath(trObj.PURCHASEFLISGHTS)).click();\r\n\r\n\t}", "public void purchase() {\r\n\t\tdo {\r\n\t\t\tString id = getToken(\"Enter customer id: \");\r\n\t\t\tString brand = getToken(\"Enter washer brand: \");\r\n\t\t\tString model = getToken(\"Enter washer model: \");\r\n\t\t\tint quantity = getInteger(\"Enter quantity to purchase: \");\r\n\t\t\tboolean purchased = store.purchaseWasher(id, brand, model, quantity);\r\n\t\t\tif (purchased) {\r\n\t\t\t\tSystem.out.println(\"Purchased \" + quantity + \" of \" + brand + \" \" + model + \" for customer \" + id);\r\n\t\t\t} else {\r\n\t\t\t\tSystem.out.println(\"Purchase unsuccessful.\");\r\n\t\t\t}\r\n\t\t} while (yesOrNo(\"Make another Purchase?\"));\r\n\t}", "@When(\"I click on the buy button\")\n\t\tpublic void i_click_on_the_buy_button() {\n\t\t\tdriver.findElement(By.xpath(buttonBuy)).click();\n\t\t}", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t\tIntent intent = getIntent();\n\t\tif (intent != null) {\n\t\t\tif (action == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (action.equals(ACTION_NEWS)) {\n\n\t\t\t} else if (action.equals(ACTION_FORM)) {\n\t\t\t\tintent.setClass(this, BalanceActivity.class);\n\t\t\t\tintent.putExtra(BalanceActivity.META_TYPE, id);\n\t\t\t\tintent.setAction(BalanceActivity.ACTION_PUSH);\n\t\t\t\tstartActivity(intent);\n\t\t\t}\n\t\t}\n\t\tfinish();\n\t}", "@Override\n\tprotected String showConfirmation() {\n\t\treturn \"Payment is successful. Check your credit card statement for PetSitters, Inc.\";\n\t}", "public void checkForExistingSubscription(boolean showErrorDialogIfSubscriptionExists) {\n if (currentActivity != null) {\n Bundle activeSubs;\n try {\n if (inAppBillingService != null) {\n //Log.d(TAG, \"InApp Billing Service is non-null\");\n\n //Log.d(TAG, \"Retrieving purchase data\");\n\n activeSubs = inAppBillingService.getPurchases(3,\n currentActivity.getPackageName(),\n \"subs\",\n null);\n ArrayList<String> subscribedItemList = activeSubs.getStringArrayList(\"INAPP_PURCHASE_DATA_LIST\");\n\n if (subscribedItemList != null && !subscribedItemList.isEmpty()) {\n boolean subscriptionExpired = true;\n for (int i = 0; i < subscribedItemList.size(); i++) {\n try {\n //Log.d(TAG, \"Examining existing subscription data\");\n InAppPurchaseData inAppPurchaseData = gson.fromJson(subscribedItemList.get(i),\n InAppPurchaseData.class);\n\n ArrayList<String> skuList = new ArrayList<>();\n skuList.add(inAppPurchaseData.getProductId());\n Bundle skuListBundle = new Bundle();\n skuListBundle.putStringArrayList(\"ITEM_ID_LIST\", skuList);\n Bundle skuListBundleResult = inAppBillingService.getSkuDetails(3,\n currentActivity.getPackageName(),\n \"subs\",\n skuListBundle);\n ArrayList<String> skuDetailsList =\n skuListBundleResult.getStringArrayList(\"DETAILS_LIST\");\n if (skuDetailsList != null && !skuDetailsList.isEmpty()) {\n SkuDetails skuDetails = gson.fromJson(skuDetailsList.get(0),\n SkuDetails.class);\n setExistingGooglePlaySubscriptionDescription(skuDetails.getTitle());\n\n setExistingGooglePlaySubscriptionPrice(skuDetails.getPrice());\n\n subscriptionExpired = existingSubscriptionExpired(inAppPurchaseData, skuDetails);\n }\n\n setExistingGooglePlaySubscriptionId(inAppPurchaseData.getProductId());\n\n if (inAppPurchaseData.isAutoRenewing() || !subscriptionExpired) {\n if (TextUtils.isEmpty(skuToPurchase) || skuToPurchase.equals(inAppPurchaseData.getProductId())) {\n setActiveSubscriptionReceipt(subscribedItemList.get(i));\n //Log.d(TAG, \"Restoring purchase for SKU: \" + skuToPurchase);\n } else {\n setActiveSubscriptionReceipt(null);\n if (!TextUtils.isEmpty(skuToPurchase)) {\n //Log.d(TAG, \"Making purchase for another subscription: \" + skuToPurchase);\n }\n }\n //Log.d(TAG, \"Set active subscription: \" + inAppPurchaseData.getProductId());\n\n //Log.d(TAG, \"Making restore purchase call with token: \" + inAppPurchaseData.getPurchaseToken());\n String restorePurchaseUrl = currentContext.getString(R.string.app_cms_restore_purchase_api_url,\n appCMSMain.getApiBaseUrl(),\n appCMSSite.getGist().getSiteInternalName());\n try {\n final String restoreSubscriptionReceipt = subscribedItemList.get(i);\n appCMSRestorePurchaseCall.call(apikey,\n restorePurchaseUrl,\n inAppPurchaseData.getPurchaseToken(),\n appCMSSite.getGist().getSiteInternalName(),\n (signInResponse) -> {\n //Log.d(TAG, \"Retrieved restore purchase call\");\n if (signInResponse == null || !TextUtils.isEmpty(signInResponse.getMessage())) {\n //Log.d(TAG, \"SignIn response is null or error response is non empty\");\n if (!isUserLoggedIn()) {\n if (signInResponse != null) {\n //Log.e(TAG, \"Received restore purchase call error: \" + signInResponse.getMessage());\n }\n if (showErrorDialogIfSubscriptionExists) {\n showEntitlementDialog(DialogType.EXISTING_SUBSCRIPTION,\n () -> {\n setRestoreSubscriptionReceipt(restoreSubscriptionReceipt);\n sendCloseOthersAction(null, true, false);\n launchType = LaunchType.INIT_SIGNUP;\n navigateToLoginPage(loginFromNavPage);\n });\n }\n }\n } else {\n //Log.d(TAG, \"Received a valid signin response\");\n if (isUserLoggedIn()) {\n //Log.d(TAG, \"User is logged in\");\n if (!TextUtils.isEmpty(getLoggedInUser()) &&\n !TextUtils.isEmpty(signInResponse.getUserId()) &&\n signInResponse.getUserId().equals(getLoggedInUser())) {\n //Log.d(TAG, \"User ID: \" + signInResponse.getUserId());\n setRefreshToken(signInResponse.getRefreshToken());\n setAuthToken(signInResponse.getAuthorizationToken());\n setLoggedInUser(signInResponse.getUserId());\n setLoggedInUserName(signInResponse.getName());\n setLoggedInUserEmail(signInResponse.getEmail());\n setIsUserSubscribed(signInResponse.isSubscribed());\n setUserAuthProviderName(signInResponse.getProvider());\n\n refreshSubscriptionData(() -> {\n\n }, true);\n } else if (showErrorDialogIfSubscriptionExists) {\n showEntitlementDialog(DialogType.EXISTING_SUBSCRIPTION_LOGOUT,\n this::logout);\n }\n } else {\n //Log.d(TAG, \"User is logged out\");\n if (showErrorDialogIfSubscriptionExists) {\n setRefreshToken(signInResponse.getRefreshToken());\n setAuthToken(signInResponse.getAuthorizationToken());\n setLoggedInUser(signInResponse.getUserId());\n sendSignInEmailFirebase();\n setLoggedInUserName(signInResponse.getName());\n setLoggedInUserEmail(signInResponse.getEmail());\n setIsUserSubscribed(signInResponse.isSubscribed());\n setUserAuthProviderName(signInResponse.getProvider());\n\n refreshSubscriptionData(() -> {\n\n }, true);\n\n if (showErrorDialogIfSubscriptionExists) {\n finalizeLogin(false,\n signInResponse.isSubscribed(),\n false,\n false);\n }\n }\n }\n }\n });\n } catch (Exception e) {\n //Log.d(TAG, \"Error making restore purchase request: \" + e.getMessage());\n if (showErrorDialogIfSubscriptionExists) {\n showEntitlementDialog(DialogType.EXISTING_SUBSCRIPTION,\n () -> {\n sendCloseOthersAction(null, true, false);\n navigateToLoginPage(loginFromNavPage);\n });\n }\n }\n } else {\n setActiveSubscriptionReceipt(null);\n }\n\n if (subscriptionExpired) {\n sendSubscriptionCancellation();\n }\n\n } catch (Exception e) {\n //Log.e(TAG, \"Error parsing Google Play subscription data: \" + e.toString());\n }\n }\n\n setExistingGooglePlaySubscriptionSuspended(subscriptionExpired);\n }\n }\n } catch (RemoteException e) {\n\n //Log.e(TAG, \"Failed to purchase item with sku: \"\n// + getActiveSubscriptionSku());\n }\n }\n // setSelectedSubscriptionPlan(false);\n }", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t\tMobclickAgent.onResume(this);\n\t\tsetPageStart(\"其他费用\");\n\t}", "@Override\r\n\tpublic void onClick(View arg0) {\n\t\tIntent i = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);\r\n\t\ti.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);\r\n\t\ti.putExtra(RecognizerIntent.EXTRA_PROMPT, \"Please Speak Now !\");\r\n\t\tstartActivityForResult(i, check);\r\n\t}", "void addNewSubscription(Subscription newSubscription);", "public void revenue() {\n\t\t// Revenue Event only requires the Revenue Value to be passed\n AdGyde.onRevenue(5);\n Toast.makeText(this, \"Revenue clicked\", Toast.LENGTH_SHORT).show();\n }", "public void sendStartCheckoutHit() {\n Product product = new Product()\n .setName(\"dinner\")\n .setPrice(5)\n .setVariant(thisDinner)\n .setId(thisDinnerId)\n .setQuantity(1);\n\n ProductAction productAction =\n new ProductAction(ProductAction.ACTION_CHECKOUT);\n\n Tracker tracker = ((MyApplication) getApplication()).getTracker();\n\n tracker.send(new HitBuilders.EventBuilder()\n .setCategory(\"Shopping steps\")\n .setAction(\"Start checkout\")\n .setLabel(thisDinner)\n .addProduct(product)\n .setProductAction(productAction)\n .build());\n }", "private void setClaimButton()\t{\n\t\t\n\t\tif(Integer.parseInt(scanCount) >= Integer.parseInt(maxScans))\t{\n\n\t\t\t/*\tImage*/Button ib = (/*Image*/Button) findViewById(R.id.ibClaim);\n\t\t\tib.setVisibility(View.VISIBLE);\n\t\t\t/*\tib.setPadding(0, 0, 0, 0);*/\n\t\t\tib.setLayoutParams(new LinearLayout.LayoutParams((int) (width*0.8),(int) (height*0.15)));\n\n\t\t\tib.setOnClickListener(new View.OnClickListener() {\n\n\t\t\t\tpublic void onClick(View arg0) {\n\n\t\t\t\t\tif(getSharedPrefs(\"userDetails\", \"allInfo\", \"\").equals(\"true\"))\t{\n\t\t\t\t\t\t\n\t\t\t\t\tAlertDialog.Builder adb = new AlertDialog.Builder(DisplayActivity.this);\n\t\t\t\t\tadb.setMessage(\"Once you click 'YES', you will have 5 minutes to claim your item from the cashier.\\nAre you by the cashier?\");\n\t\t\t\t\t\n\t\t\t\t\tadb.setPositiveButton(\"YES\", new DialogInterface.OnClickListener() {\n\n\t\t\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\n\t\t\t\t\t\t\tString uuid = getSharedPrefs(\"userDetails\", \"uuid\", \"\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tString url = \"http://www.loyal3.co.za/redeem?uuid=\"+uuid+\"&shop=\"+shopName;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tnew ValidateCounts().execute(url.trim());\n\t\t\t\t\t\t}\n\t\t\t\t\t});\t\n\n\t\t\t\t\t//Neg Button does nothing.\n\t\t\t\t\tadb.setNegativeButton(\"NO\", new DialogInterface.OnClickListener() {\n\t\t\t\t\t\t\n\t\t\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\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\tadb.show();\t\n\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\tToast.makeText(getBaseContext(), \"Please update your information in your Profile Page in order to claim your free item\", Toast.LENGTH_LONG).show();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\t\n\t}", "public void noReceipt() {\n\t\tpause(1000);\n\t\tWebElement temp = (new WebDriverWait(driver, waitTime))\n\t\t\t\t .until(ExpectedConditions.presenceOfElementLocated(By.id(\"salescompleteBtn\")));\n\t\ttemp.click();\n\t}", "public void clickOnEnrollNowButton() {\n\t\tif(enrollNowButton.isEnabled()) {\n\t\twaitAndClick(enrollNowButton);\n\t\t}\n\t}", "public void clickOnAddToCartButton()\n \t{\n \t\tproductRequirementsPageLocators.clickAddToCartButton.click();\n\n \t}", "@Override public void onClick(View arg0) {\n Intent intent = new Intent(OweActivity.this, ReceiveMoneyActivity.class);\n startActivity(intent);\n }", "@Then(\"^product in shown as available\")\n public void clicks_On_Add_Button(){\n }", "public void clickReplenishButton(View view){\r\n if (TextUtils.isEmpty(editTextNumber.getText())){\r\n textView.setText(PUT_MONEY);\r\n }else {\r\n superHero.setAccount(Double.parseDouble(editTextNumber.getText().toString()));\r\n editTextNumber.setText(null);\r\n if (checkBox.isChecked()){\r\n clickUpgradeButton(view);\r\n }\r\n textView.setText(REPLENISH_SUCC + superHero.getAccount());\r\n }\r\n }", "public static WebElement btn_clickEmagSubscribe() throws Exception{\r\n \ttry{\r\n \t\tWebDriverWait waits = new WebDriverWait(driver, 15);\r\n \t\twaits.until(ExpectedConditions.elementToBeClickable(By.xpath(\"//*[@id='EMagSubButton']/a\")));\r\n \t\t\r\n \t\telement = driver.findElement(By.xpath(\"//*[@id='EMagSubButton']/a\"));\r\n \t\tAdd_Log.info(\"User is click on eMag Subscribe button in the eMag cross promotion (centrewell) section.\");\r\n \t\t\r\n \t}catch(Exception e){\r\n \t\tAdd_Log.error(\"eMag Subscribe button is NOT found on the page\");\r\n \t\tthrow(e);\r\n \t}\r\n \treturn element;\r\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tToast.makeText(mContext, \"购物\", Toast.LENGTH_SHORT).show();\n\t\t\t}", "private void initiateBuyRiotPointsEnter(JFrame frame, JTextField account, JTextField amount) {\r\n JButton enter = new JButton(\"Confirm\");\r\n new Confirm(enter);\r\n// enter.setPreferredSize(new Dimension(100, 100));\r\n// enter.setFont(new Font(\"Arial\", Font.PLAIN, 20));\r\n enter.addActionListener(new ActionListener() {\r\n @Override\r\n public void actionPerformed(ActionEvent actionEvent) {\r\n try {\r\n int designated = Integer.parseInt(amount.getText());\r\n selectLeagueOfLegendsAccount(account.getText()).purchasePremium(designated);\r\n displayMessage(printRiotPointsBalance(selectLeagueOfLegendsAccount(account.getText())));\r\n } catch (ImpossibleValue e) {\r\n displayMessage(\"Reload failed, invalid input.\");\r\n }\r\n frame.setVisible(false);\r\n }\r\n });\r\n frame.add(enter);\r\n }" ]
[ "0.638025", "0.6375446", "0.6359336", "0.6175043", "0.61503625", "0.6069663", "0.60518974", "0.59832424", "0.59779716", "0.5940223", "0.5904132", "0.58994174", "0.58884674", "0.5874236", "0.58732116", "0.58337075", "0.581741", "0.57861185", "0.5781358", "0.5777813", "0.5776969", "0.5776969", "0.5761277", "0.5746699", "0.5738794", "0.5713755", "0.5704188", "0.57006556", "0.5630039", "0.5597149", "0.55588996", "0.55531526", "0.55016094", "0.5501357", "0.5492764", "0.549113", "0.54842746", "0.54774857", "0.546612", "0.546412", "0.54577994", "0.544005", "0.54351896", "0.54180896", "0.54180896", "0.54004407", "0.5399954", "0.53932995", "0.5383447", "0.5363335", "0.5356357", "0.53524256", "0.53477603", "0.5347663", "0.5344154", "0.53310114", "0.53263843", "0.53244466", "0.53195196", "0.53012115", "0.5288519", "0.5281117", "0.5271265", "0.52589244", "0.5258296", "0.5238917", "0.5229334", "0.5226097", "0.52213895", "0.52150685", "0.52054775", "0.5198476", "0.51953214", "0.5194646", "0.51806504", "0.5176312", "0.5174441", "0.5171405", "0.516766", "0.5167332", "0.5160758", "0.5160497", "0.5159827", "0.5158435", "0.5154928", "0.51520437", "0.51450604", "0.51153946", "0.51114035", "0.51093775", "0.50922996", "0.50915927", "0.5083279", "0.50798523", "0.5079197", "0.50789994", "0.50763744", "0.506918", "0.5056538", "0.50555104" ]
0.78315544
0
Received a broadcast notification that the inventory of items has changed
@Override public void receivedBroadcast() { Log.d(TAG, "Received broadcast notification. Querying inventory."); try { mHelper.queryInventoryAsync(mGotInventoryListener); } catch (IabHelper.IabAsyncInProgressException e) { complain("Error querying inventory. Another async operation in progress."); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void onInventoryChanged();", "@Override\n\tpublic void onInventoryChanged() {\n\t}", "@Override\n\tpublic void onInventoryChanged() {\n\t\tsuper.onInventoryChanged();\n\t}", "@Override\n public void onReceiveItem(InventoryItem itemReceived) {\n inventory.add(itemReceived);\n }", "public void fireOnItemAddedToInventoryCommands();", "public void updateInventory ( ) {\n\t\texecute ( handle -> handle.updateInventory ( ) );\n\t}", "public void onInventoryChanged()\n\t{\n\t\tfor (int i = 0; i < this.items.length; i++)\n\t\t{\n\t\t\tItemStack stack = this.items[i];\n\t\t\tif (stack != null && stack.stackSize <= 0)\n\t\t\t{\n\t\t\t\tthis.items[i] = null;\n\t\t\t}\n\n\t\t}\n\t}", "@Override\r\n public void updatedSaleInventory(ItemAndQuantity lastItem) {\r\n }", "private int notify(Wishlist wishlist, WishlistItem watched, InventoryItem invItem) {\n\t\tif (watched.isNotified) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tSystem.out.println(invItem.name + \" is in stock. Notify \" + wishlist.distributorID);\n\t\tif (notifier.notifyInStock(wishlist.notificationEmail, invItem.name)) {\n\t\t\twatched.setNotified();\n\t\t}\n\t\treturn 1;\n\t}", "public synchronized void update(String updatedItem, ArrayList<Integer> update){\n if(updatedItem.equals(\"marketplace\")){\n ArrayList<Integer> updateToSend = new ArrayList<>();\n updateToSend.add(4);\n updateToSend.addAll(update);\n broadcast(updateToSend);\n }\n\n else if(updatedItem.equals(\"developmentGrid\")){\n ArrayList<Integer> updateToSend = new ArrayList<>();\n updateToSend.add(5);\n updateToSend.addAll(update);\n broadcast(updateToSend);\n }\n\n else if (updatedItem.equals(\"actionTile\")) {\n ArrayList<Integer> updateToSend = new ArrayList<>();\n updateToSend.add(6);\n updateToSend.addAll(update);\n broadcast(updateToSend);\n }\n\n else {\n Player toUpdate = players.get(updatedItem);\n ArrayList<Integer> updateToSend = new ArrayList<>();\n updateToSend.add(toUpdate.getOrder());\n updateToSend.addAll(update);\n broadcast(updateToSend);\n }\n }", "@Override\n public void onItemsReceived(int type, List<DiscoverItem> items) {\n if (refreshView != null && refreshView.isRefreshing()) {\n refreshView.setRefreshing(false);\n }\n\n if (adapter != null) adapter.update(type, items);\n }", "@Override\n public void bridge$detectAndSendChanges(final boolean captureOnly) {\n\n final SpongeInventoryMenu menu = ((MenuBridge)this).bridge$getMenu();\n // We first collect all differences and check if cancelled for readonly menu changes\n final List<Integer> changes = new ArrayList<>();\n\n for (int i = 0; i < this.slots.size(); ++i) {\n final Slot slot = this.slots.get(i);\n final ItemStack newStack = slot.getItem();\n final ItemStack oldStack = this.lastSlots.get(i);\n if (!ItemStack.matches(oldStack, newStack)) {\n changes.add(i);\n }\n }\n\n // For each change\n for (final Integer i : changes) {\n final Slot slot = this.slots.get(i);\n final ItemStack newStack = slot.getItem();\n ItemStack oldStack = this.lastSlots.get(i);\n\n // Only call Menu Callbacks when clicking\n if (this.impl$isClicking && menu != null && !menu.onChange(newStack, oldStack, (org.spongepowered.api.item.inventory.Container) this, i, slot)) {\n this.lastSlots.set(i, oldStack.copy()); // revert changes\n this.impl$sendSlotContents(i, oldStack); // Send reverted slots to clients\n } else {\n this.impl$capture(i, newStack, oldStack); // Capture changes for inventory events\n\n if (captureOnly) {\n continue;\n }\n // Perform vanilla logic - updating inventory stack - notify listeners\n oldStack = newStack.isEmpty() ? ItemStack.EMPTY : newStack.copy();\n this.lastSlots.set(i, oldStack);\n // TODO forge checks !itemstack1.equals(itemstack, true) before doing this\n for (final ContainerListener listener : this.containerListeners) {\n listener.slotChanged(((AbstractContainerMenu) (Object) this), i, oldStack);\n }\n final ItemStack remoteStack = this.remoteSlots.get(i);\n if (!ItemStack.matches(remoteStack, newStack)) {\n this.remoteSlots.set(i, newStack.copy());\n if (this.synchronizer != null) {\n this.synchronizer.sendSlotChange(((AbstractContainerMenu) (Object) this), i, newStack);\n }\n }\n }\n }\n\n this.shadow$synchronizeCarriedToRemote();\n this.impl$broadcastDataSlots();\n }", "protected void onDataChanged(V item) {\n\n }", "protected void fireItemStateChanged(ItemEvent e){\n Object[] listeners=listenerList.getListenerList();\n // Process the listeners last to first, notifying\n // those that are interested in this event\n for(int i=listeners.length-2;i>=0;i-=2){\n if(listeners[i]==ItemListener.class){\n // Lazily create the event:\n // if (changeEvent == null)\n // changeEvent = new ChangeEvent(this);\n ((ItemListener)listeners[i+1]).itemStateChanged(e);\n }\n }\n }", "public void doItemEffect(RobotPeer robot){\n\t\t//System.out.println(\"Energy = \" + robot.getEnergy());\n\t\trobot.updateEnergy(-15);\n\t\t//System.out.println(\"Poison item USED\");\n\t\t//System.out.println(\"Energy = \" + robot.getEnergy());\n\t\t\n\t}", "@Override\n public void executeUpdate() {\n EventBus.publish(new DialogCraftingReceivedEvent(requestId, title, groups, craftItems));\n }", "public interface ProductItemAvailableListener {\n void onProductItemAvailable(List<ProductItem> products);\n}", "private void updateInventory(List<Item> items) {\r\n for(Item item : items) {\r\n inventory.put(item, STARTING_INVENTORY);\r\n inventorySold.put(item, 0);\r\n itemLocations.put(item.getSlot(), item);\r\n }\r\n }", "public interface theListener {\n public void itemToSend(String s);\n }", "@EventHandler(ignoreCancelled = true)\n\tpublic void onItemHeldChange(PlayerItemHeldEvent event)\n\t{\n\t\tPlayer player = event.getPlayer();\n\t\t\n\t\t//if he's switching to the golden shovel\n\t\tint newSlot = event.getNewSlot();\n\t\tItemStack newItemStack = player.getInventory().getItem(newSlot);\n\t\tif(newItemStack != null && newItemStack.getType() == instance.config_claims_modificationTool)\n\t\t{\n\t\t\t//give the player his available claim blocks count and claiming instructions, but only if he keeps the shovel equipped for a minimum time, to avoid mouse wheel spam\n\t\t\tif(instance.claimsEnabledForWorld(player.getWorld()))\n\t\t\t{\n\t\t\t\tEquipShovelProcessingTask task = new EquipShovelProcessingTask(player);\n\t\t\t\tinstance.getServer().getScheduler().scheduleSyncDelayedTask(instance, task, 15L); //15L is approx. 3/4 of a second\n\t\t\t}\n\t\t}\n\t}", "public void receivedUpdateFromServer();", "private void sendEquipmentPackets_Old(int entityId, Map<String, ItemStack> newItems) { \n // For each of the new items, make a packet and send it \n for(Map.Entry<String, ItemStack> entry : newItems.entrySet()) { \n Object packet = ReflectUtils.newInstance(\"PacketPlayOutEntityEquipment\");\n // Set the entity ID, slot and item\n ReflectUtils.setField(packet, \"a\", entityId);\n ReflectUtils.setField(packet, \"b\", getNMSItemSlot(entry.getKey()));\n ReflectUtils.setField(packet, \"c\", getNMSItemStack(entry.getValue()));\n sendPacket(packet);\n }\n }", "public void itemStateChanged(ItemEvent e) {\n\t\t\t\t}", "public void detectAndSendChanges() {\n\t\tsuper.detectAndSendChanges();\n\n\t\tfor (int i = 0; i < this.listeners.size(); ++i) {\n\t\t\tIContainerListener containerListener = this.listeners.get(i);\n\n\t\t\tif (this.burnTime != this.inventory.getField(TileEntityGenerator.FIELD_BURN_TIME)) {\n\t\t\t\tcontainerListener.sendWindowProperty(this, TileEntityGenerator.FIELD_BURN_TIME,\n\t\t\t\t\t\tthis.inventory.getField(TileEntityGenerator.FIELD_BURN_TIME));\n\t\t\t}\n\n\t\t\tif (this.currentItemBurnTime != this.inventory.getField(TileEntityGenerator.FIELD_CURRENT_ITEM_BURN_TIME)) {\n\t\t\t\tcontainerListener.sendWindowProperty(this, TileEntityGenerator.FIELD_CURRENT_ITEM_BURN_TIME,\n\t\t\t\t\t\tthis.inventory.getField(TileEntityGenerator.FIELD_CURRENT_ITEM_BURN_TIME));\n\t\t\t}\n\n\t\t\tif (this.curEnergy != this.inventory.getField(TileEntityGenerator.FIELD_CURRENT_ENERGY)) {\n\t\t\t\tcontainerListener.sendWindowProperty(this, TileEntityGenerator.FIELD_CURRENT_ENERGY,\n\t\t\t\t\t\tthis.inventory.getField(TileEntityGenerator.FIELD_CURRENT_ENERGY));\n\t\t\t}\n\t\t}\n\n\t\tthis.burnTime = this.inventory.getField(TileEntityGenerator.FIELD_BURN_TIME);\n\t\tthis.currentItemBurnTime = this.inventory.getField(TileEntityGenerator.FIELD_CURRENT_ITEM_BURN_TIME);\n\t\tthis.curEnergy = this.inventory.getField(TileEntityGenerator.FIELD_CURRENT_ENERGY);\n\t}", "@EventHandler\r\n\tpublic void onEquipmentChange(ArmourEquipEvent event) {\r\n\t\tif (event.getType() == ArmourType.CHESTPLATE) {\r\n\t\t\tmain.getServer().getScheduler().runTaskLater(main, new Runnable() {\r\n\t\t\t\tpublic void run() {\r\n\t\t\t\t\tmain.getPlayers().get(event.getPlayer().getUniqueId()).loadInventory();\r\n\t\t\t\t}\r\n\t\t\t}, 5);\r\n\t\t}\r\n\t}", "@Override\n\t\t\tpublic void itemStateChanged(ItemEvent e) {\n\t\t\t\t\n\t\t\t\tString item = e.getItem().toString();\n\t\t\t\tString item2 = Connectedlist.getSelectedItem();\n\t\t\t\trespond = true;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tint stateChange = e.getStateChange();\n\t\t\t\tif (stateChange == ItemEvent.SELECTED) {\n\t\t\t\t\tSystem.out.println(\"此次事件由选中“\" + item + \"”触发!\");\n\t\t\t\t\t//直接将client赋值为当前获得的socket,用于回复\n\t\t\t\t\tclient = socketMap.get(item2);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t} else if (stateChange == ItemEvent.DESELECTED) {\n\t\t\t\t\tSystem.out.println(\"此次事件由取消选中“\" + item + \"”触发!\");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"此次事件由其它原因触发!\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}", "private void notifyChange(final String what) {\n\t\tif (DEBUG)\n\t\t\tLog.d(TAG, \"notifyChange: what = \" + what);\n\n\t\tIntent i = new Intent(what);\n\t\ti.putExtra(\"id\", getAudioId());\n\t\ti.putExtra(\"track\", getTrackName());\n\t\ti.putExtra(\"artist\", getArtistName());\n\t\ti.putExtra(\"album\", getAlbumName());\n\t\ti.putExtra(\"playing\", isPlaying());\n\t\ti.putExtra(\"isfavorite\", isFavorite());\n\t\tsendStickyBroadcast(i);\n\n\t\t// Update the lockscreen controls\n\t\tupdateRemoteControlClient(what);\n\n\t\tif (what.equals(EVENT_POSITION_CHANGED)) {\n\t\t\treturn;\n\t\t} else if (what.equals(EVENT_META_CHANGED)) {\n\t\t\t// Increase the play count for favorite songs.\n\t\t\tif (!mFavoritesCache.isFavoriteSong(getAudioId(), getTrackHost())) {\n\t\t\t\tmFavoritesCache.addSong(getAudioId(), getTrackHost(),\n\t\t\t\t\t\tgetTrackName(), getAlbumName(), getArtistName());\n\t\t\t}\n\t\t\t// Add the track to the recently played list.\n\t\t\tmRecentsCache.addAlbum(getAlbumId(), getTrackHost(),\n\t\t\t\t\tgetAlbumName(), getArtistName(),\n\t\t\t\t\tMusicUtils.getSongCountForAlbum(this, getAlbumId()),\n\t\t\t\t\tMusicUtils.getReleaseDateForAlbum(this, getAlbumId()));\n\t\t} else if (what.equals(EVENT_QUEUE_CHANGED)) {\n\t\t\tif (isPlaying()) {\n\t\t\t\tsetNextTrack();\n\t\t\t}\n\t\t}\n\n\t\tif (what.equals(EVENT_PLAYSTATE_CHANGED)) {\n\t\t\tmNotificationHelper.updatePlayState(isPlaying());\n\t\t}\n\n\t\t// Share this notification directly with our widgets\n\t\tmAppWidgetSmall.notifyChange(this, what);\n\t\tmAppWidgetLarge.notifyChange(this, what);\n\t\tmAppWidgetLargeAlternate.notifyChange(this, what);\n\t\tmRecentWidgetProvider.notifyChange(this, what);\n\t}", "public interface QueryInventoryFinishedListener {\n /**\n * Called to notify that an inventory query operation completed.\n *\n * @param result The result of the operation.\n * @param inv The inventory.\n */\n public void onQueryInventoryFinished(IabResult result, Inventory inv);\n}", "@GlobalCommand\n\t@NotifyChange({\"cartItems\", \"shoppingCart\"})\n\tpublic void updateShoppingCart() {\n\t}", "@Override\n public void onEvent(EMNotifierEvent event) {\n message = (EMMessage) event.getData();\n messageBean.setGetMsgCode(MessageContant.receiveMsgByListChanged);\n messageBean.setEmMessage(message);\n\n eventBus.post(messageBean);\n }", "public interface CurrentItemListener {\n void onNewCurrentItem(int currentItem, int totalItemsCount);\n}", "@Override\n\tpublic void modifyItem(Object toUpdated) {}", "public void increaseVolume() {\n String json = new Gson().toJson(new TelevisionModel(TelevisionModel.Action.INCREASE_VOLUME));\n String a = sendMessage(json);\n TelevisionModel teleM = new Gson().fromJson(a, TelevisionModel.class);\n System.out.println(\"Client Received \" + json);\n\n if (teleM.getAction() == TelevisionModel.Action.INCREASE_VOLUME) {\n isIncreasingVolume = teleM.getValue();\n ui.updateArea(teleM.getMessage());\n };\n }", "@Override\n public void onReceive(Context context, Intent intent) {\n System.out.println(\"\");\n notifyDataSetChanged();\n\n }", "@Override\r\n\t\t\tpublic void itemStateChanged(ItemEvent e) {\n\t\t\t}", "public void itemStateChanged(ItemEvent arg0) {\n\t\t\r\n\t}", "public Inventory inventoryUpdate (TheGroceryStore g, LinkedList<Inventory> updater) throws ItemNotFoundException;", "private int compareAndNotify(Inventory inv, Wishlist wishlist, WishlistItem watched) {\n\t\tfor (InventoryCategory category : inv.categories) {\n\t\t\tfor (InventoryItem invItem : category.items) {\n\t\t\t\tif (invItem.itemNumber == watched.itemNumber) {\n\t\t\t\t\tif (invItem.isInStock) {\n\t\t\t\t\t\treturn notify(wishlist, watched, invItem);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}", "@Override\r\n\tpublic void itemStateChanged(ItemEvent e) {\n\t\t\r\n\t}", "@Override\n\tpublic void itemStateChanged(ItemEvent arg0) {\n\n\t}", "@Override\n\tpublic void itemStateChanged(ItemEvent arg0) {\n\n\t}", "@Override\n void accept(T inventoryEvent, IView view);", "public void changed(Item itemChanged) {\n int childNumber = this.indexOf(itemChanged);\n if (childNumber != -1) {\n fireContentsChanged(this, childNumber, childNumber);\n }\n }", "@Override\r\n\tpublic void itemStateChanged(ItemEvent arg0) {\n\r\n\t}", "@SuppressWarnings(\"deprecation\")\r\n\t@EventHandler\r\n\tpublic void inventoryClickEvent(InventoryClickEvent e) {\r\n\t\tEntity applier = e.getWhoClicked();\r\n\t\tif (!e.isCancelled()) {\r\n\t\t\tif (applier instanceof Player) {\r\n\t\t\t\tPlayer papplier = (Player) applier;\r\n\t\t\t\t// PlayerInventory pinventory = papplier.getInventory();\r\n\t\t\t\t// inven.put(papplier, pinventory);\r\n\t\t\t\tItemStack item = e.getCurrentItem();\r\n\t\t\t\tItemStack transmog = e.getCursor();\r\n\t\t\t\tString tname = \"\";\r\n\t\t\t\tif (item != null) {\r\n\t\t\t\t\tItemMeta itemMeta = item.getItemMeta();\r\n\t\t\t\t\tArrayList<String> lore1 = new ArrayList<String>();\r\n\t\t\t\t\tArrayList<String> lore2 = new ArrayList<String>();\r\n\t\t\t\t\tArrayList<String> lore3 = new ArrayList<String>();\r\n\t\t\t\t\tArrayList<String> lore4 = new ArrayList<String>();\r\n\t\t\t\t\tArrayList<String> lore5 = new ArrayList<String>();\r\n\t\t\t\t\tArrayList<String> lore6 = new ArrayList<String>();\r\n\t\t\t\t\tArrayList<String> lore7 = new ArrayList<String>();\r\n\t\t\t\t\tArrayList<String> totallore = new ArrayList<String>();\r\n\t\t\t\t\tif (item.getType() != Material.AIR) {\r\n\t\t\t\t\t\t// papplier.sendMessage(\"1\");\r\n\t\t\t\t\t\tif (transmog != null) {\r\n\t\t\t\t\t\t\t// papplier.sendMessage(\"2\");\r\n\t\t\t\t\t\t\tif (item.getType().name().endsWith(\"SWORD\") || item.getType().name().endsWith(\"AXE\")\r\n\t\t\t\t\t\t\t\t\t|| item.getType().name().endsWith(\"HELMET\")\r\n\t\t\t\t\t\t\t\t\t|| item.getType().name().endsWith(\"SHOVEL\")\r\n\t\t\t\t\t\t\t\t\t|| item.getType().name().endsWith(\"CHESTPLATE\")\r\n\t\t\t\t\t\t\t\t\t|| item.getType().name().endsWith(\"LEGGINGS\")\r\n\t\t\t\t\t\t\t\t\t|| item.getType().name().endsWith(\"BOOTS\") || item.getType().name().endsWith(\"BOW\")\r\n\t\t\t\t\t\t\t\t\t|| item.getType().name().endsWith(\"PICKAXE\")\r\n\t\t\t\t\t\t\t\t\t|| item.getType().name().endsWith(\"HOE\")) {\r\n\t\t\t\t\t\t\t\t// papplier.sendMessage(\"3\");\r\n\t\t\t\t\t\t\t\tif (item.hasItemMeta()) {\r\n\t\t\t\t\t\t\t\t\t// papplier.sendMessage(\"4\");\r\n\t\t\t\t\t\t\t\t\tif (item.getItemMeta().hasLore()) {\r\n\t\t\t\t\t\t\t\t\t\t// papplier.sendMessage(\"5\");\r\n\t\t\t\t\t\t\t\t\t\tif (item.getItemMeta().hasDisplayName()) {\r\n\t\t\t\t\t\t\t\t\t\t\t// papplier.sendMessage(\"6\");\r\n\t\t\t\t\t\t\t\t\t\t\tif (Methods.transmogged(item) == true) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// papplier.sendMessage(\"7\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t// papplier.sendMessage(Api.transint(item)\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\tdname.put(item, item.getItemMeta().getDisplayName());\r\n\t\t\t\t\t\t\t\t\t\t\t\tI.put(papplier, Methods.transint(item));\r\n\t\t\t\t\t\t\t\t\t\t\t\ttransmogged.put(item, true);\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\tif (Methods.transmogged(item) == false) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// papplier.sendMessage(\"8\");\r\n\t\t\t\t\t\t\t\t\t\t\t\ttransmogged.put(item, false);\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tif (!item.getItemMeta().hasDisplayName()) {\r\n\t\t\t\t\t\t\t\t\t\t\t// papplier.sendMessage(\"9\");\r\n\t\t\t\t\t\t\t\t\t\t\ttransmogged.put(item, false);\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tif (transmogged.get(item) != null) {\r\n\t\t\t\t\t\t\t\t\t\t\t// papplier.sendMessage(\"10\");\r\n\t\t\t\t\t\t\t\t\t\t\tif (transmogged.get(item) == false) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// papplier.sendMessage(\"11\");\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (transmog.hasItemMeta()) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t// papplier.sendMessage(\"12\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (transmog.getItemMeta().hasLore()) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// papplier.sendMessage(\"13\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (transmog.getItemMeta().hasDisplayName()) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (transmog.getItemMeta().getDisplayName()\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.contains(Methods.color(\"&e&lTransmog\"))) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// papplier.sendMessage(\"14\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor (String tlore : transmog.getItemMeta().getLore()) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// papplier.sendMessage(\"15\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (tlore.contains(Methods.color(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"&e&oPlace scroll on item to apply.\"))) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// papplier.sendMessage(\"16\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (e.getClickedInventory() instanceof PlayerInventory) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// papplier.sendMessage(\"17\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (CE.getItemEnchantments(item)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.size() > 0) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tMaterial material = item.getType();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tItemStack titem = new ItemStack(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmaterial, 1);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tItemMeta titemMeta = titem\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getItemMeta();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (item.getEnchantments() == null) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tenchanted.put(titem, false);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (item.getEnchantments() != null) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tenchants = item.getEnchantments();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tArrayList<CEnchantments> enchantes = CE\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getEnchantments();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tArrayList<String> enchanters = new ArrayList<String>();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor (CEnchantments encs : enchantes) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tenchanters.add(Methods.removeColor(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tencs.getCustomName()));\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor (String ench : item.getItemMeta()\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getLore()) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// papplier.sendMessage(\"29\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (enchanters\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.contains(Methods.removePower(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tMethods.removeColor(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tench)))) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// papplier.sendMessage(\"31\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor (CEnchantments enchant : CE\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getEnchantments()) {\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// papplier.sendMessage(\"19\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (ench.contains(enchant\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getCustomName())) {\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\tString tier = CE\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getEnchantmentCategory(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tenchant);\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\tif (tier.contains(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"T1\")) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlore1.add(0, Methods\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.color(ench));\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else if (tier\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.contains(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"T2\")) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlore2.add(0, Methods\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.color(ench));\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else if (tier\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.contains(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"T3\")) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlore3.add(0, Methods\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.color(ench));\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else if (tier\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.contains(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"T4\")) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlore4.add(0, Methods\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.color(ench));\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else if (tier\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.contains(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"T5\")) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlore5.add(0, Methods\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.color(ench));\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else if (tier\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.contains(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"T6\")) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlore6.add(0, Methods\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.color(ench));\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlore7.add(ench);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttotallore.addAll(lore7);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttotallore.addAll(lore6);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttotallore.addAll(lore5);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttotallore.addAll(lore4);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttotallore.addAll(lore3);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttotallore.addAll(lore2);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttotallore.addAll(lore1);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tint enchNumber = CE\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getItemEnchantments(item)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.size();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (itemMeta.hasDisplayName()) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttname = item.getItemMeta()\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.getDisplayName()\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+ \" &d&l[&b&l&n\"\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+ enchNumber + \"&d&l]\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!itemMeta.hasDisplayName()) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttname = \"&a\" + item.getType().name()\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+ \" &d&l[&b&l&n\"\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+ enchNumber + \"&d&l]\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\te.setCancelled(true);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitemMeta.setLore(totallore);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitemMeta.setDisplayName(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tMethods.color(tname));\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitem.setItemMeta(titemMeta);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitem.addUnsafeEnchantments(enchants);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (enchanted.get(titem) != null) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (enchanted.get(titem) == false) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tMethods.addGlow(titem);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\te.setCursor(null);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpapplier.getInventory()\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.removeItem(item);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpapplier.getInventory().addItem(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnew ItemStack[] { titem });\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor (int i2 = 1; i2 <= 10; ++i2) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpapplier.getWorld().playEffect(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpapplier.getEyeLocation(),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tEffect.SPELL, 1);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpapplier.getWorld().playSound(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpapplier.getLocation(),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSound.LEVEL_UP, 1.0f, 1.0f);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tenchants = null;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (transmogged.get(item) != null) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttransmogged.remove(item);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (dname.get(item) != null) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdname.remove(item);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (I.get(item) != null) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tI.remove(item);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\te.getWhoClicked().sendMessage(Methods.color(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"&6Swarm&eEnchants&f >> &cYou may only use Transmog scrolls in your own inventory!\"));\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\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}\r\n\t\t\t\t\t\t\t\t\t\t\tif (transmogged.get(item) == true) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// papplier.sendMessage(\"21\");\r\n\t\t\t\t\t\t\t\t\t\t\t\tString dname1 = dname.get(item).replace(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tMethods.color(\"&d&l[&b&l&n\" + I.get(papplier) + \"&d&l]\"), \"\");\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (transmog.hasItemMeta()) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t// papplier.sendMessage(\"22\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (transmog.getItemMeta().hasLore()) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (transmog.getItemMeta().hasDisplayName()) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// papplier.sendMessage(\"23\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (transmog.getItemMeta().getDisplayName()\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.contains(Methods.color(\"&e&lTransmog\"))) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// papplier.sendMessage(\"24\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor (String tlore : transmog.getItemMeta().getLore()) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// papplier.sendMessage(\"25\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (tlore.contains(Methods.color(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"&e&oPlace scroll on item to apply.\"))) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// papplier.sendMessage(\"26\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (e.getClickedInventory() instanceof PlayerInventory) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// papplier.sendMessage(\"27\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (CE.getItemEnchantments(item)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.size() > 0) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// papplier.sendMessage(\"28\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tMaterial material = item.getType();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tItemStack titem = new ItemStack(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmaterial, 1);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tItemMeta titemMeta = titem\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getItemMeta();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (item.getEnchantments() == null) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tMethods.addGlow(titem);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (item.getEnchantments() != null) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tenchants = item.getEnchantments();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tArrayList<CEnchantments> enchantes = CE\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getEnchantments();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tArrayList<String> enchanters = new ArrayList<String>();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor (CEnchantments encs : enchantes) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tenchanters.add(Methods.removeColor(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tencs.getCustomName()));\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor (String ench : item.getItemMeta()\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getLore()) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// papplier.sendMessage(\"29\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (enchanters\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.contains(Methods.removePower(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tMethods.removeColor(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tench)))) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// papplier.sendMessage(\"31\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor (CEnchantments enchant : CE\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getEnchantments()) {\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// papplier.sendMessage(\"19\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (ench.contains(enchant\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getCustomName())) {\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\tString tier = CE\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getEnchantmentCategory(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tenchant);\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\tif (tier.contains(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"T1\")) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlore1.add(0, Methods\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.color(ench));\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else if (tier\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.contains(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"T2\")) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlore2.add(0, Methods\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.color(ench));\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else if (tier\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.contains(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"T3\")) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlore3.add(0, Methods\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.color(ench));\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else if (tier\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.contains(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"T4\")) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlore4.add(0, Methods\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.color(ench));\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else if (tier\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.contains(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"T5\")) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlore5.add(0, Methods\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.color(ench));\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else if (tier\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.contains(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"T6\")) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlore6.add(0, Methods\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.color(ench));\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlore7.add(ench);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttotallore.addAll(lore7);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttotallore.addAll(lore6);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttotallore.addAll(lore5);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttotallore.addAll(lore4);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttotallore.addAll(lore3);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttotallore.addAll(lore2);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttotallore.addAll(lore1);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tint enchNumber = CE\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getItemEnchantments(item)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.size();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (itemMeta.hasDisplayName()) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttname = dname1 + \" &d&l[&b&l&n\"\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+ enchNumber + \"&d&l]\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\te.setCancelled(true);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitemMeta.setLore(totallore);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitemMeta.setDisplayName(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tMethods.color(tname));\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitem.setItemMeta(titemMeta);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitem.addUnsafeEnchantments(enchants);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\te.setCursor(null);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpapplier.getInventory()\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.removeItem(item);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpapplier.getInventory().addItem(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnew ItemStack[] { titem });\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor (int i2 = 1; i2 <= 10; ++i2) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpapplier.getWorld().playEffect(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpapplier.getEyeLocation(),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tEffect.SPELL, 1);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpapplier.getWorld().playSound(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpapplier.getLocation(),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSound.LEVEL_UP, 1.0f, 1.0f);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tenchants = null;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (transmogged.get(item) != null) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttransmogged.remove(item);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (dname.get(item) != null) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdname.remove(item);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (I.get(item) != null) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tI.remove(item);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\te.getWhoClicked().sendMessage(Methods.color(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"&6Swarm&eEnchants&f >> &cYou may only use Transmog scrolls in your own inventory!\"));\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\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}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void sendClientsChangedBroadcast() {\n Intent intent = new Intent(WifiHotspotManager.WIFI_HOTSPOT_CLIENTS_CHANGED_ACTION);\n intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);\n mContext.sendBroadcastAsUser(intent, UserHandle.ALL);\n }", "@ServiceAction\n protected void onNotificationDismissed(final ArrayList<Integer> serversRequiringNotification) {\n Observable.from(servers)\n .filter(new Func1<MinecraftServerEntity, Boolean>() {\n @Override\n public Boolean call(MinecraftServerEntity server) {\n return serversRequiringNotification.contains(server.getId());\n }\n })\n .map(new Func1<MinecraftServerEntity, MinecraftServerEntity>() {\n @Override\n public MinecraftServerEntity call(MinecraftServerEntity server) {\n server.setHasOfflineStatusBeenSeen(true);\n return server;\n }\n })\n .subscribeOn(AndroidSchedulers.mainThread())\n .observeOn(AndroidSchedulers.mainThread())\n .subscribe(new Action1<MinecraftServerEntity>() {\n @Override\n public void call(MinecraftServerEntity server) {\n if (DEBUG)\n Log.d(TAG, String.format(\"'%s' offline status has been seen by the user. Updating the database\", server.getName()));\n //We update the value in the database\n runtimeMinecraftServerDao.update(server);\n }\n });\n }", "public interface ItemStateChangeListener {\n void onItemStateChange(@NonNull ItemStateChangeEvent event);\n}", "public void onQueryInventoryFinished(IabResult result, Inventory inv);", "@Override\n\tpublic void itemStateChanged(ItemEvent e) {\n\t\t\n\n\t\t\n\t}", "@Override\r\n\t@SuppressWarnings(\"deprecation\")\r\n\tpublic void raiseEvent(Event e) {\r\n\t\tPlayer p = ((PlayerInteractEvent) e).getPlayer();\r\n\t\tPlayerStats stats = plugin.getStats(p);\r\n\t\tif (stats.subtractmoney(cost)) {\r\n\t\t\tif (!items.isEmpty()) {\r\n\t\t\t\tLinkedList<ItemStack> givenItems = new LinkedList<ItemStack>();\r\n\t\t\t\tfor (ItemStack item : items.getItemStacks()) {\r\n\t\t\t\t\tgivenItems.add(item);\r\n\t\t\t\t\tHashMap<Integer, ItemStack> failed = p.getInventory().addItem(item);\r\n\r\n\t\t\t\t\tif (failed != null && failed.size() > 0) {\r\n\t\t\t\t\t\t// the inventory may be full\r\n\t\t\t\t\t\tTribu.messagePlayer(p, (plugin.getLocale(\"Message.UnableToGiveYouThatItem\")),ChatColor.RED);\r\n\t\t\t\t\t\tstats.addMoney(cost);\r\n\t\t\t\t\t\tfor (ItemStack i : givenItems)\r\n\t\t\t\t\t\t\tp.getInventory().remove(i);\r\n\t\t\t\t\t\tgivenItems = null;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tp.updateInventory();\r\n\t\t\t\t// Alright\r\n\t\t\t\tTribu.messagePlayer(p,String.format(plugin.getLocale(\"Message.PurchaseSuccessfulMoney\"), String.valueOf(stats.getMoney())),ChatColor.GREEN);\r\n\t\t\t} else {\r\n\t\t\t\tTribu.messagePlayer(p,plugin.getLocale(\"Message.UnknownItem\"),ChatColor.RED);\r\n\t\t\t\tstats.addMoney(cost);\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\tTribu.messagePlayer(p,plugin.getLocale(\"Message.YouDontHaveEnoughMoney\"),ChatColor.RED);\r\n\t\t}\r\n\r\n\t}", "@Override\n public void notifyUpdate() {\n Update();\n //Invia all'activity di questo frammento il totale speso per aggiornare la sezione di controllo del budget\n onSendTotSpent.ReceiveTotSpent(contactGiftAdapter.totSpent());\n }", "public interface OnDeliveriesUpdatedListener {\n void onDeliveriesUpdated(List<Delivery> deliveries);\n}", "public void itemStateChanged(ItemEvent e) {\n toggleBeep();\n }", "@Override\n\t\t\tpublic void changed(ChangeEvent event, Actor actor) {\n\t\t\t\tEntity clonedItem = room.entityFactory.itemFactory.createItem(itemComponent.getItemType().type, null);\n\t\t\t\tItemComponent clonedItemCompo = Mappers.itemComponent.get(clonedItem);\n\t\t\t\tboolean pickedUp = clonedItemCompo.pickUp(GameScreen.player, clonedItem, room);\n\t\t\t\tif (pickedUp) {\n\t\t\t\t\t//TODO\n\t\t\t\t} else {\n\t\t\t\t\t//TODO\n\t\t\t\t}\n\t\t\t}", "private void m10418a(AppEntityBroadcast appEntityBroadcast) {\n StringBuilder sb = new StringBuilder();\n sb.append(\"onAppBroadcastChange: implements actions \");\n sb.append(appEntityBroadcast);\n Log.d(\"MessageCenter\", sb.toString());\n }", "@Override\n public void onReceive(Context context, Intent intent) {\n String action = intent.getAction();\n\n if (action.equals(TCSAppInstance.kTCSAppActionsUpdated)) {\n reloadNotifications();\n }\n\n if (action.equals(TCSAppInstance.kTCSAppInstanceActive)) {\n setupBannerItems();\n setupToolbarButtons();\n syncNotifications();\n }\n }", "@Override\n\tpublic void onReceive(Context context, Intent intent) {\n\t\tAppWidgetManager appWidgetManger = AppWidgetManager.getInstance(context); \n\t\tint[] appIds = appWidgetManger.getAppWidgetIds(new ComponentName(context, PlayWidget.class));\n\t\tlistitem = intent.getIntExtra(\"current_music\", 0);\n\t\tLog.d(TAG,\"listitem : \"+listitem);\n\t\tString action = intent.getAction();\n\t\tif(action.equals(PLAY_STATUE)){\n\t\t\tintent.getBooleanExtra(\"isplay\", false);\n\n\t\t\tonUpdate(context,appWidgetManger,appIds);\n\t\t}\n\t\tif(action.equals(COLLECTION_VIEW_ACTION)) {\n\t\t\tint item = intent.getIntExtra(\"widget_item\", 0);\n\t\t\tLog.d(TAG,\"listitem : \"+item);\n\t\t}\n\t\tif(action.equals(UPDATE_ACTION)){\n//\t\t\tlistitem = intent.getIntExtra(\"current_music\", 0);\n\t\t\tonUpdate(context,appWidgetManger,appIds);\n\t\t}\n\t\t\n\t\tsuper.onReceive(context, intent);\n\t}", "public interface PuntenObserver extends Remote {\n\n void modelChanged(PuntenRemote punten) throws RemoteException;\n\n}", "@Override\r\n\tpublic void receiveItems(Stanza stanza, String node, List<String> items) {\n\t\t\r\n\t}", "void updateItem(IDAOSession session, Item item);", "@Override\n\tpublic void processItemInformation(ProcessItemInformationObjectEvent e, String message) {\n\t\t\n\t}", "@EventHandler\n public void onInventoryClick(InventoryClickEvent event){\n // Get who clicked\n Player player = (Player) event.getWhoClicked();\n // Item clicked on\n ItemStack clickedItem = event.getCurrentItem();\n // Inventory clicked in\n Inventory clickedInventory = event.getInventory();\n // Check if clicked in selector inventory\n if (clickedInventory.getName().equals(Selector.invSelector.getName())) {\n // Cancel event\n event.setCancelled(true);\n // Check if not null\n if (clickedItem != null) {\n // Check what clicked\n if (clickedItem.getType() == Material.DIAMOND_PICKAXE) {\n // Close inventory\n player.closeInventory();\n // Open servers\n Survival.openMenu(player);\n } else if (clickedItem.getType() == Material.SNOW_BALL) {\n // Close inventory\n player.closeInventory();\n // Open servers\n Paintball.openMenu(player);\n } else if (clickedItem.getType() == Material.SKULL_ITEM) {\n // Close selector\n player.closeInventory();\n // Send message to player disabled\n Mobarena.openMenu(player);\n } else if (clickedItem.getType() == Material.WOOL) {\n // Close selector\n player.closeInventory();\n // Open servers\n Ctf.openMenu(player);\n } else if(clickedItem.getType() == Material.GRASS){\n // Close selector\n player.closeInventory();\n // Open servers\n Skyblock.openMenu(player);\n } else if(clickedItem.getType() == Material.COMPASS){\n // Close inventory\n player.closeInventory();\n // Back to hub\n Channels.teleportToServer(player, \"We are sending you to the hub.\", Functions.getRandomLobby());\n } else if (clickedItem.getType() == Material.IRON_DOOR) {\n // Close selector\n player.closeInventory();\n // Check if back\n if(Settings.exServers.contains(Settings.pluginServerName)) {\n player.openInventory(networkMenu.networkInv);\n }\n }\n }\n }\n }", "@Override\n public void onSmelting(EntityPlayer player, ItemStack item) \n {\n \n }", "@Override\n public void onStatusChanged(String s, int i, Bundle bundle) {\n }", "@Override\n public void onStatusChanged(String s, int i, Bundle bundle) {\n }", "public void doSomeChanges() {\n\n eventBus.publish(\"our.event.coming.from.model\", \"some data passed\");\n }", "@Override\n public void onSmelting(EntityPlayer player, ItemStack item) {\n }", "@Override\n\t@SideOnly(Side.CLIENT)\n\tpublic void onInventoryButtonPressed(int buttonId) {\n\t\tItemStack stack = Minecraft.getMinecraft().thePlayer.getHeldItem();\n\t\tif(stack != null && stack.getItem() == this) {\n\t\t\tsetMachineId(stack, buttonId);\n\t\t\tPacketHandler.sendToServer(new PacketItemModifcation(this, Minecraft.getMinecraft().thePlayer, (byte)0));\n\t\t}\n\t}", "@Override\n public void onItemRangeChanged(\n int startPosition, int itemCount, Object payload) {\n }", "public void itemStateChanged(ItemEvent e){\n\n // YOU CODE HERE\n }", "void notifyAdapters(Object event);", "@Override\r\n\tpublic void setInventoryItems() {\n\t\t\r\n\t}", "public void updateClientBag(int i)\n\t{\n\t\tif(getBag().getItems().get(i) != null)\n\t\t{\n\t\t\tServerMessage message = new ServerMessage(ClientPacket.UPDATE_ITEM_TOT);\n\t\t\tmessage.addInt(getBag().getItems().get(i).getItemNumber());\n\t\t\tmessage.addInt(getBag().getItems().get(i).getQuantity());\n\t\t\tgetSession().Send(message);\n\t\t}\n\t}", "public void setBomItemsChanged(boolean value) {\n\t\tthis.bomItemsChanged = value;\n\t}", "private void broadcast(ArrayList<Integer> update){\n for (Player p : players.values()){\n p.sendModel(update);\n }\n }", "@Override\r\n public void onItemsChanged(RecyclerView recyclerView){\r\n isNotifyDataSetChanged = true;\r\n }", "@Override\n\tpublic void detectAndSendChanges() {\n\t\tsuper.detectAndSendChanges();\n\t\t\n\t\tif (inv != null) {\n\t\t\tfor (int i = 0; i < listeners.size(); ++i) {\n\t\t\t\tIContainerListener icontainerlistener = listeners.get(i);\n\t\t\t\t\n\t\t\t\tif (furnaceBurnTime != inv.getField(0)) {\n\t\t\t\t\ticontainerlistener.sendWindowProperty(this, 0, inv.getField(0));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (currentItemBurnTime != inv.getField(1)) {\n\t\t\t\t\ticontainerlistener.sendWindowProperty(this, 1, inv.getField(1));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (cookTime != inv.getField(2)) {\n\t\t\t\t\ticontainerlistener.sendWindowProperty(this, 2, inv.getField(2));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (totalCookTime != inv.getField(3)) {\n\t\t\t\t\ticontainerlistener.sendWindowProperty(this, 3, inv.getField(3));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfurnaceBurnTime = inv.getField(0);\n\t\t\tcurrentItemBurnTime = inv.getField(1);\n\t\t\tcookTime = inv.getField(2);\n\t\t\ttotalCookTime = inv.getField(3);\n\t\t}\n\t}", "@Override\r\n\tpublic void onCloseInventory(InventoryCloseEvent e) {\n\t\t\r\n\t}", "@Override\r\n public void onCompleted() {\n Log.i(TAG, \"subscribed to buyable items\");\r\n }", "void updateInventory(String busNumber, String tripDate, int inventory) throws NotFoundException;", "private void updateItem(ItemBox itemBox) {\n\t\ttry {\n\t\t\tItem temp = getNewItem(itemBox.getGtin());\n\n\t\t\t// checks if the currently fetched temp Item is the still the same\n\t\t\t// item as the one online\n\t\t\tif (!temp.equals(itemBox.getItem())) {\n\t\t\t\tlog.info(temp.name + \" unequal to \" + itemBox.getItem().name);\n\t\t\t\titemBox.setItem(temp);\n\t\t\t\tlog.info(\"Changed to \" + temp.name);\n\t\t\t}\n\t\t} catch (Exception e1) {\n\t\t\tlog.error(\"Error updating Item \" + itemBox.getName() + \" - \" + e1.getMessage());\n\t\t}\n\t}", "public String[] updateItem(Session session) throws RemoteException {\n\t\tSystem.out.println(\"Server model invokes updateItem() method\");\n\t\treturn null;\n\t}", "@Override\n public void onReceive(Context arg0, Intent intent) {\n CTSCLog.d(TAG, \"onReceive():\" + \"intent action = \" + intent.getAction());\n if (intent != null\n && intent.getAction().equals(CheckItemBase.NOTIFY_ACTIVITY_ACTION)) {\n mIsNeedPopReboot = false;\n CTSCLog.d(TAG, \"onReceive() reset mIsNeedPopReboot = false\");\n refresh(true, true);\n }\n }", "void onItemDropped(EntityId droppedItem);", "public void notifyObserver() {\n\r\n for (Observer observer : observers) {\r\n\r\n observer.update(stockName, price);\r\n\r\n }\r\n }", "@Override\n public void onReceive(Context arg0, Intent arg1) {\n refreshNetStatus();\n updateFromProvider();\n }", "void notifyLorenzoDeckUpdate(DevelopCardDeckUpdate msg);", "@Override\n public void itemRPClassUpdate(RPObject entity) {\n }", "@Override\n\tpublic void update() {\n\t\tSystem.out.println(\"Observer Pattern on Room Reservation Notification: \");\n\t\tSystem.out.println(\"Your room is \" + reserve.getState()+\"\\n\");\n\t}", "@Override\n public void notify(String newFileContent) {\n Repository.getRepositoryInstance().updateStockOrders(newFileContent);\n//end of modifiable zone..................E/a170c128-ca49-4fc4-abdd-43b714481007\n }", "@EventHandler (priority = EventPriority.HIGHEST)\n \tpublic void onCrafting(CraftItemEvent event){\n \t\tif(event.isCancelled())\n \t\t\treturn;\n \n \t\tHumanEntity he = event.getWhoClicked();\n \t\tif((he instanceof Player)){\n \t\t\tPlayer player = (Player) he;\n \t\t\tAlertType type = AlertType.ILLEGAL;\n \t\t\tif(player.getGameMode() == GameMode.CREATIVE){\n \t\t\t\tif(plugin.isBlocked(player, PermissionNodes.MAKE_ANYTHING, player.getWorld())){\n \t\t\t\t\ttype = AlertType.LEGAL;\n \t\t\t\t}\n \t\t\t\tASRegion region = plugin.getRegionManager().getRegion(player.getLocation());\n \t\t\t\tif(region != null){\n \t\t\t\t\tif(!region.getConfig().isBlocked(event.getRecipe().getResult().getType(), ListType.CRAFTING)){\n \t\t\t\t\t\ttype = AlertType.LEGAL;\n \t\t\t\t\t}\n \t\t\t\t}else{\n \t\t\t\t\tif(config.get(player.getWorld()).isBlocked(event.getRecipe().getResult().getType(), ListType.CRAFTING)){\n \t\t\t\t\t\ttype = AlertType.LEGAL;\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}else{\n \t\t\t\ttype = AlertType.LEGAL;\n \t\t\t}\n \t\t\tString message = ChatColor.YELLOW + player.getName() + ChatColor.WHITE + (type == AlertType.ILLEGAL ? \" tried to craft an item\" : \" crafted an item\");\n \t\t\tString playerMessage = plugin.getMessage(\"blocked-action.crafting\");\n \t\t\tplugin.getAlerts().alert(message, player, playerMessage, type, AlertTrigger.CRAFTING);\n \t\t\tif(type == AlertType.ILLEGAL){\n \t\t\t\tevent.setCancelled(true);\n \t\t\t}\n \t\t}\n \t}", "public void itemStateChanged( ItemEvent e ) {\n\t// Try to grab a MIDI device\n\ttry {\n\t midi = MidiSystem.getMidiDevice( mdis.get( midiDevices.getSelectedIndex() ) );\n\t midi.open();\n\t midi.getTransmitter().setReceiver( this );\n\t} catch ( MidiUnavailableException mue ) {\n\t System.err.println( \"Could not get MIDI device: \"+midiDevices.getSelectedItem() );\n\t} catch ( SecurityException se ) {\n\t System.err.println( \"Could not get MIDI device: \"+midiDevices.getSelectedItem() );\n\t}\n\n }", "@Override\n\tpublic boolean inventory(Player player, Item item, int opcode) {\n\t\treturn false;\n// Clan channel = ClanRepository.get(player.clan);\n// if (channel == null) {\n// player.send(new SendMessage(\"You need to be in a clan to do this!\"));\n// return true;\n// }\n// player.inventory.remove(item);\n// Item showcaseReward = new Item(Utility.randomElement(ClanUtility.getRewardItems(channel)));\n// channel.showcaseItems.add(showcaseReward.getId());\n// player.send(new SendMessage(\"Inside the box you found \" + showcaseReward.getName() + \"! Showcase size: \" + channel.showcaseItems.size() + \"/28\", SendMessage.MessageColor.DARK_PURPLE));\n// return true;\n\t}", "public static void updateBuyItem(String inputCommand) {\r\n\t\tString[] value = inputCommand.split(\" \");\r\n\t\tif(value.length == 3 && \"updateBuy\".equalsIgnoreCase(value[0])) {\r\n\t\t\tInventory inventory = inventoryList.get(value[1]);\r\n\t\t\tinventory.setQuantity(Integer.parseInt(value[2]));\r\n\t\t\tinventoryList.put(value[1], inventory);\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"Entered wrong input command\");\r\n\t\t}\r\n\t}", "@Override\n public void onReceive(Context context, Intent intent) {\n updatePackageInfo();\n }", "@Override\n public void detectAndSendChanges()\n {\n super.detectAndSendChanges();\n \n ((TileAstralInfuser) this.worldObj.getBlockTileEntity(this.posX, this.posY, this.posZ)).setInventorySlotContents(5,\n ((TileAstralInfuser) this.worldObj.getBlockTileEntity(this.posX, this.posY, this.posZ)).getResult());\n }", "@Override\r\n\tpublic void Update() {\n\t\tSystem.out.println(name+\",¹Ø±ÕNBA£¬¼ÌÐø¹¤×÷£¡\"+abstractNotify.getAction());\r\n\t}", "public void itemStateChanged(ItemEvent e){\n model.setSolution();\n view.update();\n\n }", "public abstract void clientStatusChanged(ClientManager client, Object object);" ]
[ "0.75090235", "0.70304346", "0.68367904", "0.66785955", "0.65945077", "0.6385528", "0.6311397", "0.6211138", "0.59730184", "0.5886449", "0.58600694", "0.58429676", "0.5797691", "0.5771104", "0.5694377", "0.56935364", "0.5691021", "0.5690487", "0.56854707", "0.5677443", "0.5662175", "0.56550914", "0.5647499", "0.56271714", "0.561333", "0.5609844", "0.5598843", "0.55897063", "0.5573437", "0.5566748", "0.5552553", "0.5551042", "0.5546192", "0.5543996", "0.55425364", "0.5530788", "0.5527072", "0.55087376", "0.5507066", "0.5493995", "0.5493995", "0.54892874", "0.5489084", "0.54870063", "0.54657227", "0.5462885", "0.54628366", "0.54615027", "0.54541934", "0.5449138", "0.5433489", "0.5430364", "0.54231036", "0.53954566", "0.53898394", "0.5380974", "0.5377621", "0.53758633", "0.53739953", "0.53739357", "0.53706783", "0.5366278", "0.53610367", "0.5341211", "0.5338485", "0.5338485", "0.53342795", "0.5330487", "0.5318541", "0.5312024", "0.53076196", "0.53007597", "0.5299154", "0.52985114", "0.5296062", "0.5292621", "0.52898705", "0.52866346", "0.5283182", "0.52804077", "0.52731186", "0.5268675", "0.5257529", "0.5255577", "0.52531296", "0.52528685", "0.5237648", "0.5222675", "0.5221731", "0.5218562", "0.5217295", "0.5211867", "0.5208759", "0.52047455", "0.52017176", "0.5200188", "0.51967335", "0.5194032", "0.5182337", "0.5179837" ]
0.6565779
5
Returns a new instance of this fragment for the given section number.
public static PlaceholderFragment newInstance(int sectionNumber, String title_green, String title_black, String message, int imageId) { PlaceholderFragment fragment = new PlaceholderFragment(); Bundle args = new Bundle(); args.putInt(ARG_SECTION_NUMBER, sectionNumber); args.putString(ARG_SECTION_TITLE_GREEN, title_green); args.putString(ARG_SECTION_TITLE_BLACK, title_black); args.putString(ARG_SECTION_MESSAGE, message); args.putInt(ARG_SECTION_IMAGE, imageId); fragment.setArguments(args); return fragment; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static MainFragment newInstance(int sectionNumber) {\n MainFragment fragment = new MainFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static CurrentInfoFragment newInstance(int sectionNumber) {\n CurrentInfoFragment fragment = new CurrentInfoFragment();\n Bundle args = new Bundle();\n args.putInt(ZooGate.ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static Fragment newInstance(int sectionNumber) {\n Fragment fragment=null;\n switch (sectionNumber){\n case 1:fragment=new ContactosFragment();\n break;\n case 2:fragment=new SeriesFragment();\n break;\n case 3:fragment=new FavoritosFragment();\n break;\n }\n return fragment;\n }", "public static LibraryFragment newInstance(int sectionNumber) {\n LibraryFragment fragment = new LibraryFragment();\n Bundle args = new Bundle();\n return fragment;\n }", "public static ItemFragment newInstance(int section_number){\n ItemFragment fragment = new ItemFragment();\n Bundle args = new Bundle();\n args.putInt(\"SECTION_NUMBER\",section_number);\n fragment.setArguments(args);\n return fragment;\n }", "public static HistoryFragment newInstance(int sectionNumber) {\n\n //System.out.println(\"INFOs:: new_instance HISTORY...\");\n HistoryFragment fragment = new HistoryFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n\n return fragment;\n }", "public static MatchmakingFragment newInstance(int sectionNumber) {\n MatchmakingFragment fragment = new MatchmakingFragment();\n fragment.currentMatchCount = 0;\n fragment.getUser_type();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\r\n\r\n PlaceholderFragment fragment = new PlaceholderFragment();\r\n Bundle args = new Bundle();\r\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\r\n fragment.setArguments(args);\r\n return fragment;\r\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\r\n PlaceholderFragment fragment = new PlaceholderFragment();\r\n Bundle args = new Bundle();\r\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\r\n fragment.setArguments(args);\r\n return fragment;\r\n }", "public static BannerFragment newInstance(int sectionNumber) {\r\n BannerFragment fragment = new BannerFragment();\r\n Bundle args = new Bundle();\r\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\r\n fragment.setArguments(args);\r\n return fragment;\r\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\n\t\t\tPlaceholderFragment fragment = new PlaceholderFragment();\n\t\t\tBundle args = new Bundle();\n\t\t\targs.putInt(ARG_SECTION_NUMBER, sectionNumber);\n\t\t\tfragment.setArguments(args);\n\t\t\treturn fragment;\n\t\t}", "public static PlaceholderFragment newInstance(int sectionNumber) {\n\t\t\tPlaceholderFragment fragment = new PlaceholderFragment();\n\t\t\tBundle args = new Bundle();\n\t\t\targs.putInt(ARG_SECTION_NUMBER, sectionNumber);\n\t\t\tfragment.setArguments(args);\n\t\t\treturn fragment;\n\t\t}", "public static FragmentNearMe newInstance(int sectionNumber) {\n\t\tFragmentNearMe fragment = new FragmentNearMe();\n\t\tBundle args = new Bundle();\n\t\targs.putInt(ARG_SECTION_NUMBER, sectionNumber);\n\t\tfragment.setArguments(args);\n\t\treturn fragment;\n\t}", "public static MapFragment newInstance(int sectionNumber) {\n MapFragment fragment = new MapFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\r\n\t\t\tPlaceholderFragment fragment = new PlaceholderFragment();\r\n\t\t\tBundle args = new Bundle();\r\n\t\t\targs.putInt(ARG_SECTION_NUMBER, sectionNumber);\r\n\t\t\tfragment.setArguments(args);\r\n\t\t\treturn fragment;\r\n\t\t}", "public static PlaceholderFragment newInstance(int sectionNumber) {\r\n\t\t\tPlaceholderFragment fragment = new PlaceholderFragment();\r\n\t\t\tBundle args = new Bundle();\r\n\t\t\targs.putInt(ARG_SECTION_NUMBER, sectionNumber);\r\n\t\t\tfragment.setArguments(args);\r\n\t\t\treturn fragment;\r\n\t\t}", "public static FriendsFragment newInstance(int sectionNumber) {\n \tFriendsFragment fragment = new FriendsFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static MyAccountFragment newInstance(int sectionNumber) {\n MyAccountFragment fragment = new MyAccountFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static FindItemFragment newInstance(int sectionNumber) {\n FindItemFragment fragment = new FindItemFragment();\n Bundle args = new Bundle();\n /*args.putString(ARG_PARAM1, param1);\n args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);*/\n\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static DishesFragment newInstance(int sectionNumber) {\n DishesFragment fragment = new DishesFragment();\n Bundle args = new Bundle();\n args.putInt(PAGE, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static PlaceholderFragment newInstance(int sectionNumber, MainActivity activity) {\n PlaceholderFragment fragment = new PlaceholderFragment(activity);\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static ArticlesFragment newInstance(int sectionNumber) {\n \tArticlesFragment fragment = new ArticlesFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static NewsfeedFragment newInstance(int sectionNumber) {\n NewsfeedFragment fragment = new NewsfeedFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\r\n PlaceholderFragment fragment = new PlaceholderFragment();\r\n Bundle args = new Bundle();\r\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\r\n args.putString(\"alb_post\",inte.getStringExtra(\"detailJSON\"));\r\n fragment.setArguments(args);\r\n return fragment;\r\n }", "public static Favourite newInstance(int sectionNumber) {\n Favourite fragment = new Favourite();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static CalendarViewFragment newInstance(int sectionNumber) {\n CalendarViewFragment fragment = new CalendarViewFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment;\n if (sectionNumber == 1) {\n fragment = new WaitListFragment();\n }\n else {\n fragment = new PlaceholderFragment();\n }\n\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static ShoppingListView newInstance(int sectionNumber) {\n ShoppingListView fragment = new ShoppingListView();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static TaskHistoryFragment newInstance(int sectionNumber) {\n TaskHistoryFragment fragment = new TaskHistoryFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static SalaryFragment newInstance(int sectionNumber) {\n SalaryFragment fragment = new SalaryFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static PlaceholderFragment newInstance(int sectionNumber) {\n PlaceholderFragment fragment = new PlaceholderFragment();\n Bundle args = new Bundle();\n args.putInt(USER_NAME, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static FragmentClientTourPage7 newInstance(int sectionNumber) {\n\t\tFragmentClientTourPage7 fragment = new FragmentClientTourPage7();\n\t\tBundle args = new Bundle();\n\t\targs.putInt(ARG_SECTION_NUMBER, sectionNumber);\n\t\tfragment.setArguments(args);\n\t\treturn fragment;\n\t}", "public static LoginFragment newInstance(int section_number) {\n LoginFragment fragment = new LoginFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, section_number);\n fragment.setArguments(args);\n return fragment;\n }", "public static CharacterCreationFragment newInstance(int sectionNumber, Bundle args) {\n CharacterCreationFragment fragment = new CharacterCreationFragment();\n// Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n\t\t// We need to set arguments of this fragment. That's why I've added Bundle object as an\n\t\t// argument.\n fragment.setArguments(args);\n return fragment;\n }", "public static ShoppingListSettings newInstance(int sectionNumber) {\n ShoppingListSettings fragment = new ShoppingListSettings();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static AuthorizeFragment newInstance(int sectionNumber) {\n\t\tAuthorizeFragment fragment = new AuthorizeFragment();\n\t\tBundle args = new Bundle();\n\t\targs.putInt(ARG_SECTION_NUMBER, sectionNumber);\n\t\tfragment.setArguments(args);\n\t\treturn fragment;\n\n\t}", "public static EndGameTabFragment newInstance(int sectionNumber) {\n EndGameTabFragment fragment = new EndGameTabFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static ProjectScreen newInstance(int sectionNumber) {\n ProjectScreen fragment = new ProjectScreen();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static BandLocationDistanceFragment newInstance(int sectionNumber) {\n BandLocationDistanceFragment fragment = new BandLocationDistanceFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public static HomeFragment newInstance(int sectionNumber, JSONObject userInfoJson) {\n HomeFragment fragment = new HomeFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n fragment.setUserInfoJson(userInfoJson);\n return fragment;\n }", "public static SubmitPromptFragment newInstance(int sectionNumber) {\n SubmitPromptFragment fragment = new SubmitPromptFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n\n fragment.setArguments(args);\n return fragment;\n }", "public static ChangesViewFragment newInstance() {\n\t\tChangesViewFragment fragment = new ChangesViewFragment();\n\t\tBundle args = new Bundle();\n\t\targs.putInt(HomeViewActivity.ARG_SECTION_NUMBER, 2);\n\t\tfragment.setArguments(args);\n\t\treturn fragment;\n\t}", "public static HiPingFragment newInstance(int index) {\n HiPingFragment fragment = new HiPingFragment();\n Bundle bundle = new Bundle();\n bundle.putInt(ARG_SECTION_NUMBER, index);\n fragment.setArguments(bundle);\n return fragment;\n }", "@Override\n\t\tpublic Fragment getItem(int position) {\n\t\t\tFragment fragment = new SectionFragment(); \n\t\t\tBundle args = new Bundle();\n\t\t\targs.putInt(SectionFragment.ARG_SECTION_NUMBER, position + 1);\n\t\t\tfragment.setArguments(args);\n\t\t\t\n\t\t\t\n\t\t\treturn fragment;\n\t\t\t\n\t\t}", "public ScanFragment(int sectionNumber) {\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n scanListener = new MyButtonScanListener(this);\n searchListener = new MyButtonSearchListener();\n setArguments(args);\n }", "public Section newSection() {\n\t\tSection page = new Section();\r\n\t\tpage.setWpPublished(DateUtils.now());\r\n\t\treturn page;\r\n\t}", "public static EventsOrStatesFragment newInstance(int sectionNumber, boolean showEvents) {\n EventsOrStatesFragment fragment = new EventsOrStatesFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n args.putBoolean(ARG_SHOW_EVENTS, showEvents);\n fragment.setArguments(args);\n return fragment;\n }", "public SummaryFragment newInstance()\n {\n return new SummaryFragment();\n }", "void create(Section section);", "public static Fragment Home_Tab_start(String Id, String section) {\n BodyTab_Sub fragment = new BodyTab_Sub();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, Id);\n args.putString(ARG_PARAM2, section);\n fragment.setArguments(args);\n return fragment;\n }", "public static FragmentTousWanted newInstance() {\n FragmentTousWanted fragment = new FragmentTousWanted();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n return fragment;\n }", "Section createSection();", "public static SummaryFragment newInstance() {\n SummaryFragment fragment = new SummaryFragment();\n return fragment;\n }", "@Override\n public Fragment getItem(int position) {\n Bundle args = new Bundle();\n AttVFragment fragment = new AttVFragment();\n args.putInt(AttVFragment.ARG_SECTION_NUMBER, position);\n fragment.setArguments(args);\n return fragment;\n }", "public final SectionsBottomFragment invoke() {\n return new SectionsBottomFragment();\n }", "@Override\n public Fragment getItem(int position) {\n if (position == 0) {\n return new SectionFragment();\n } else if (position == 1) {\n return new SectionFragment();\n }\n else if (position == 2) {\n return new SectionFragment();\n }\n else if (position == 3) {\n return new SectionFragment();\n }\n\n return null;\n }", "public static SelectionFragment newInstance() {\n SelectionFragment fragment = new SelectionFragment();\n return fragment;\n }", "public static PurchaseFragment newInstance(int position) {\n PurchaseFragment f = new PurchaseFragment();\n // Supply index input as an argument.\n Bundle args = new Bundle();\n f.setArguments(args);\n return f;\n }", "public static Fragment3 newInstance() {\n Fragment3 fragment = new Fragment3();\n return fragment;\n }", "public static CommentFragment newInstance() {\n CommentFragment fragment = new CommentFragment();\n\n return fragment;\n }", "public static BitFragment newInstance() {\n BitFragment fragment = new BitFragment();\n return fragment;\n }", "public static MyCourseFragment newInstance() {\n MyCourseFragment fragment = new MyCourseFragment();\r\n// fragment.setArguments(args);\r\n return fragment;\r\n }", "public static CategoryFragment newInstance() {\n CategoryFragment categoryFragment = new CategoryFragment();\n return categoryFragment;\n\n }", "public static DetailsFragment newInstance(@IntRange(from = 1, to = 3) int kittenNumber) {\n Bundle args = new Bundle();\n args.putInt(ARG_KITTEN_NUMBER, kittenNumber);\n\n DetailsFragment fragment = new DetailsFragment();\n fragment.setArguments(args);\n\n return fragment;\n }", "public static NewGameFragment newInstance() {\n return new NewGameFragment();\n }", "public static MyFragment getInstance(int position) {\n\n //Construct the fragment\n MyFragment myFragment = new MyFragment();\n\n //New bundle instance\n Bundle args = new Bundle();\n\n //Passing in the Integer position of the fragment into the argument\n args.putInt(\"position\", position);\n\n //Setting the argument of the fragment to be the position\n myFragment.setArguments(args);\n\n //Return the fragment\n return myFragment;\n }", "public static FootprintFragment newInstance() {\n FootprintFragment fragment = new FootprintFragment();\n\n return fragment;\n }", "public static AmountFragment newInstance() {\n return new AmountFragment();\n }", "public static CVFragment newInstance(int i) {\n CVFragment myFragment = new CVFragment();\n\n Bundle args = new Bundle();\n args.putInt(\"pageInt\", i);\n myFragment.setArguments(args);\n\n return myFragment;\n }" ]
[ "0.78378177", "0.7716026", "0.7709604", "0.7697141", "0.76830727", "0.7609837", "0.75962704", "0.75684774", "0.75684774", "0.75684774", "0.75684774", "0.75684774", "0.75684774", "0.75684774", "0.75684774", "0.75684774", "0.75684774", "0.75684774", "0.75684774", "0.75684774", "0.75684774", "0.75684774", "0.75684774", "0.75684774", "0.75684774", "0.75684774", "0.75684774", "0.75684774", "0.75684774", "0.75684774", "0.75684774", "0.75684774", "0.75684774", "0.75684774", "0.75684774", "0.75684774", "0.7566755", "0.7556652", "0.75518084", "0.7512951", "0.7512951", "0.7499292", "0.7499292", "0.74967164", "0.7477256", "0.74589443", "0.74589443", "0.74486655", "0.74470174", "0.7399344", "0.73876894", "0.7385176", "0.7376838", "0.73713773", "0.7341543", "0.72737294", "0.7253907", "0.7189542", "0.7177517", "0.7166224", "0.7161499", "0.70798904", "0.70611525", "0.70295745", "0.70085603", "0.69375855", "0.6923947", "0.68993014", "0.6896615", "0.6888979", "0.631946", "0.6299278", "0.61741877", "0.6170166", "0.60617167", "0.6060405", "0.5984377", "0.5887245", "0.58474", "0.5825218", "0.5811954", "0.5682838", "0.56816673", "0.56239486", "0.55953616", "0.55423", "0.5526563", "0.5525056", "0.5493117", "0.5490216", "0.54890954", "0.5450192", "0.5430668", "0.54253167", "0.53967595", "0.53958136", "0.5390051", "0.53661567", "0.53558797", "0.53529596" ]
0.58187133
80
getItem is called to instantiate the fragment for the given page. Return a PlaceholderFragment (defined as a static inner class below). get resourceid by index
@Override public Fragment getItem(int position) { int imageId = imgs.getResourceId(position, -1); return PlaceholderFragment.newInstance(position + 1, premium_title_green[position], premium_title_black[position], premium_messages[position], imageId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@NonNull\n public abstract Fragment getItem(int position);", "public abstract @NonNull\n Fragment getItem(int position);", "@Override\n public Fragment getItem(int position) {\n return WebPageFragment.newInstance(position);\n }", "@Override\n\t\tpublic Fragment getItem(int position) {\n\t\t\tFragment fragment;\n\t\t\tif (fragments.isEmpty() || fragments.size() <= position) {\n\t\t\t\tfragment = new PlaceholderFragment(position);\n\t\t\t\tBundle args = new Bundle();\n\t\t\t\targs.putInt(PlaceholderFragment.ARG_SECTION_NUMBER, position);\n\t\t\t\tfragment.setArguments(args);\n\n\t\t\t\tfragments.add(position, fragment);\n\t\t\t} else {\n\t\t\t\tfragment = fragments.get(position);\n\t\t\t}\n\n\t\t\treturn fragment;\n\t\t}", "@NonNull\n\t\t@Override\n\t\tpublic androidx.fragment.app.Fragment getItem(int position) {\n\t\t\treturn PlaceholderFragment.newInstance(position + 1);\n\t\t}", "@Override\n\tpublic Fragment getItem(int idx) {\n\t\treturn fragmentList.get(idx);\n\t}", "@Override\r\n\t\tpublic Fragment getItem(int arg0) {\n\t\t\treturn fragments[arg0];\r\n\t\t}", "@Override\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position);\n }", "@Override\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position + 1);\n }", "@Override\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position + 1);\n }", "@Override\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position + 1);\n }", "@Override\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position + 1);\n }", "@Override\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position + 1);\n }", "@Override\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position + 1);\n }", "@Override\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position + 1);\n }", "@Override\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position + 1);\n }", "@Override\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position + 1);\n }", "@Override\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position + 1);\n }", "@Override\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position + 1);\n }", "@Override\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position + 1);\n }", "@Override\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position + 1);\n }", "@Override\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position + 1);\n }", "@Override\r\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position + 1);\r\n }", "@Override\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position + 1);\n }", "@Override\n public Fragment getItem(int arg0) {\n return mFragments.get(arg0);\n }", "@Override\n public android.support.v4.app.Fragment getItem(int arg0) {\n return arf.get(arg0);\n }", "@Override\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position + 1);\n\n }", "@Override\n public Fragment getItem(int position) {\n switch (position){\n case 0:\n recogidaFragment = RecogidaFragment.newInstance(\"Nombre\", \"Apellidos\");\n return recogidaFragment;\n case 1:\n entregaFragment = EntregaFragment.newInstance(\"Nombre\",\"Apellidos\");\n return entregaFragment;\n }\n return null;\n // Return a PlaceholderFragment (defined as a static inner class below).\n }", "@Override\n public Fragment getItem(int arg0) {\n return listfragment.get(arg0); //返回第几个fragment\n }", "@Override\n public Fragment getItem(int position) {\n return PlaceholderFragment.newInstance(position + 1);\n }", "@NonNull\r\n @Override\r\n public Fragment getItem(int position) {\n switch (position) {\r\n case 0:\r\n return new SubmitFragment();\r\n\r\n case 1:\r\n return new SearchFragment();\r\n }\r\n throw new RuntimeException(\"Can not get item.\");\r\n }", "@Override\n public Fragment getItem(int position) {\n Bundle args = new Bundle();\n AttVFragment fragment = new AttVFragment();\n args.putInt(AttVFragment.ARG_SECTION_NUMBER, position);\n fragment.setArguments(args);\n return fragment;\n }", "@Override\r\n public Fragment getItem(int position) {\r\n\r\n switch (position) {\r\n case 0:\r\n\r\n hFragment = createClientFragment(\"Homme\");\r\n return hFragment;\r\n\r\n case 1:\r\n\r\n fFragment = createClientFragment(\"Femme\");\r\n return fFragment;\r\n\r\n\r\n case 2:\r\n eFragment = createClientFragment(\"Enfant\");\r\n return eFragment;\r\n default:\r\n return null;\r\n }\r\n }", "@Override\n public Fragment getItem(int curent_page){\n switch (curent_page){\n case 0:\n WeatherAndForecastFragment fragment1 = new WeatherAndForecastFragment();\n return fragment1;\n case 1:\n WeatherAndForecastFragment fragment2 = new WeatherAndForecastFragment();\n return fragment2;\n case 2:\n WeatherAndForecastFragment fragment3 = new WeatherAndForecastFragment();\n return fragment3;\n\n default:\n return null;\n }\n }", "@Override\n public Fragment getItem(int position) {\n Fragment fragment = new Fragment();\n switch (position)\n {\n case 0:\n fragment = carCheckBasicInfoFragment;\n break;\n case 1:\n fragment = carCheckFrameFragment;\n break;\n case 2:\n fragment = carCheckIntegratedFragment;\n break;\n }\n return fragment;\n }", "@Override\n\tpublic Fragment getItem(int arg0) {\n\t\treturn list_fragments.get(arg0);\n\t}", "@Override\n \tpublic Fragment getItem(int arg0) {\n \t\treturn list.get(arg0);\n \t}", "@Override\n public Fragment getItem(int position) {\n \t mFragment[position] = PlaceholderFragment.newInstance(position);\n return mFragment[position];\n }", "@Override\n\t\tpublic Fragment getItem(int position) {\n\t\t\tFragment fragment = new SectionFragment(); \n\t\t\tBundle args = new Bundle();\n\t\t\targs.putInt(SectionFragment.ARG_SECTION_NUMBER, position + 1);\n\t\t\tfragment.setArguments(args);\n\t\t\t\n\t\t\t\n\t\t\treturn fragment;\n\t\t\t\n\t\t}", "@Override\n public Fragment getItem(int position) {\n MainFragment fragment=new MainFragment();\n fragment.setType(position);\n return fragment;\n }", "@Override\n public Fragment getItem(int position) {\n switch (position) {\n case 0:\n return PageFragment.newInstance(0);\n case 1:\n return MentionFragment.newInstance(0);\n\n default:\n return null;\n }\n }", "@Override\n public Fragment getItem(int position) {\n switch (position) {\n case 0:\n return AddPlaceholderFragment.newInstance();\n case 1:\n return mChange;\n case 2:\n return mDelete;\n }\n return null;\n }", "@Override\r\n\t\tpublic Fragment getItem(int arg0) {\n\t\t\treturn (fragments == null || fragments.size() == 0) ? null\r\n\t\t\t\t\t: fragments.get(arg0);\r\n\t\t}", "@Override\n public Fragment getItem(int i) {\n\n Fragment fragment = new SlideFragment();\n Bundle args = new Bundle();\n args.putString(SlideFragment.QUOTE, slidesQuotes.get(i));\n args.putInt(SlideFragment.IMAGE, slidesImages.get(i));\n fragment.setArguments(args);\n return fragment;\n }", "@Override\n public Fragment getItem(int position) {\n switch (position){\n case 0:\n return new ItemAuctionFragment();\n case 1:\n return new ItemBidsFragment();\n default:\n return null;\n }\n }", "@Override\n public Fragment getItem(int position) {\n switch (position) {\n case 0:\n return pageHome;\n case 1:\n return pageJava;\n case 2:\n return pageAndroid;\n default:\n return pageHome;\n }\n }", "@Override\n public Fragment getItem(int position) {\n //To do\n //return the corresponded fragment according to position\n //remember that the position can not be out of [0, 2]\n\n switch (position) {\n case 0:\n return CollectionFragment.newInstance(0, \"\");\n case 1:\n return CollectionFragment.newInstance(1, \"\");\n default:\n return null;\n }\n\n //To do closed\n }", "@Override\n public Fragment getItem(int position) {\n if (position == 0)\n return new RootFragment();\n else\n return new StaticFragment();\n }", "@Override\n public Fragment getItem(int position) {\n switch (position) {\n case 0:\n return Libra1Fragment.newInstance(0, \"Page # 1\");\n case 1:\n return Libra2Fragment.newInstance(1, \"Page # 2\");\n case 2:\n return Libra3Fragment.newInstance(2, \"Page # 3\");\n case 3:\n return Libra4Fragment.newInstance(3, \"Page # 4\");\n case 4:\n return Libra5Fragment.newInstance(4, \"Page # 5\");\n case 5:\n return Libra6Fragment.newInstance(5, \"Page # 6\");\n case 6:\n return Libra7Fragment.newInstance(6, \"Page # 7\");\n case 7:\n return Libra8Fragment.newInstance(7, \"Page # 8\");\n case 8:\n return Libra9Fragment.newInstance(8, \"Page # 9\");\n\n default:\n return null;\n }\n }", "@Override\n\tpublic Fragment getItem(int position) {\n\t\tif(this.getRegisteredFragment(position)!=null){\n\t\t\treturn getRegisteredFragment(position);\n\t\t}else{\n\t\t\t//return FavFragment.newInstance();//QiangContentFragment.newInstance(position);\n\t\t\treturn QiangContentFragment.newInstance(position);\n\t\t}\n//\t\treturn MenuContentFragment.newInstance(\"pager\" + position);\n\t}", "@Override\n public Fragment getItem(int position) {\n switch (position) {\n case 0: // Fragment # 0 - This will show FirstFragment\n return Alarm_Fragment_1.newInstance(0, \"Page #1\");\n case 1: // Fragment # 0 - This will show FirstFragment different title\n return Alarm_Fragment_2.newInstance(1, \"Page # 2\");\n case 2: // Fragment # 1 - This will show SecondFragment\n return Alarm_Fragment_3.newInstance(2, \"Page # 3\");\n case 3 : return Alarm_Fragment_4.newInstance(3, \"Page # 4\");\n case 4 : return Alarm_Fragment_5.newInstance(5, \"Page # 5\");\n //return Frag5.newInstance(4, \"Page # 5\");\n case 5 : return Alarm_Fragment_6.newInstance(6, \"Page # 6\");\n default:\n return null;\n }\n }", "@Override\n\tpublic Fragment getItem(int position) {\n\t\t\n\t\t\n\t\tFragment fragment=new EmojiFragment(this.activity);\n\t\treturn fragment;\n\t\t\n//\t\tFragment fragment = new DummySectionFragment();\n//\t\tBundle args = new Bundle();\n//\t\targs.putInt(DummySectionFragment.ARG_SECTION_NUMBER, position + 1);\n//\t\tfragment.setArguments(args);\n//\t\treturn fragment;\n\t}", "@Override\n\t\tpublic Fragment getItem(int position) {\n\t\t\tFragment fragment;\n\t\t\tswitch (position) {\n\t\t\tcase 0:\n\t\t\t\tfragment = ToDoFragment.newInstance(userId, userName);\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tfragment = ToGoFragment.newInstance();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tfragment = ToDoFragment.newInstance(userId, userName);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn fragment;\n\t\t}", "@Override\n public Fragment getItem(int position) {\n switch (position) {\n case 0:\n return DetailsFragment.newInstance(position);\n case 1:\n return MapsFragment.newInstance(position);\n }\n return null;\n }", "@NonNull\n @Override\n public Fragment getItem(int position) {\n return fragments.get(position);\n }", "@Override\r\n\t\tpublic Fragment getItem(int position) {\r\n\t\t\tTabInfo info = getTabs().get(position);\r\n\t\t\treturn Fragment.instantiate(getContext(), info.clss.getName(), info.args);\r\n\t\t}", "@Override\n public Fragment getItem(int position) {\n //Fragment frag = new HomeScreenFragment();\n //return frag;\n switch (position)\n {\n case 0:\n return new HomeScreenFragment();\n case 2:\n return new AddRestaurantFragment();\n default:\n return new Fragment();\n }\n }", "@Override\n public Fragment getItem(int position) {\n\n switch (position) {\n case 0:\n\n return MainFragment.newInstance(position + 1);\n\n case 1:\n\n return NewContactFragment.newInstance(\"\", \"\");\n\n case 2:\n\n return CallLogFragment.newInstance(1);\n }\n return null;\n }", "@Override\n public Fragment getItem(int position) {\n Bundle bundle = new Bundle();\n bundle.putString(\"placeid\",placeid);\n bundle.putString(\"data\",jsonData);\n switch (position){\n case 0:\n InfoFragment fragment = new InfoFragment();\n fragment.setArguments(bundle);\n return fragment;\n case 1:\n PhotosFragment fragment1 = new PhotosFragment();\n fragment1.setArguments(bundle);\n return fragment1;\n case 2:\n MapFragment fragment2 = new MapFragment();\n fragment2.setArguments(bundle);\n return fragment2;\n case 3:\n ReviewFragment fragment3 = new ReviewFragment();\n fragment3.setArguments(bundle);\n return fragment3;\n }\n return null;\n }", "@Override\n\t\t\tpublic android.support.v4.app.Fragment getItem(int p1){\n\t\t\t\treturn new PAFragment(getCount()-p1-1);\n\t\t\t}", "@Override\n public Fragment getItem(int position) {\n Log.d(\"DEBUG\", \"Position : \" + position);\n //return PlaceholderFragment.newInstance(position + 1);\n\n\n switch (position) {\n case 0:\n return SectionsFragment1.newInstance(position + 1);\n case 1:\n return SectionsFragment2.newInstance(position + 1);\n case 2:\n return SectionsFragment3.newInstance(position + 1);\n }\n\n return null;\n\n }", "@Override\n public Fragment getItem(int position) {\n switch (position) {\n case 0:\n return MainFragment.newInstance();\n case 1:\n return LoginFragment.newInstance();\n default:\n return null;\n }\n }", "@Override\n public Fragment getItem(int position) {\n switch (position) {\n case 0:\n FirstFragment firstFragment = new FirstFragment();\n return firstFragment;\n case 1:\n SecondFragment secondFragment = new SecondFragment();\n return secondFragment;\n case 2:\n ThirdFragment thirdFragment = new ThirdFragment();\n return thirdFragment;\n default:\n return null;\n }\n }", "@Override\n public Fragment getItem(int position) {\n return fragments.get(position);\n }", "@Override\n public Fragment getItem(int position) {\n return fragments.get(position);\n }", "@Override\n public Fragment getItem(int position) {\n switch (position) {\n case 0:\n return FirstFragment.newInstance();\n case 1:\n return SecondFragment.newInstance();\n case 2:\n return ThirdFragment.newInstance();\n default:\n return null;\n }\n }", "@Override\n public Fragment getItem(int position) {\n switch (position) {\n case 0: // Fragment # 0 - This will show FirstFragment\n System.out.println(\"ana fl case 0:\" + song.coverURL);\n return result_fragment.newInstance(song.coverURL, song.title, song.artist, song.album);\n\n case 1: // Fragment # 1 - This will show FirstFragment different title\n return LyricsFragment.newInstance(song.lyrics);\n default:\n return null;\n }\n }", "@NonNull\n @Override\n public Fragment getItem(int position) {\n switch (position) {\n case 0:\n return FragmentA.newInstance(\"This is First Fragment\");\n case 1:\n return FragmentB.newInstance(\"This is second Fragment\");\n case 2:\n return FragmentC.newInstance(\"This is Third Fragment\");\n }\n return FragmentA.newInstance(\"This is Default Fragment\");\n }", "protected abstract Fragment getFragmentByPosition(int position);", "public static FavViewPagerItemFragment getInstance(String pageTitle){\n\n FavViewPagerItemFragment fragment = new FavViewPagerItemFragment();\n\n Bundle args = new Bundle();\n args.putString(PAGE_TITLE, pageTitle);\n fragment.setArguments(args);\n //System.out.println(\"ViewPagerItemFragment getInstance--------------\" + fragment);\n //System.out.println(\"receive x from activity\" + fragment);\n return fragment;\n }", "@Override\n\tpublic Fragment getItem(int position) {\n\t\treturn fragments.get(position);\n\t}", "@Override\r\n public Fragment getItem(int i) {\n Fragment fragment = new ContentFragment();\r\n Bundle args = new Bundle();\r\n // Our object is just an integer :-P\r\n// args.putInt(ContentFragment.ARG_CONTENT, i + 1);\r\n// args.putString(ContentFragment.ARG_CONTENT, Constant.category[i]);\r\n args.putString(ContentFragment.ARG_CONTENT, custom_category_values.get(i));\r\n fragment.setArguments(args);\r\n return fragment;\r\n }", "@Override\n\t\tpublic Fragment getItem(int position) {\n\t\t\tswitch (position) {\n\t\t\tcase 0 :\n\t\t\t\t// Home fragment\n\t\t\t\treturn new HomeFragment();\n\t\t\tcase 1 :\n\t\t\t\t// Exercises fragment\n\t\t\t\treturn new ExercisesFragment();\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}", "@Override\n public Fragment getItem(int position) {\n return ListFragment.newInstance(context.getResources().getString(pageTitles[position]), darkTheme);\n }", "@Override\n public Fragment getItem(int position) {\n switch (position) {\n case 0:\n return new About();\n case 1:\n return new play();\n case 2:\n return new Rules();\n default:\n return new play();\n }\n }", "@Override\n\t\tpublic Fragment getItem(int position) {\n\t\t\tswitch (position) {\n\t\t\t\t//case 0:return PlaceholderFragment.newInstance(position + 1);//defaultFragment();\n\t\t\t\tcase MANAGE_RECORDINGS:\n\t\t\t\t\treturn ManageRecordingsFrame.newInstance(position);\n\t\t\t\tcase SEARCH_FOR_STATIONS:\n\t\t\t\t\treturn SearchForStationsFrame.newInstance(position);\n\t\t\t\tcase MANAGE_STATIONS:\n\t\t\t\t\treturn ManageFavoriteStationsFrame.newInstance(position);\n\t\t\t\tcase FAVORITE_STATIONS:\n\t\t\t\tdefault:\n\t\t\t\t\treturn FavoriteStationsFrame.newInstance(0);//\n\t\t\t}\n\t\t}", "@Override\n public Fragment getItem(int position) {\n switch (position){\n case 0:\n return FirstFragment.newInstance(\"\",\"\");\n case 1:\n return ATMFragment.newInstance(\"\",\"\");\n default:\n return FirstFragment.newInstance(\"\",\"\");\n }\n }", "@Override\n public Fragment getItem(int position) {\n switch (position) {\n case 0:\n uiManageParty tab1 = new uiManageParty();\n return tab1;\n\n case 1:\n uiHostPlayLists tab2 = new uiHostPlayLists();\n return tab2;\n\n case 2:\n uiHostNowPlaying tab3 = new uiHostNowPlaying();\n return tab3;\n\n default:\n return null;\n }\n }", "@NonNull\n @Override\n public Fragment getItem(int position) {\n return pagerFragments.get(position);\n }", "@Override\r\n\t\t\tpublic Fragment getItem(int arg0) {\n\t\t\t\tswitch (arg0) {\r\n\t\t\t\tcase 0:\r\n\t\t\t\t\treturn new VideoInforFragment();\r\n\t\t\t\tcase 1:\r\n\t\t\t\t\treturn new VideoReplayFragment();\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\r\n\t\t\t}", "@Override\n\tpublic Fragment getItem(int position) {\n\t\treturn ContentFragment.newInstance(contents.getChapterFile(position));\n\t}", "@Override\n public Fragment getItem(int index) {\n switch (index) {\n case 0:\n return new Friendsfragment();\n\n case 1:\n return new PublicprofileFragment();\n\n case 2:\n return new Communityfragment();\n case 3:\n return new Communityfragment1();\n case 4:\n return new Communityfragment2();\n }\n\n return null;\n }", "@Override\n public Fragment getItem(int position) {\n\n switch (position) {\n case 0: // Fragment # 0 - This will show WelcomeActivity\n Context context;\n return WelcomeActivity.newInstance(0, R.string.page0);\n case 1: // Fragment # 1 - This will show FirstFragment\n return FirstFragment.newInstance(1, R.string.page1);\n case 2: // Fragment # 2 - This will show SecondFragment\n return SecondFragment.newInstance(2, R.string.page2);\n case 3: // Fragment # 1 - This will show ThirdFragment\n return ThirdFragment.newInstance(3, R.string.page3);\n case 4:// Fragment # 1 - This will show FourthFragment\n return FourthFragment.newInstance(4,R.string.page4);\n default:\n return null;\n }\n }", "@Override\r\n public Fragment getItem(int position) {\r\n try {\r\n switch (position) {\r\n case 0:\r\n return new HomeInfoFragment();\r\n case 1:\r\n return new BlogsFragment();\r\n case 2:\r\n return new HomeFeedsFragment();\r\n case 3:\r\n return new NetworkingOptionFragment();\r\n }\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n return null;\r\n }", "@Override\n public Fragment getItem(int position) {\n\n Fragment fragment = null;\n Bundle bundle = new Bundle();\n bundle.putString(\"e\", \"test\");\n switch (position) {\n case 0:\n fragment = new OriginalFragment();\n // fragment.setArguments(bundle);\n break;\n\n case 1:\n fragment = new DecodedFragment();\n fragment.setArguments(bundle);\n }\n return fragment;\n }", "@Override\n public Fragment getItem(int position) {\n switch (position) {\n case 0: // Fragment # 0 - This will show FirstFragment\n return DishListFragment.newInstance(0);\n case 1:\n return DishListFragment.newInstance(1);\n case 2:\n return DishListFragment.newInstance(2);\n default:\n return null;\n }\n }", "@Override\n\t\tpublic Fragment getItem(int position) {\n\t\t\treturn fragmentList.get(position);\n\t\t}", "@Override\n public Fragment getItem(int position) {\n return DishesFragment.newInstance(position + 1);\n }", "@Override\n public Fragment getItem(int position) {\n if (position == 0){\n return MainFragment.newInstance();\n } else {\n return RepositoryFragment.newInstance();\n }\n }", "@Override\r\n\tpublic Fragment getItem(int position) {\n\t\tswitch(position) {\r\n\t\t\tcase 2:\t\t\r\n\t\t\t\treturn new FriendsFragment();\r\n\t\t\tcase 0: \r\n\t\t\t\treturn new LibraryFragment();\r\n\t\t\tcase 3:\r\n\t\t\t\treturn new InboxFragment();\r\n\t\t\tcase 1:\r\n\t\t\t\treturn new BorrowedFragment();\r\n\t\t}\r\n\t\t\r\n\t\treturn null;\r\n\t}", "@Override\n public Fragment getItem(int position) {\n\n if (position == 0) {\n return new HotelFragment();\n } else if (position == 1) {\n return new MallFragment();\n } else if (position == 2) {\n return new RestaurentFragment();\n } else {\n return new HistoricalSiteFragment();\n }\n }", "@Override\n\tpublic Fragment getItem(int position) \n\t{\n if (position == SimpleCarouselTest.FIRST_PAGE)\n \tscale = SimpleCarouselTest.BIG_SCALE;\n else\n \tscale = SimpleCarouselTest.SMALL_SCALE;\n \n position = position % SimpleCarouselTest.PAGES;\n return MyFragment.newInstance(context, position, scale);\n\t}", "@Override\n public Fragment getItem(int position) {\n switch (position) {\n case 0: // Fragment # 0 - This will show FirstFragment\n return new ListFragment();\n case 1: // Fragment # 0 - This will show FirstFragment different title\n return new GridFragment();\n\n default:\n return null;\n }\n }", "@Override\n public Fragment getItem(int position) {\n switch (position) {\n case 0:\n ArharFragment arharFragment = new ArharFragment();\n return arharFragment;\n case 1:\n MoongFragment moongFragment = new MoongFragment();\n return moongFragment;\n case 2:\n UradFragment UradFragment = new UradFragment();\n return UradFragment;\n case 3:\n RajmaFragment RajmaFragment = new RajmaFragment();\n return RajmaFragment;\n\n case 4:\n MasoorFragment MasoorFragment = new MasoorFragment();\n return MasoorFragment;\n\n case 5:\n Soya SoyaFragment = new Soya();\n return SoyaFragment;\n\n\n default:\n return null;\n }\n }", "@Override\n public Fragment getItem(int position) {\n if (position < frags.size()) {\n return frags.get(position);\n } else {\n return lastFrag;\n }\n }", "public static Fragment selectFragment(int itemId) {\n switch (itemId){\n case R.id.menu_home: {\n return new HomeFragment();\n }\n case R.id.menu_search: {\n return new SearchFragment();\n }\n case R.id.menu_profile: {\n return new ProfileFragment();\n }\n default:\n return null;\n }\n }", "@NonNull\n @Override\n public Fragment getItem(int position) {\n if (position == 0){\n return new AccommodationFragment();\n }else if (position == 1){\n return new FoodFragment();\n }else if(position == 2){\n return new DrinkFragment();\n }else {\n return new FunFragment();\n }\n }", "@Override\n public Fragment getItem(int position) {\n // Create a new fragment according to the position of the ViewPager\n if (position == 0) {\n return new BlogFragment();\n } else if (position == 1) {\n return new MapFragment();\n }\n return null;\n }", "@Override\n public Fragment getItem(int position) {\n if (position == 0) {\n return new FieldSearchFragment();\n } else {\n return new MatchSearchFragment();\n }\n }", "@Override\n public Fragment getItem(int position) {\n Fragment fragment = null;\n switch (position){\n case 0:\n fragment = new FragmentTrailer();\n break;\n case 1:\n fragment = new FragmentReviews();\n break;\n default:\n fragment = null;\n break;\n }\n\n return fragment;\n }" ]
[ "0.70114493", "0.6913635", "0.68273306", "0.6803847", "0.6778322", "0.6738602", "0.6716459", "0.66962814", "0.6679142", "0.6679142", "0.6679142", "0.6679142", "0.6679142", "0.6679142", "0.6679142", "0.6679142", "0.6679142", "0.6679142", "0.6679142", "0.6679142", "0.6679142", "0.6679142", "0.6646502", "0.6643752", "0.66382444", "0.66363883", "0.6622244", "0.6615384", "0.66101104", "0.6610097", "0.6599908", "0.65749955", "0.6517295", "0.65042067", "0.64954734", "0.6487706", "0.6478671", "0.64760095", "0.64568806", "0.6452849", "0.64154655", "0.6411382", "0.6408496", "0.64051765", "0.6403675", "0.63889676", "0.63672704", "0.63583523", "0.6357955", "0.6353772", "0.6339414", "0.6326729", "0.63144463", "0.63111603", "0.6309827", "0.63051474", "0.6303866", "0.6280753", "0.62608474", "0.62587804", "0.62578267", "0.62549067", "0.623177", "0.6225875", "0.6225875", "0.6223126", "0.6209683", "0.6208303", "0.62024033", "0.62005556", "0.6179101", "0.6172491", "0.61675906", "0.6166622", "0.61662114", "0.61512893", "0.61402446", "0.613894", "0.6129965", "0.6127001", "0.6125205", "0.6123637", "0.6120291", "0.61159384", "0.6111521", "0.6108384", "0.6100832", "0.6099545", "0.6097197", "0.6090934", "0.6081428", "0.6067884", "0.60636556", "0.6062921", "0.60567325", "0.60559344", "0.60504365", "0.60372853", "0.603231", "0.60319805" ]
0.66825694
8
Show 3 total pages.
@Override public int getCount() { return 3; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\tpublic int getCount() {\n\t\t\t// Show 3 total pages.\n\t\t\treturn 3;\n\t\t}", "@Override\n // This returns the number of pages we have within our view pager\n public int getCount() {\n return 3;\n }", "int getPagesAmount();", "long getAmountPage();", "int getPagesize();", "private void updateTotalPageNumbers() {\n totalPageNumbers = rows.size() / NUM_ROWS_PER_PAGE;\n }", "public void setPages(int pages) {\n this.pages = pages;\n }", "@Override\n public int getNumOfPageRows() {\n return 10;\n }", "int getPageSize();", "int getPageSize();", "int getPageSize();", "int getPageSize();", "public int getPageCount() { return _pages.size(); }", "public Integer getPerPage();", "@Override\n\tpublic Page showChargeCarByPage() {\n\t\tList<CarInfoDto> carInfolist = chargeCarMapper.selectCarInfoByPage();\n//\t\tint count = chargeCarMapper.selectCarInfoCount();\n\t\t\n\t\tString count = chargeCarMapper.selectCarInfoCount();\n\t\t//要有一个查询总数的sql\n\t\tSystem.out.println(\"----count----\"+count);\n\t\tPage page = new Page(Integer.parseInt(count), 10,\n\t\t\t\t1);\n\t\tpage.setList(carInfolist);\n\t\tSystem.out.println(carInfolist);\n\t\treturn page;\n\t}", "@Test\n public void getListingsPages_3() throws IOException {\n List<String> listingsPages = imobiParser.getListingPages(TEST_URL_PAGINATION_ABSENT);\n\n Assert.assertThat(listingsPages, notNullValue());\n Assert.assertThat(listingsPages.size(), is(1));\n Assert.assertThat(listingsPages, hasItem(is(TEST_URL_PAGINATION_ABSENT.replaceFirst(\"\\\\{pageNumber\\\\}\", String.valueOf(1)))));\n }", "public void setPages(int pages) {\n this.pages = pages;\n }", "public int getPages() {\n return pages;\n }", "public Integer getPageCount();", "public int getPages(){\n return pages;\n }", "int getPage();", "public int getPages()\n {\n return pages;\n }", "@Override\n public int numberOfPages() {\n // TODO Auto-generated method stub\n throw new UnsupportedOperationException(\"Unsupported operation\");\n }", "public void page()\n {\n com.jayway.restassured.response.Response response= given().relaxedHTTPSValidation().when().get(\"http://18.222.188.206:3333/accounts?_page=3\");\n response.then().assertThat().statusCode(200);\n System.out.println(\"The list of accounts in the page 3 is displayed below:\");\n response.prettyPrint();\n }", "long getPageSize();", "long getPageSize();", "long getPageSize();", "@Override\n\tpublic Integer getTotalPages(ConditionInfo cf) {\n\t\treturn rd.getTotalPages(cf);\n\t}", "@Override\n public int getCount() {\n int TOTAL_PAGES = totalPages;\n return TOTAL_PAGES;\n }", "public int getPages() {\n return pages;\n }", "public int getPages() {\n return pages;\n }", "public int getRowsPerPage();", "public int getTotalPages() {\r\n return totalPages;\r\n }", "private void show(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tInteger page = request.getParameter(\"page\") == \"\" || request.getParameter(\"page\") == null ? 1\r\n\t\t\t\t: Integer.valueOf(request.getParameter(\"page\"));\r\n\t\tint count = service.selectCount();\r\n\t\trequest.setAttribute(\"page\", page);\r\n\t\trequest.setAttribute(\"count\", count);\r\n\t\tList<Notice> list = service.selectAll((page - 1) * 5, 5);\r\n\t\trequest.setAttribute(\"list\", list);\r\n\r\n\t\trequest.getRequestDispatcher(\"/WEB-INF/jsp/GongGaoGuanLi.jsp\").forward(request, response);\r\n\t}", "default Integer getPageSize() {\n return 10;\n }", "int getNumPages();", "@Override\n public int getCount() {\n return PAGE_COUNT;\n }", "public abstract void onLoadMore(int page, int totalItemsCount);", "public abstract void onLoadMore(int page, int totalItemsCount);", "public void setPage(int value) {\n this.page = value;\n }", "protected int getTotalPages(FacesContext context) {\n String forValue = (String) getAttributes().get(\"for\");\n UIData uiData = (UIData) getForm(context).findComponent(forValue);\n if (uiData == null) {\n return 0;\n }\n int rowsPerPage = uiData.getRows(); \n int totalRows = uiData.getRowCount();\n int result = totalRows / rowsPerPage;\n if (0 != (totalRows % rowsPerPage)) {\n result++;\n }\n return result;\n }", "@Override\n\tpublic ThirdPage getThirdPage(String module) {\n\t\treturn thirdPageMapper.findWithModule(module);\n\t}", "private int getResultsPerPage()\n {\n final int RESULTS_0 = 16;\n final int RESULTS_1 = 32;\n final int RESULTS_2 = 46;\n \n int index = filterNumResults.getSelectedIndex();\n switch(index)\n {\n case 0: return RESULTS_0;\n case 1: return RESULTS_1;\n case 2: return RESULTS_2;\n default: return 0;\n }\n }", "public Integer getCurrentPageSize();", "public static void talk() {\r\n\t\t\r\n\t\tif (ths.page == 3) {\r\n\t\t\tths.page++;\r\n\t\t}\r\n\t}", "public static void take() {\r\n\t\t\r\n\t\tif (ths.page == 4) {\r\n\t\t\tths.page++;\r\n\t\t}\r\n\t}", "@Override\n public int getCount() {\n return PAGE_COUNT;\n }", "Integer getPage();", "public int getPageTotalNumber(int totalNumber) {\n/* 70 */ int fullPage = totalNumber / 25;\n/* 71 */ return (totalNumber % 25 > 0) ? (fullPage + 1) : ((fullPage == 0) ? 1 : fullPage);\n/* */ }", "int getPageNumber();", "public int getTotalPages()\r\n {\r\n return pageNames.size()-1;\r\n }", "void loadAll(int pageNum, LoadView mLoadView);", "@Override\r\n\tpublic int getPaging() {\n\t\treturn 0;\r\n\t}", "public void setPageInfo(){\n\t\tif(AllP>=1){\n\t\t\tPageInfo=\"<table border='0' cellpadding='3'><tr><td>\";\n\t\t\tPageInfo+=\"Show: \"+PerR+\"/\"+AllR+\" Records!&nbsp;\";\n\t\t\tPageInfo+=\"Current page: \"+CurrentP+\"/\"+AllP;\n\t\t\tPageInfo+=\"</td></tr></table>\";\t\t\t\n\t\t}\t\t\t\t\n\t}", "public void setPage(Integer page) {\n this.page = page;\n }", "Pages getPages();", "public void setPage(int page) {\n this.page = page;\n }", "public static void main(String[] args) throws Exception {\n PdfDocument doc = new PdfDocument();\r\n //Set margin\r\n PdfUnitConvertor unitCvtr = new PdfUnitConvertor();\r\n PdfMargins margin = new PdfMargins();\r\n margin.setTop(unitCvtr.convertUnits(2.54f, PdfGraphicsUnit.Centimeter, PdfGraphicsUnit.Point));\r\n margin.setBottom(margin.getTop());\r\n margin.setLeft(unitCvtr.convertUnits(3.17f, PdfGraphicsUnit.Centimeter, PdfGraphicsUnit.Point));\r\n margin.setRight(margin.getLeft());\r\n\r\n drawCover(doc.getSections().add(), margin);\r\n drawContent(doc.getSections().add(), margin);\r\n drawPageNumber(doc.getSections().get(1), margin, 1, doc.getSections().get(1).getCount());\r\n\r\n //Save pdf file.\r\n doc.saveToFile(\"output/pagination.pdf\");\r\n doc.close();\r\n }", "private void pagination(){\n recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {\n @Override\n public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {\n super.onScrollStateChanged(recyclerView, newState);\n }\n\n @Override\n public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {\n super.onScrolled(recyclerView, dx, dy);\n\n if (dy>0){\n LinearLayoutManager layoutManager = (LinearLayoutManager) recyclerView.getLayoutManager();\n int lastItem = layoutManager.findLastCompletelyVisibleItemPosition(); //finds last visible item\n int currentTotalCount = layoutManager.getItemCount(); //find total number of displayed items\n\n if (mLoadingItems){\n if (currentTotalCount > previousTotal){\n mLoadingItems = false;\n previousTotal = currentTotalCount;\n }\n }\n if (!mLoadingItems && (currentTotalCount <= (lastItem +view_threshold))) {\n mLoadingItems = true;\n //Increment number of items on the list\n firstItemVisible = firstItemVisible+10;\n lastItemVisible = lastItemVisible+10;\n //Update adapter\n jsonParse();\n }\n }\n }\n });\n }", "private void abreContasPagas() {\n FiltroDataListaFornecedor dataListaFornecedor\n = new FiltroDataListaFornecedor(\n new String[]{\n \"/br/rel/caixa/ContasPagas.jasper\",\n \"MES\",\n \"0\"});\n dataListaFornecedor.setVisible(true);\n }", "@Override\r\n\tpublic int nombrePage() {\n\t\treturn 0;\r\n\t}", "public int getPageCount()\n {\n return _pages.size();\n }", "public int getTotalArticle() {\n int listLimit;\n int total;\n int totalPage;\n listLimit = getArticleRowCount();\n clickGoToLastPageBtn();\n // Has to used this method instead of goToPageBtn().size() since the maximum size of the goToPageBtn list is always 10\n totalPage = Integer.parseInt(goToPageBtn().get(goToPageBtn().size() - 1).getText().trim());\n total = getArticleRowCount() + listLimit * totalPage;\n return total;\n }", "PageInfo list(Date beginDate, Date endDate, List<Integer> resources, int pageNo, int pageSize);", "public int getCount() {\n return 3;\n }", "Optional<Integer> getPageCount();", "void printNumberOfFilteredItems();", "private static void displayBucketCount3() throws IOException {\n\t\tString str=\"\";\n\t\t\n\t\t//bucket count\n\t\tfor(int i:bucketCountT.keySet()){\n\t\t\tstr+=String.valueOf(i)+ \" \" + String.valueOf(bucketCountT.get(i))+\"\\n\";\n\t\t}\n\t\tstr+=\"\\n\";\n\t\twriter3.write(str);\n\t\t\n\t}", "@RequestMapping (\"/members\")\r\n\tpublic String list(@RequestParam(\"page\") int page, Model model) {\n\t\tint pagenumber = page;\r\n\t\tmodel.addAttribute(\"pagenumber\", pagenumber);\r\n\t\t\r\n\t\t//Row count for following calculations\r\n\t\tint maxrows = membersService.getMemberCount();\r\n\t\t\r\n\t\t//Find the Max number of pages and see if an extra page is needed\r\n\t\tif (maxrows >= 7){\r\n\t\t\tint maxpages = maxrows / 7;\r\n\t\t\tint pageTest = maxpages * 7; \r\n\t\t\tint addPage = maxrows - pageTest;\r\n\t\t\tint zero = 0;\r\n\t\t//Add an extra page if TRUE\r\n\t\t\tif (addPage > zero){\r\n\t\t\t\tint extraPage = maxpages + 1;\r\n\t\t\t\tmodel.addAttribute(\"maxpages\", extraPage);\r\n\t\t//Do not add an extra page if FALSE\t\t\r\n\t\t\t}else {\r\n\t\t\t\tmodel.addAttribute(\"maxpages\", maxpages);\r\n\t\t\t}\r\n\t\t//Only one page is needed because at least 7 rows are not available \r\n\t\t}else{\r\n\t\t\tmodel.addAttribute(\"maxpages\", 1);\r\n\t\t }\r\n\t\t//pull the first 7 on page 1\r\n\t\tif (pagenumber <= 1) {\r\n\r\n\t\t\tmodel.addAttribute(\"members\", membersService.getAllMembers(0, 7));\r\n\t\t}else{\r\n\t\t\tint stopSQL = 7; //Offset\r\n\t\t\tint pageNumber = pagenumber - 1; \r\n\t\t\tint startSQL = 7 * pageNumber; //What row should the query start at, e.g. 7 * 2 = 14 (start at row 14 and pull the next 7 rows)\r\n\r\n\t\t\tmodel.addAttribute(\"members\", membersService.getAllMembers(startSQL, stopSQL));\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\t\r\n\t\treturn \"members\";\r\n\t}", "boolean hasPagesize();", "Long pageCount(Long pageSize, Long...params);", "private void pagination()\n {\n if (value==0)\n {\n aBoolean=true;\n setAdapter(postModels);\n value=1;\n count=count+10;\n }\n else if (value==1)\n {\n if (count<page_count)\n {\n aBoolean=true;\n count=count+10;\n temp_list.addAll(postModels);\n adapter.notifyDataSetChanged();\n }\n }\n }", "List<ProductView> getAllByPage(int pageNumber, int itemsPerPage) throws ProductException;", "protected void showPreviousPage() {\n\t\tshowPage(currPageIndex - 1, Direction.BACKWARD);\n\n\t}", "public void setPageItemCount(Integer pageItemCount) {\n this.pageItemCount = pageItemCount;\n }", "public static int pageCount(int n, int p) {\n // Write your code here\n int pagesToCover = 0;\n int midPage = n/2;\n\n if(p>midPage){\n if(n%2==0){\n pagesToCover = n-p+1;\n }else{\n pagesToCover = n-p;\n }\n }else{\n pagesToCover = p;\n }\n int pagesToTurn = 0;\n for(int i=2, j=1; i<=pagesToCover; i=i+2, j++){\n pagesToTurn = j;\n }\n return pagesToTurn;\n }", "@RequestMapping(value=\"/main1\") \n public String main(Model model,Integer start){\n int count=allpageService.getCount();\n System.out.println(count);\n //List<page> pages1=allpageService.getOne((start-1)*8, 8);//start是页数\n model.addAttribute(\"count\",count);//总数\n //model.addAttribute(\"pages\",pages);\n // model.addAttribute(\"pages1\",pages1);//一页\n return \"main\"; \n }", "public void setTotalPageCount(Integer totalPageCount) {\n this.totalPageCount = totalPageCount;\n }", "static int pageCount(int n, int p) {\n \tint i=1;\n int count=0,mid=0,t=0;\n if(n%2==0)\n {\n t=n;\n\n }\n else\n {\n t=n-1;\n\n }\n \tmid=n/2;\n\n if(n==p)\n return 0;\n if(mid>=p){\n while(i<p){\n i=i+2;\n count++;\n }\n }else{\n while(t>p){\n t=t-2;\n count++;\n }\n }\n return count;\n }", "@Override\n\t\tpublic void onLoadMore() {\n\t\t\tpageIndex++;\n\t\t\tloadInfo(pageIndex, 1);\n\t\t\tif (DzqcStu.isDebug) {\n\t\t\t\tLog.i(\"pageIndex------\", pageIndex+\"\");\n\t\t\t}\n\t\t}", "public static int getTotalPage() {\n List<WebElement> PAGINATION = findElements(pagination);\n int size = PAGINATION.size() - 1;\n //Get the number of the second-last item which next to the \">\" icon\n WebElement lastPage = findElement(By.xpath(String.format(last_page, size)));\n return Integer.parseInt(lastPage.getText());\n }", "@Override\r\n\t\tpublic int getCount() {\n\t\t\treturn mPagers.size();\r\n\t\t}", "@Test\n public void pageSizeTest() {\n // TODO: test pageSize\n }", "public String getTotalPage() {\r\n return totalPage;\r\n }", "@Override\r\n\tpublic List<ReviewVO> listPage(int page) throws Exception {\n\t\tif(page<=0) {\r\n\t\t\tpage=1;\r\n\t\t}\r\n\t\t\r\n\t\tpage = (page-1)*10; // 한 페이지에 10개의 글 보이기\r\n\t\t\r\n\t\treturn ss.selectList(\"listPage\", page);\r\n\t}", "public int getTotalPageCount() {\n try {\n return (int) this.webView.getEngine().executeScript(\"PDFViewerApplication.pagesCount;\");\n } catch (RuntimeException e) {\n e.printStackTrace();\n return 0;\n }\n }", "@Override\n public int doStartTag() throws JspException {\n\n int pageCount = (this.recordCount + this.pageSize - 1) / this.pageSize;\n StringBuilder sb = new StringBuilder();\n\n if (this.recordCount != 0 && this.recordCount > this.pageSize) {\n sb.append(\"<ol class=\\\"paginator\\\">\");\n if (this.pageNo > pageCount) {\n this.pageNo = pageCount;\n }\n if (this.pageNo < 1) {\n this.pageNo = 1;\n }\n HttpServletRequest request = (HttpServletRequest) this.pageContext.getRequest();\n\n url = request.getAttribute(\"originalUrl\").toString();\n url += \"?\";\n if (StringUtil.isNotEmpty(request.getQueryString())) {\n String queryString = request.getQueryString();\n url += queryString.replaceAll(\"page=[0-9]*\", \"\");\n if (!url.endsWith(\"&\") && !url.endsWith(\"?\")) {\n url += \"&\";\n }\n }\n\n if (this.pageNo > 1) {\n sb.append(\"<li class=\\\"paginator__item paginator__item--prev\\\"><a class=\\\"paginator__item__text\\\" href='\" + this.url + \"page=\" + (this.pageNo - 1) + \"'><span class=\\\"paginator__item__text__icon\\\"></span></a></li>\");\n }\n int start = 1;\n if (this.pageNo > 4) {\n start = this.pageNo - 1;\n sb.append(\"<li class=\\\"paginator__item paginator__item--number\\\"><a class=\\\"paginator__item__text\\\" href='\" + this.url + \"page=1'>1</a></li>\");\n sb.append(\"<li class=\\\"paginator__item paginator__item--number\\\"><a class=\\\"paginator__item__text\\\" href='\" + this.url + \"page=2'>2</a></li>\");\n sb.append(\"<li class=\\\"paginator__item paginator__item--ellipsis\\\"><span class=\\\"paginator__item__text\\\"><span class=\\\"paginator__item__text__icon\\\"></span></span></li>\");\n }\n int end = this.pageNo + 1;\n if (end > pageCount) {\n end = pageCount;\n }\n for (int i = start; i <= end; i++) {\n if (this.pageNo == i) {\n sb.append(\"<li class=\\\"paginator__item paginator__item--number paginator__item--current\\\"><span class=\\\"paginator__item__text\\\">\" + i + \"</span></li>\");\n } else {\n sb.append(\"<li class=\\\"paginator__item paginator__item--number\\\"><a class=\\\"paginator__item__text\\\" href='\" + this.url + \"page=\" + i + \"'>\").append(i).append(\"</a></li>\");\n }\n }\n if (end < pageCount - 2) {\n sb.append(\"<li class=\\\"paginator__item paginator__item--ellipsis\\\"><span class=\\\"paginator__item__text\\\"><span class=\\\"paginator__item__text__icon\\\"></span></span></li>\");\n }\n if (end < pageCount - 1) {\n sb.append(\"<li class=\\\"paginator__item paginator__item--number\\\"><a class=\\\"paginator__item__text\\\" href='\" + this.url + \"page=\" + (pageCount - 1) + \"'>\").append((pageCount - 1) + \"</a></li>\");\n }\n if (end < pageCount) {\n sb.append(\"<li class=\\\"paginator__item paginator__item--number\\\"><a class=\\\"paginator__item__text\\\" href='\" + this.url + \"page=\" + pageCount + \"'>\").append(pageCount + \"</a></li>\");\n }\n if (this.pageNo != pageCount) {\n sb.append(\"<li class=\\\"paginator__item paginator__item--next\\\"><a class=\\\"paginator__item__text\\\" href='\" + this.url + \"page=\" + (this.pageNo + 1) + \"'><span class=\\\"paginator__item__text__icon\\\"></span></a></li>\");\n }\n }\n if (anchor != null) {\n sb.append(\"<script type='text/javascript'>$('.paginator a').each(function(){var href=$(this).attr('href');$(this).attr('href',href+'\" + anchor + \"')});</script>\");\n }\n sb.append(\"</ol>\");\n try {\n this.pageContext.getOut().println(sb.toString());\n } catch (IOException e) {\n // TODO Auto-generated catch block\n\n e.printStackTrace();\n }\n return 0;\n }", "public int getTotalPages() {\r\n\t\treturn page.getTotalPages();\r\n\t}", "public void checkCountforButtonNextandPrevious() {\n Cursor coo = SQLAbsensi.fetchDatabaseAll();\n\n //Page Next\n if (firstDigit != 0) {\n pageCountStartAt = firstDigit * 10;\n int save = coo.getCount() / 10;\n if (save < firstDigit) {\n pageCountEndAt = (firstDigit + 1) * 10;\n } else {\n pageCountEndAt = firstDigit * 10 + (coo.getCount() % 10);\n myButton = (Button) findViewById(R.id.nextpagebutton);\n myButton.setVisibility(View.INVISIBLE);\n }\n } else {\n pageCountStartAt = 0;\n if (coo.getCount() > 10) {\n pageCountEndAt = 10;\n myButton = (Button) findViewById(R.id.nextpagebutton);\n myButton.setVisibility(View.VISIBLE);\n } else {\n pageCountEndAt = coo.getCount();\n }\n }\n\n //Page Previous\n if (firstDigit > 0) {\n myButton = (Button) findViewById(R.id.previouspagebutton);\n myButton.setVisibility(View.VISIBLE);\n } else {\n myButton = (Button) findViewById(R.id.previouspagebutton);\n myButton.setVisibility(View.INVISIBLE);\n }\n Refresh();\n\n }", "void showResults() throws IOException{\n\t\tCountService cs = CountService.getInstance();\n\t\t\n\t\tout.write(\"/------------------------Resultado Final------------------------/\" + \"\\n\" );\n\t\tout.write(\"O número total de links pesquisados é:\" + cs.getCount() + \"\\n\");\n\t\tout.write(\"O número de links Quebrados é:\" + cs.getCountQueb() + \"\\n\");\n\t\tout.write(\"O número de links ok é:\" + cs.getCountOk() + \"\\n\");\n\t\tout.write(\"O número de links Proibidos é:\" + cs.getCountProibido()+ \"\\n\");\n\t\tout.write(\"O número de métodos impedidos é:\" + cs.getCountImpedido()+ \"\\n\");\n\t\tout.write(\"O número de redirecionados é:\" + cs.getCountRedirecionado()+ \"\\n\");\n\t\tout.write(\"Erro Server:\" + cs.getCountErroServer()+ \"\\n\");\n\t\tout.write(\"Unknown Host Name:\" + cs.getCountUnknownHost()+ \"\\n\");\n\t\tout.write(\"Bad Gatway:\" + cs.getCount502()+ \"\\n\");\n\t\tout.write(\"O número resposta diferente de 4.. e 200 é:\" + cs.getCountPesq() + \"\\n\");\n\t\tout.write(\"/------------------------------------------------------------------/\" + \"\\n\");\n\t\tString dateTime = new SimpleDateFormat(\"dd/MM/yyyy HH:mm\").format(new Date()); \n\t\tout.write(\"Fim dos testes: \" + dateTime + \"\\n\");\n\t\tSystem.out.println(\"Teste finalizado\");\n\t}", "public int getNumPages()\n {\n return numPages;\n }", "PagingLink(int pageNumber) {\n setText(String.valueOf(pageNumber));\n }", "public String getPage(String targetUrl, String q, Long totalCnt, int rows, int start, int page) {\n String paramStr = \"\";\n String htmlPage = \"\";\n String pageUrl = \"\";\n\n int targetPageValue;\n int pagingMin;\n int pageSeed;\n int pageBlock = page;\n int countInPage = page;\n int loopCnt = 0;\n int currentPage = 0;\n\n try {\n double totalPage;\n switch (rows) {\n case 8:\n currentPage = start / 8;\n break;\n case 16:\n currentPage = start / 16;\n break;\n case 24:\n currentPage = start / 24;\n break;\n\n case 10:\n currentPage = start / 10;\n break;\n case 20:\n currentPage = start / 20;\n break;\n case 50:\n currentPage = start / 50;\n break;\n case 100:\n currentPage = start / 100;\n break;\n default:\n currentPage = start / rows;\n break;\n }\n\n pagingMin = ((currentPage - 1) / countInPage) * countInPage;\n if (currentPage > 5) {\n pageSeed = currentPage - 4;\n } else {\n pageSeed = pagingMin;\n }\n double flTotalPage = Float.parseFloat(totalCnt.toString()) / rows;\n\n totalPage = Math.ceil(flTotalPage);\n\n paramStr = \"q=\" + q;\n\n\n\n\n if (currentPage != 0) { //이전\n pageUrl = targetUrl + \"?\" + paramStr + \"&start=\" + (start - rows);\n htmlPage += \"<li><a href=\\\"\" + pageUrl + \"\\\"></a></li>\\n\";\n }\n\n while (loopCnt < pageBlock && pageSeed < totalPage) {\n if (pageSeed == currentPage) {\n targetPageValue = pageSeed;\n htmlPage += \"<li class=\\\"active\\\"><a href=\\\"javascript:;\\\">\" + (targetPageValue + 1) + \"</a></li>\\n\";\n } else {\n targetPageValue = pageSeed;\n pageUrl = targetUrl + \"?\" + paramStr + \"&start=\" + targetPageValue * rows;\n htmlPage += \"<li><a href=\\\"\" + pageUrl + \"\\\">\" + (targetPageValue + 1) + \"</a></li>\\n\";\n }\n pageSeed++;\n loopCnt++;\n }\n\n if (currentPage < totalPage - 1) { //다음\n pageUrl = targetUrl + \"?\" + paramStr + \"&start=\" + (start + rows);\n htmlPage += \"<li><a href=\\\"\" + pageUrl + \"\\\"></a></li>\";\n }\n\n return htmlPage;\n } catch (Exception e) {\n System.out.println(\"getPage : \" + e.toString());\n return \"\";\n }\n }", "private void nextButtonActionPerformed(ActionEvent e) {\n // TODO add your code here\n int remainItem = this.list.size() - 6 * (this.page + 1);\n\n if(remainItem <= 0){\n Warning.run(\"No more page here.\");\n }\n else{\n this.page++;\n this.update();\n }\n }", "public int getNumberOfPages(HttpServletRequest request,\n SubmissionInfo subInfo) throws ServletException\n {\n // always just one page of initial questions\n return 1;\n }", "@Override\r\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\tprgDlg.setMax(nTotalPage);\r\n\t\t\t\t\t\t\tprgDlg.setProgress(nPage);\r\n\t\t\t\t\t\t}", "@Override\n public void onPageChanged(int page, int pageCount) {\n }", "public int getPagesDisplayed() {\n return getTableModelSource().getTableModel().getPageCount();\n }", "@Override\n\t\tpublic int getCount() {\n\t\t\treturn 3;\n\t\t}", "public static void main(String[] args) {\n\t\tint k =1;\n\t\twhile(k < 20){\n\t\t\tif ((k % 3)==1){\n\t\t\t\tSystem.out.print(k + \" \");\n\t\t\t}\n\t\t\tk++;\n\t\t}\n\t}", "@Override\n\t\tpublic void onLoadMore(int page, int totalItemsCount) {\n\t\t\tpresenter.loadRecordsPage(page);\n\t\t}" ]
[ "0.73187506", "0.6635979", "0.65495735", "0.60749024", "0.60535365", "0.60250705", "0.59699196", "0.5968611", "0.5940594", "0.5940594", "0.5940594", "0.5940594", "0.5938626", "0.5930186", "0.5914707", "0.5895975", "0.5858174", "0.58556", "0.5817852", "0.5745203", "0.5739178", "0.5710266", "0.5708721", "0.56875134", "0.5682862", "0.5682862", "0.5682862", "0.5679737", "0.5678609", "0.565334", "0.565334", "0.5632394", "0.56244093", "0.5619149", "0.558525", "0.5576974", "0.5570461", "0.5552678", "0.5552678", "0.5547493", "0.55322737", "0.55246574", "0.55217385", "0.5505417", "0.5495198", "0.5486742", "0.54802644", "0.5479853", "0.5465073", "0.54632634", "0.54175746", "0.54055387", "0.5394055", "0.5391717", "0.5387919", "0.5382126", "0.53555393", "0.53181636", "0.5308578", "0.5300765", "0.52980715", "0.52634084", "0.5262028", "0.5258627", "0.52576417", "0.5255848", "0.52503", "0.5249832", "0.52444947", "0.5244493", "0.5243261", "0.52413106", "0.5229376", "0.5216585", "0.5214916", "0.5210692", "0.52105653", "0.5205769", "0.5202569", "0.5198602", "0.51978225", "0.5194945", "0.5194883", "0.5193554", "0.51911", "0.51897615", "0.5189683", "0.51833856", "0.5182837", "0.51810783", "0.51753247", "0.5169028", "0.5163877", "0.5151503", "0.5148946", "0.5148346", "0.51475805", "0.51386917", "0.5126825", "0.5122696", "0.51153463" ]
0.0
-1
Set whether the client is enabled. This can react to device online/offline state as well as other considerations.
public static synchronized void setEnabled(boolean enabled) { ENABLED = enabled; if (ENABLED) { /* * Try immediately to send any enqueued items. Otherwise another * item must be enqueued before sending is triggered. */ OutputBuffer.sendAllScheduled(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setEnabled(boolean value) {\n m_Enabled = value;\n }", "public void setEnabled(boolean value) {\n this.enabled = value;\n }", "public void enable() {\r\n m_enabled = true;\r\n }", "public boolean setEnabled(boolean enable);", "final public void setEnabled(boolean value) {\n enabledType = value ? ENABLED_ANY : ENABLED_NONE;\n }", "public void setEnabled(Boolean value) { this.myEnabled = value.booleanValue(); }", "public void setEnabled(final boolean enabled);", "public void setEnabled(boolean enabled);", "public void setEnabled(boolean enabled);", "public void setEnabled(boolean enabled) {\n mEnabled = enabled;\n }", "public void setEnable(Boolean enable) {\n this.enable = enable;\n }", "public void setEnabled(Boolean enabled) {\r\n this.enabled = enabled;\r\n }", "@Override public void setEnabled(boolean enabled) {\n super.setEnabled(enabled);\n\n m_globalEnabled = enabled;\n checkEnabled();\n }", "public void setEnable(Boolean enable) {\n this.enable = enable;\n }", "public void setEnabled(boolean enabled) {\n this.enabled = enabled;\n }", "public void enableClient(){\r\n try{\r\n oos.writeObject(new DataWrapper(DataWrapper.CTCODE, new ControlToken(ControlToken.ENABLECODE)));\r\n oos.flush();\r\n } catch(IOException ioe) {\r\n ioe.printStackTrace();\r\n }\r\n }", "public void setEnabled(boolean enabled) {\r\n this.enabled = enabled;\r\n }", "public void setEnabled(boolean enabled) {\r\n this.enabled = enabled;\r\n }", "void setEnabled(boolean enabled);", "void setEnabled(boolean enabled);", "void setEnabled(boolean enabled);", "void setEnabled(boolean enabled);", "public void setEnabled(Boolean enabled) {\n this.enabled = enabled;\n }", "public void setEnabled(Boolean enabled) {\n this.enabled = enabled;\n }", "public void setEnabled(Boolean enabled) {\n this.enabled = enabled;\n }", "public void setEnabled(Boolean enabled) {\n this.enabled = enabled;\n }", "public void setEnable(boolean enable) {\n this.enable = enable;\n }", "public void enable()\r\n\t{\r\n\t\tenabled = true;\r\n\t}", "public void enable ( ) {\r\n\t\tenabled = true;\r\n\t}", "@ReactMethod\n public void setEnabled(Boolean enabled) {\n wifi.setWifiEnabled(enabled);\n }", "public void setEnabled(boolean enabled) {\n this.enabled = enabled;\n }", "public void setEnabled(boolean enabled) {\n this.enabled = enabled;\n }", "public void setEnabled(boolean enabled) {\n this.enabled = enabled;\n }", "public void setEnabled(boolean enabled) {\n this.enabled = enabled;\n }", "public void setEnabled(boolean enabled) {\n this.enabled = enabled;\n }", "public final void setEnabled( boolean enabled )\n {\n this.enabled = enabled;\n }", "@Override\r\n public void setEnabled(final boolean b) {\r\n _enabled = b;\r\n }", "public void setEnable(Boolean enable) {\n this.enable = enable;\n }", "public void enable() {\n\t\tenabled = true;\n\t\t//System.out.println(\"Enabled Controller\");\n\t}", "@Override\n public void setEnabled(boolean enabled) {\n }", "public void setEnable(Boolean enable) {\n\t\tthis.enable = enable;\n\t}", "public void setEnabled(boolean newValue) {\n this.isEnabled = newValue;\n if (newValue) {\n if (isInternalSensor) {\n InternalSensors.getInstance().enableInternalSensor(this);\n } else {\n // TODO: enable external sensors\n }\n } else {\n saveSensor();\n if (isInternalSensor) {\n InternalSensors.getInstance().disableInternalSensor(this);\n } else {\n // TODO: disable external sensors\n }\n }\n }", "public void setEnabled(boolean aFlag) { _enabled = aFlag; }", "public void setEnabled(boolean enabled) {\r\n\t\tthis.enabled = enabled;\r\n\t}", "public void setEnable (boolean state) {\n impl.setEnable (state);\n }", "public void setEnabled(boolean enabled) {\n\t\tthis.enabled = enabled;\n\t\tfireChange();\n\t}", "@Override\n public void setEnabled(boolean val) {\n super.setEnabled(val);\n mEnabled = val;\n }", "public void enable() {\n\t\tm_enabled = true;\n\t\tm_controller.reset();\n\t}", "public void setEnable(Boolean enable) {\n\t\tthis.enable = enable;\n\t}", "public void enable() {\n disabled = false;\n updateSign(true);\n circuit.enable();\n notifyChipEnabled();\n }", "public void setIsEnable(Boolean isEnable) {\n\t\tthis.isEnable = isEnable;\n\t}", "public void setEnabled(final boolean theFlag) {\n myEnabled = theFlag;\n }", "public void setEnabled(boolean enabled) {\r\n\t}", "public abstract void setEnabled(Context context, boolean enabled);", "public void setEnabled(java.lang.Boolean enabled) {\n this.enabled = enabled;\n }", "public void setOnline() {\n if (this.shutdownButton.isSelected() == false) {\n this.online = true;\n this.statusLed.setStatus(\"ok\");\n this.updateOscilloscopeData();\n }\n }", "public void setEnabled(String enabled) {\r\n\t\tthis.enabled = enabled;\r\n\t}", "final public void setEnabled(int value) {\n enabledType = value;\n }", "@Override\n\tpublic void setEnabled(boolean flag) {\n\t\t\n\t}", "public void enable() {\n \t\t\tsetEnabled(true);\n \t\t}", "public void setEnabled(Boolean isEnabled) {\r\r\n\t\tthis._isEnabled = isEnabled;\r\r\n\t}", "public void setIsEnable(String isEnable) {\n this.isEnable = isEnable == null ? null : isEnable.trim();\n }", "@ReactMethod\n public void setEnabled(final boolean isEnabled) {\n MainThreadHandler.runOnMainThread(new Runnable() {\n @Override\n public void run() {\n try {\n if (isEnabled) {\n BugReporting.setState(Feature.State.ENABLED);\n } else {\n BugReporting.setState(Feature.State.DISABLED);\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n });\n\n }", "public void setEnabled(boolean enabled) {\n synchronized (mBinder) {\n if (mEnabled == enabled) {\n return;\n }\n\n mEnabled = enabled;\n }\n\n ILocationProviderManager manager = mManager;\n if (manager != null) {\n try {\n manager.onSetEnabled(mEnabled);\n } catch (RemoteException | RuntimeException e) {\n Log.w(mTag, e);\n }\n }\n }", "public Builder setEnabled(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n enabled_ = value;\n onChanged();\n return this;\n }", "public void setEnable(String enable) {\r\n this.enable = enable == null ? null : enable.trim();\r\n }", "public static void ToggleEnabled()\n {\n \t\tEnabled = !Enabled;\n \t\tConfigHandler.configFile.save();\n \t \t\n }", "public void setEnabled(UIEvent.Type aType, boolean aValue) { getEventAdapter(true).setEnabled(aType, aValue); }", "public void setIsClient(java.lang.Boolean _isClient)\n {\n isClient = _isClient;\n }", "public void setEnabled (boolean enabled) {\r\n\tcheckWidget ();\r\n\tint topHandle = topHandle ();\r\n\tint flags = enabled ? 0 : OS.Pt_BLOCKED | OS.Pt_GHOST;\r\n\tOS.PtSetResource (topHandle, OS.Pt_ARG_FLAGS, flags, OS.Pt_BLOCKED | OS.Pt_GHOST);\r\n}", "public void setEnabled(boolean enabled) {\n mBundle.putBoolean(KEY_ENABLED, enabled);\n }", "public boolean setEnabled(boolean notifyEnabled) {\n boolean oldState = this.enabled;\n this.enabled = notifyEnabled;\n return oldState;\n }", "public boolean isEnable() {\n return _enabled;\n }", "private void updateDemoModeEnabled() {\n boolean z = false;\n if (Settings.Global.getInt(getContext().getContentResolver(), \"sysui_demo_allowed\", 0) != 0) {\n z = true;\n }\n this.mEnabledSwitch.setChecked(z);\n this.mOnSwitch.setEnabled(z);\n }", "public void enable() {\n TalonHelper.configNeutralMode(Arrays.asList(armMotor, armMotorSlave), NeutralMode.Brake);\n }", "public boolean isEnable() {\n return enable;\n }", "public Builder setIsLocalClient(boolean value) {\n \n isLocalClient_ = value;\n onChanged();\n return this;\n }", "public void setEnabled(boolean arg){\r\n\t\tenabled = arg;\r\n\t\tif(!arg){\r\n\t\t\tstop(0);\r\n\t\t}\r\n\t\telse{\r\n\t\t\tsonido = new Sonido(path,true);\r\n\t\t}\r\n\t}", "public void enable(){\r\n\t\tthis.activ = true;\r\n\t}", "public void setEnabled(boolean isEnabled) {\r\n this.isEnabled = isEnabled;\r\n \r\n if (isEnabled) {\r\n lineActivity.clear();\r\n }\r\n }", "public void testModeEnable(boolean enable) {\n if(enable)\n sapServer.setTestMode(SapMessage.TEST_MODE_ENABLE);\n else\n sapServer.setTestMode(SapMessage.TEST_MODE_DISABLE);\n }", "public synchronized void setEnabled(boolean enabled) {\n \t\t\tlistenerEnabled = enabled;\n \t\t}", "public synchronized void setEnabled(boolean enabled)\n {\n if (requestQueue != null)\n {\n requestQueue.setEnabled(enabled);\n }\n }", "public void enableConferenceServer(boolean enable);", "public void setEnabled(boolean enabled) {\n synchronized (mLock) {\n Slog.i(TAG, \"Explicit health checks \" + (enabled ? \"enabled.\" : \"disabled.\"));\n mEnabled = enabled;\n }\n }", "protected void setEnabled(boolean state) {\n enabled = state;\n log.warn(\"{} command has been {}.\", name, state ? \"enabled\" : \"disabled\");\n }", "@Override\n public void setEventAcquisitionEnabled(boolean enable) throws HardwareInterfaceException {\n if ( input != null ){\n input.setPaused(enable);\n }\n if ( isOpen() ){\n String s = enable ? \"t+\\r\\n\" : \"t-\\r\\n\";\n byte[] b = s.getBytes();\n try{\n DatagramPacket d = new DatagramPacket(b,b.length,client);\n if (socket != null){\n socket.send(d);\n }\n } catch ( Exception e ){\n log.warning(e.toString());\n }\n }\n eventAcquisitionEnabled = enable;\n }", "public Boolean isEnable() {\n return this.enable;\n }", "@Override\n public void enable() {\n if (!sensorEnabled) {\n //Log.d(TAG, \"start app tracking\");\n sensorEnabled = true;\n new AppObserver().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);\n }\n }", "public void turnOn() {\n\t\tOn = true;\n\t}", "private void enableSensor() {\n if (DEBUG) Log.d(TAG, \">>> Sensor \" + getEmulatorFriendlyName() + \" is enabled.\");\n mEnabledByEmulator = true;\n mValue = null;\n\n Message msg = Message.obtain();\n msg.what = SENSOR_STATE_CHANGED;\n msg.obj = MonitoredSensor.this;\n notifyUiHandlers(msg);\n }", "public void onNotEnabled() {\n Timber.d(\"onNotEnabled\");\n // keep the callback in case they turn it on manually\n setTorPref(Status.DISABLED);\n createClearnetClient();\n status = Status.NOT_ENABLED;\n if (onStatusChangedListener != null) {\n new Thread(() -> onStatusChangedListener.notEnabled()).start();\n }\n }", "public Boolean isEnable() {\n\t\treturn enable;\n\t}", "public void enable() {\n operating = true;\n }", "public Boolean enable() {\n return this.enable;\n }", "public static void setOnline(boolean flag) {\r\n ONLINE = flag;\r\n }", "public void setEnabled(boolean is_enabled){\n\t\tswingComponent.setEnabled(is_enabled);\n\t}", "public void setEnabled(boolean enabled) {\n this.enabled = enabled;\n if (enabled)\n sinkEvents(Event.ONCLICK | Event.ONKEYDOWN);\n else\n unsinkEvents(Event.ONCLICK | Event.ONKEYDOWN);\n }", "public void setClientMode(boolean clientMode) {\n this.clientMode = clientMode;\n }", "public void enable() {\n\t\tif (!permanent) {\n\t\t\tenabled = true;\n\t\t\trect.setColor(c);\n\t\t}\n\t}" ]
[ "0.7293475", "0.72485", "0.70286036", "0.69507176", "0.6896474", "0.6779052", "0.67536426", "0.6731144", "0.6731144", "0.6723176", "0.6720934", "0.670201", "0.6699232", "0.6669022", "0.66678035", "0.66664124", "0.66578585", "0.66578585", "0.66577315", "0.66577315", "0.66577315", "0.66577315", "0.66487336", "0.66487336", "0.66487336", "0.66487336", "0.6647482", "0.6638046", "0.6625794", "0.6624669", "0.659315", "0.659315", "0.659315", "0.659315", "0.659315", "0.6576168", "0.65698177", "0.65605545", "0.65390193", "0.6534671", "0.65219396", "0.6515266", "0.651355", "0.650017", "0.649898", "0.6472325", "0.6439685", "0.6431059", "0.6426605", "0.6407659", "0.64044344", "0.64035743", "0.6376789", "0.6369146", "0.6365291", "0.6332083", "0.6321156", "0.6272131", "0.62697184", "0.6232803", "0.62046313", "0.61911476", "0.61834973", "0.6153468", "0.6148313", "0.6129169", "0.6115238", "0.6111345", "0.60953116", "0.6071008", "0.6070354", "0.6054283", "0.6036019", "0.6022623", "0.60207146", "0.60166556", "0.6015087", "0.60129434", "0.60060626", "0.60060537", "0.59964174", "0.59944123", "0.59834796", "0.596833", "0.5962027", "0.5940724", "0.5931355", "0.5921999", "0.5918796", "0.5917862", "0.5917077", "0.5916796", "0.59109193", "0.59047794", "0.5896012", "0.5893988", "0.5892643", "0.5855993", "0.5853219", "0.58498627" ]
0.5944745
85
Submit an event to be enqueued and sent to the Event Platform
public static synchronized void submit(Event event) { StreamConfig streamConfig = STREAM_CONFIGS.get(event.getStream()); if (streamConfig == null) { return; } if (!SamplingController.isInSample(event)) { return; } addEventMetadata(event); // // Temporarily send events immediately in order to investigate discrepancies in // the numbers of events submitted in this system vs. legacy eventlogging. // // https://phabricator.wikimedia.org/T281001 // // OutputBuffer.schedule(event); OutputBuffer.sendEventsForStream(streamConfig, Collections.singletonList(event)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void submit(Event event) {\n\t\tthis.eventManager.submit(event);\n\t}", "@Override\n\tpublic void publishMessage(QPEvent event) {\n\t\tfor(final String endpoint : webhookRegistry.all()) {\n\t\t\tlog.debug(\"POSTing event to {}\", endpoint);\n\t\t\t\n\t\t\ttry {\n\t\t\t\tCloseableHttpAsyncClient httpClient = HttpAsyncClients.createDefault();\n\t\t\t\thttpClient.start();\n\t\t\t\t\n\t\t\t\tHttpPost post = new HttpPost(endpoint);\n\t\t\t\tpost.setHeader(\"Content-Type\", \"application/json\");\n\t\t\t\tpost.setEntity(new StringEntity(objectMapper.writeValueAsString(event), \"UTF-8\"));\n\t\t\t\t\n\t\t\t\thttpClient.execute(post, new FutureCallback<HttpResponse>() {\n\t\t\t\t\t\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void failed(Exception ex) {\n\t\t\t\t\t\tlog.warn(\"Request for endpoint {} failed, removing endpoint\", endpoint);\n\t\t\t\t\t\twebhookRegistry.remove(endpoint);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void completed(HttpResponse result) {\n\t\t\t\t\t\tlog.debug(\"Request for endpoint {} completed\", endpoint);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void cancelled() {\n\t\t\t\t\t\tlog.debug(\"Request for endpoint {} cancelled\", endpoint);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} catch(Exception x) {\n\t\t\t\tlog.error(\"Error handling event.\", x);\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void postEvent(Event event)\n {\n normalQueue.offer(event);\n }", "public void postEvent(Event event) {\n eventQueue.postEvent(event);\n }", "public void sendEvent(Event event);", "public Event publish(Address resource, String event, int expires, Content body);", "void publish(Event event) throws PublishingException;", "public void enqueueEvent(InputEvent event) {\n events.add(event);\n }", "@Override\n\tpublic synchronized <T> Future<T> sendEvent(Event<T> e) {\n\n\t\tif (typesQueue != null && !typesQueue.isEmpty())\n\t\t{\n\t\t\tFuture future=new Future();\n\t\t\tif(subscribersMessages!=null)\n\t\t\t{\n\t\t\t\tSubscriber temp = typesQueue.get(e.getClass()).peek();\n\t\t\t\tif(temp!=null)\n\t\t\t\t{\n\t\t\t\t\tsubscribersMessages.get(temp).add(e);\n\t\t\t\t\troundRubbin(typesQueue.get(e.getClass()));\n\t\t\t\t\tresults.put(e,future);\n\t\t\t\t\tnotifyAll();\n\t\t\t\t\treturn future;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\treturn null;\n\n\t\t\t}\n\t\t}\n\n\t\t\treturn null;\n\t}", "@Override\n\tpublic <T> Future<T> sendEvent(Event<T> e) {\n\t\tif(!registrationHashMap.containsKey(e)) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\t// retrieving list of microservices subscribed to this type of event\n\t\t\tArrayList<MicroService> a = registrationHashMap.get(e);\n\t\t\t// first microservice in \"queue will receive the message\n\t\t\tMicroService m = a.get(0);\n\t\t\tint index = registeredMicroservice.indexOf(m);\n\t\t\tmicroserviceMessageQueue.get(index).add(e);\n\t\t\t//round robin implementation - after microservice receives a message it is removed and added\n\t\t\t// in order to keep a linear order in which subscribed microservices receive event\n\t\t\tregistrationHashMap.get(e).remove(m);\n\t\t\tregistrationHashMap.get(e).add(m);\n\t\t\t//Future<Event> result = new Future();\n\t\t\treturn null; //WHAT TO RETURNNNN\n\t\t}\n\t}", "private void postEvent(){\n final Map<String, Object> eventDocData = new HashMap<>();\n eventDocData.put(\"address\", newEvent.getAddress());\n eventDocData.put(\"author\", newEvent.getAuthor());\n eventDocData.put(\"categories\", newEvent.getCategories());\n eventDocData.put(\"date\", newEvent.getDate());\n eventDocData.put(\"description\", newEvent.getDescription());\n eventDocData.put(\"distanceFromUser\", 0);\n eventDocData.put(\"event18\", false);\n eventDocData.put(\"event21\", false);\n eventDocData.put(\"eventKey\", newEvent.getEventKey());\n eventDocData.put(\"lat\", newEvent.getLat());\n eventDocData.put(\"lon\", newEvent.getLon());\n eventDocData.put(\"notificationOnly\", null);\n eventDocData.put(\"paid\", true);\n eventDocData.put(\"radius\", null);\n eventDocData.put(\"time\", null);\n\n //Compress and Upload\n purchaseProgressBar.setVisibility(View.VISIBLE);\n\n //Compress Image\n File profileImgFile = new File(mainImgURI.getPath());\n try {\n compressedImageFile = new Compressor(PurchaseEventActivity.this).setQuality(85).compressToBitmap(profileImgFile);\n } catch (IOException e) {\n e.printStackTrace();\n }\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n compressedImageFile.compress(Bitmap.CompressFormat.JPEG, 100, baos);\n byte[] imgData = baos.toByteArray();\n\n //Upload Img & Name\n UploadTask setupUpload = storageReference.child(\"events\").child(newEvent.getEventKey() + \".jpg\").putBytes(imgData);\n\n setupUpload.addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n Uri download_uri = taskSnapshot.getDownloadUrl();\n eventDocData.put(\"pathToImage\", download_uri);\n\n //Send to Firebase\n firebaseFirestore.collection(\"events\").document(newEvent.getEventKey())\n .set(eventDocData)\n .addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n Toast.makeText(PurchaseEventActivity.this, \"Event Posted!\", Toast.LENGTH_SHORT).show();\n Intent mainIntent = new Intent(PurchaseEventActivity.this, MainActivity.class);\n startActivity(mainIntent);\n finish();\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n purchaseProgressBar.setVisibility(View.INVISIBLE);\n Toast.makeText(PurchaseEventActivity.this, \"There Was an Issue Posting Your Event. Please Contact Support.\", Toast.LENGTH_LONG).show();\n }\n });\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n String error = e.getMessage();\n Toast.makeText(PurchaseEventActivity.this, \"Posting Error. Please Contact Support.\", Toast.LENGTH_LONG).show();\n\n purchaseProgressBar.setVisibility(View.INVISIBLE);\n }\n });\n }", "void dispatchEvent(DistributedEvent event);", "public void eventPost(String name, String description, String date, String startTime, String endTime){\n Callback<Events> callback = new Callback<Events>() {\n @Override\n public void success(Events serverResponse, Response response2) {\n if(serverResponse.getResponseCode() == 0){\n BusProvider.getInstance().post(produceEventServerResponse(serverResponse));\n }else{\n BusProvider.getInstance().post(produceErrorEvent(serverResponse.getResponseCode(),\n serverResponse.getMessage()));\n }\n }\n\n @Override\n public void failure(RetrofitError error) {\n if(error != null ){\n Log.e(TAG, error.getMessage());\n error.printStackTrace();\n }\n BusProvider.getInstance().post(produceErrorEvent(-200,error.getMessage()));\n }\n };\n communicatorInterface.postEvent(name, description, date, startTime, endTime, callback);\n }", "@Override @SuppressWarnings(\"unchecked\")\n\tpublic <T> Future<T> sendEvent(Event<T> e) {\n\t\tMicroService ms=null;\n\t\tConcurrentLinkedQueue<MicroService> queue=null;\n\t\tFuture future=null;\t\t\t\t\t\t\t\t\t// init to null in case no suitable Microservice handler was found.\n\t\tif(eventToMicroHandlers.get(e.getClass())!=null)\n\t\tsynchronized (eventToMicroHandlers.get(e.getClass())) { // lock on individual event queue only.\n\t\t\tqueue = eventToMicroHandlers.get(e.getClass());\n\t\t\tif (queue != null) { //else //this Event does not exist, Meaning no microservice handler ever subscribed to handle this event , reaching here means fatal error.\n\t\t\t\tms=queue.poll();\n\t\t\t\tif (ms!=null){ //else //No Microservices to handle this event were found, meaning microservices did subscribe to handle this event, but they were removed using the unsubscribe function.\n\t\t\t\t\tqueue.add(ms);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(ms!=null){\n\t\t\tfuture=new Future();\n\t\t\tEventToFuture.put(e,future);\n\t\t\tif(microToQueue.get(ms)!=null) {\n\t\t\t\tsynchronized (microToQueue.get(ms)) {\n\t\t\t\t\tif(microToQueue.get(ms)!=null) {\n\t\t\t\t\t\tmicroToQueue.get(ms).add(e);\n\t\t\t\t\t\tmicroToQueue.get(ms).notify(); // used to notify awaitMessage that there is a message in queue for him. , notifies on Personal queue object belonging to specific microservice.\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn null;\n\n\t\t}\n\t\treturn future;\n\n\t}", "@Override\n public void publish(Object event) {\n System.out.println(\"Sending Event\");\n\n List<Hub> hubList = hubFacade.findAll();\n Iterator<Hub> it = hubList.iterator();\n while (it.hasNext()) {\n Hub hub = it.next();\n restEventPublisher.publish(hub, event);\n\n\n //Thread.currentThread().sleep(1000);\n }\n System.out.println(\"Sending Event After\");\n }", "public void postEvent(final IpcEvent event) {\n\t\tif (eventQueue != null) {\n\t\t\teventQueue.add(event);\n\t\t}\n\t}", "public void post(Object event);", "@Async\n\tpublic void publishMessage(QPEvent event) throws Exception {\n\t\t\n\t\tif(webhookService.isEnabled()) {\n\t\t\tlog.debug(\"Webhook service enabled, publishing...\");\n\t\t\twebhookService.publishMessage(event);\n\t\t}\n\t\t\n\t\tif(websocketService.isEnabled()) {\n\t\t\tlog.debug(\"Websocket service enabled, publishing...\");\n\t\t\twebsocketService.publishMessage(event);\n\t\t}\n\t}", "@SuppressWarnings(\"unchecked\")\n public void fireEvent(final Event event) {\n try {\n final List<EventListener<? extends Event>> eventListeners = this.eventListeners.get(event.getType());\n eventListeners.forEach(listener -> {\n final HandleEventTask task = new HandleEventTask(event, listener);\n this.taskRunner.submitTask(task);\n });\n } catch (Exception e) {\n logger.error(\"Unexpected error when firing event: {}\", event, e);\n }\n }", "@Override\n public void publish(final EventData data) {\n LOGGER.debug(\"async event {} published via vert.x EventBus\", data.getData().ret$PQON());\n if (bus != null) {\n final EventParameters attribs = data.getData();\n if (attribs instanceof GenericEvent genericEvent) {\n bus.publish(toBusAddress(genericEvent.getEventID()), data, ASYNC_EVENTBUS_DELIVERY_OPTIONS);\n } else {\n bus.publish(toBusAddress(attribs.ret$PQON()), data, ASYNC_EVENTBUS_DELIVERY_OPTIONS);\n }\n } else {\n LOGGER.error(\"event bus is null - discarding event {}\", data.getData().ret$PQON());\n }\n }", "public static synchronized void insert(JeyEvent e) {\n queue.addLast(e);\r\n EventQueue.class.notifyAll();\r\n }", "public void run()\n {\n Event event = request.getEvent();\n if (logger.isDebugEnabled())\n logger.debug(\"Processing event: \"\n + event.getClass().getSimpleName());\n\n EventStatus status = null;\n try\n {\n if (request.isCancelRequested())\n {\n // If the event is cancelled note it.\n status = new EventStatus(false, true, null);\n if (logger.isDebugEnabled())\n logger.debug(\"Skipped cancelled event: \"\n + event.getClass().getSimpleName());\n }\n else\n {\n // Mark the request as started and submit to state machine.\n request.started();\n sm.applyEvent(event);\n status = new EventStatus(true, false, null);\n if (logger.isDebugEnabled())\n logger.debug(\"Applied event: \"\n + event.getClass().getSimpleName());\n }\n }\n catch (InterruptedException e)\n {\n // Handle an interruption, which could happen if we are cancelled\n // while executing.\n status = new EventStatus(false, true, e);\n logger.debug(String.format(\"Failed to apply event %s, reason=%s\",\n event, e.getLocalizedMessage()));\n }\n catch (Throwable e)\n {\n // Handle a failure.\n status = new EventStatus(false, false, e);\n logger.debug(String.format(\"Failed to apply event %s, reason=%s\",\n event, e.getLocalizedMessage()));\n }\n finally\n {\n // We need to store the status and call the completion\n // listener, if any. This must happen regardless of any\n // exception that occurs.\n try\n {\n if (listener != null)\n request.setAnnotation(listener.onCompletion(event, status));\n }\n catch (InterruptedException e)\n {\n // Do nothing; this is the end of the road for this task.\n }\n catch (Throwable e)\n {\n logger.error(\"Unexpected failure while calling listener\", e);\n }\n finally\n {\n // Make sure we record the request state no matter what to\n // prevent hangs.\n request.setStatus(status);\n }\n }\n }", "@Override\n public Void run() throws Exception {\n Callable<Job> jobCreator = ReflectionUtils.newInstance(jobConfig.getJobCreator(), jobConfiguration);\n Job job = jobCreator.call();\n job.submit();\n\n // Blocking mode is only for testing\n if(waitForCompletition) {\n job.waitForCompletion(true);\n }\n\n // And generate event with further job details\n EventRecord event = getContext().createEventRecord(\"job-created\", 1);\n Map<String, Field> eventMap = ImmutableMap.of(\n \"tracking-url\", Field.create(job.getTrackingURL()),\n \"job-id\", Field.create(job.getJobID().toString())\n );\n event.set(Field.create(eventMap));\n getContext().toEvent(event);\n return null;\n }", "public void publishEvent(PlatformEvent event, String endpointURI) {\r\n\t\t((PlatformEventProducer)this.servicesContext.getBean(DEFAULT_EVENT_PRODUCER)).publishEvent(event);\r\n\t}", "public void publish(final Event event) {\r\n if (event == null)\r\n return;\r\n\r\n new Thread(new Runnable() {\r\n public void run() {\r\n int attempts = 0;\r\n while(++attempts < 20) {\r\n try {\r\n int uniqueID = server.publish(event);\r\n if (uniqueID != 0)\r\n pubEvents.add(event.setID(uniqueID) );\r\n return;\r\n } catch(RemoteException e) {\r\n System.err.println(\"Could not connect to server. Retrying...\");\r\n try {\r\n Thread.sleep(800);\r\n } catch(Exception ex) {\r\n ex.printStackTrace();\r\n }\r\n }\r\n }\r\n System.err.println(\"Couldn't Publish Event: \" + event.getID() + \" - \" + event.getTitle());\r\n }\r\n }).start();\r\n }", "@Override\n public void send(final EventData data) {\n LOGGER.debug(\"async event {} sent via vert.x EventBus\", data.getData().ret$PQON());\n if (bus != null) {\n final EventParameters attribs = data.getData();\n if (attribs instanceof GenericEvent genericEvent) {\n bus.send(toBusAddress(genericEvent.getEventID()), data, ASYNC_EVENTBUS_DELIVERY_OPTIONS);\n } else {\n bus.send(toBusAddress(attribs.ret$PQON()), data, ASYNC_EVENTBUS_DELIVERY_OPTIONS);\n }\n } else {\n LOGGER.error(\"event bus is null - discarding event {}\", data.getData().ret$PQON());\n }\n }", "private void routeQueuedEvent() {\n \t\t\n \t\tfinal SleeTransactionManager txMgr = this.container.getTransactionManager();\n \t\t\t\t\n \t\tboolean rollbackTx = true;\n \t\t\n \t\ttry {\n \n \t\t\tEventContextImpl eventContextImpl = de.getEventRouterActivity().getCurrentEventContext();\n \t\t\tif (eventContextImpl == null) {\t\t\t\t\n \t\t\t\tif (logger.isDebugEnabled())\n \t\t\t\t\tlogger.debug(\"\\n\\n\\nDelivering event : [[[ eventId \"\n \t\t\t\t\t\t\t+ de.getEventTypeId() + \" on ac \"+de.getActivityContextId()+\"\\n\");\n \t\t\t\t\n \t\t\t\t// event context not set, create it \n \t\t\t\teventContextImpl = new EventContextImpl(de,container);\n \t\t\t\tde.getEventRouterActivity().setCurrentEventContext(eventContextImpl);\n \t\t\t\t// do initial event processing\n \t\t\t\tEventTypeComponent eventTypeComponent = container.getComponentRepositoryImpl().getComponentByID(de.getEventTypeId());\n \t\t\t\tif (logger.isDebugEnabled()) {\n \t\t\t\t\tlogger.debug(\"Active services for event \"+de.getEventTypeId()+\": \"+eventTypeComponent.getActiveServicesWhichDefineEventAsInitial());\n \t\t\t\t}\n \t\t\t\tfor (ServiceComponent serviceComponent : eventTypeComponent.getActiveServicesWhichDefineEventAsInitial()) {\n \t\t\t\t\tif (de.getService() == null || de.getService().equals(serviceComponent.getServiceID())) {\n \t\t\t\t\t\tinitialEventProcessor.processInitialEvents(serviceComponent, de, txMgr, this.container.getActivityContextFactory());\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t\telse {\n \t\t\t\tif (eventContextImpl.isSuspendedNotTransacted()) {\n \t\t\t\t\tif (logger.isDebugEnabled())\n \t\t\t\t\t\tlogger.debug(\"\\n\\n\\nFreezing (due to suspended context) event delivery : [[[ eventId \"\n \t\t\t\t\t\t\t\t+ de.getEventTypeId() + \" on ac \"+de.getActivityContextId()+\"\\n\");\n \t\t\t\t\teventContextImpl.barrierEvent(de);\n \t\t\t\t\treturn;\n \t\t\t\t}\n \t\t\t\telse {\n \t\t\t\t\tif (logger.isDebugEnabled())\n \t\t\t\t\t\tlogger.debug(\"\\n\\n\\nResuming event delivery : [[[ eventId \"\n \t\t\t\t\t\t\t+ de.getEventTypeId() + \" on ac \"+de.getActivityContextId()+\"\\n\");\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\t// For each SBB that is attached to this activity context.\n \t\t\tboolean gotSbb = false;\n \t\t\tdo {\n \t\t\t\t\n \t\t\t\tString rootSbbEntityId = null;\n \t\t\t\tClassLoader invokerClassLoader = null;\n \t\t\t\tSbbEntity sbbEntity = null;\n \t\t\t\tSbbObject sbbObject = null;\n \n \t\t\t\ttry {\n \n \t\t\t\t\t/*\n \t\t\t\t\t * Start of SLEE Originated Invocation Sequence\n \t\t\t\t\t * ============================================== This\n \t\t\t\t\t * sequence consists of either: 1) One \"Op Only\" SLEE\n \t\t\t\t\t * Originated Invocation - in the case that it's a\n \t\t\t\t\t * straightforward event routing for the sbb entity. 2) One\n \t\t\t\t\t * \"Op and Remove\" SLEE Originated Invocation - in the case\n \t\t\t\t\t * it's an event routing to a root sbb entity that ends up\n \t\t\t\t\t * in a remove to the same entity since the attachment count\n \t\t\t\t\t * goes to zero after the event invocation 3) One \"Op Only\"\n \t\t\t\t\t * followed by one \"Remove Only\" SLEE Originated Invocation -\n \t\t\t\t\t * in the case it's an event routing to a non-root sbb\n \t\t\t\t\t * entity that ends up in a remove to the corresponding root\n \t\t\t\t\t * entity since the root attachment count goes to zero after\n \t\t\t\t\t * the event invocation Each Invocation Sequence is handled\n \t\t\t\t\t * in it's own transaction. All exception handling for each\n \t\t\t\t\t * invocation sequence is handled here. Any exceptions that\n \t\t\t\t\t * propagate up aren't necessary to be caught. -Tim\n \t\t\t\t\t */\n \n \t\t\t\t\t// If this fails then we propagate up since there's nothing to roll-back anyway\n \t\t\t\t\t\n \t\t\t\t\ttxMgr.begin();\n \t\t\t\t\t\n \t\t\t\t\tActivityContext ac = null;\n \t\t\t\t\tException caught = null;\n \t\t\t\t\tSbbEntity highestPrioritySbbEntity = null;\n \t\t\t\t\tClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();\n \t\t\t\t\t\n \t\t\t\t\tSet<String> sbbEntitiesThatHandledCurrentEvent = eventContextImpl.getSbbEntitiesThatHandledEvent();\n \t\t\t\t\t\n \t\t\t\t\ttry {\n \t\t\t\t\t\n \t\t\t\t\t\tac = container.getActivityContextFactory().getActivityContext(de.getActivityContextId(),true);\n \n \t\t\t\t\t\ttry {\n \t\t\t\t\t\t\thighestPrioritySbbEntity = nextSbbEntityFinder.next(ac, de.getEventTypeId(), de.getService(), sbbEntitiesThatHandledCurrentEvent);\n \t\t\t\t\t\t} catch (Exception e) {\n \t\t\t\t\t\t\tlogger.warn(\"Failed to find next sbb entity to deliver the event \"+de+\" in \"+ac.getActivityContextId(), e);\n \t\t\t\t\t\t\thighestPrioritySbbEntity = null;\n \t\t\t\t\t\t}\n \n \t\t\t\t\t\tif (highestPrioritySbbEntity == null) {\n \t\t\t\t\t\t\tgotSbb = false;\n \t\t\t\t\t\t\tsbbEntitiesThatHandledCurrentEvent.clear();\t\t\t\t\t\t\n \t\t\t\t\t\t} else {\n \t\t\t\t\t\t\tgotSbb = true;\n \t\t\t\t\t\t\tsbbEntitiesThatHandledCurrentEvent.add(highestPrioritySbbEntity.getSbbEntityId());\t\n \t\t\t\t\t\t}\n \n \t\t\t\t\t\tif (gotSbb) {\n \n \t\t\t\t\t\t\tif (logger.isDebugEnabled()) {\n \t\t\t\t\t\t\t\tlogger\n \t\t\t\t\t\t\t\t\t\t.debug(\"Highest priority SBB entity, which is attached to the ac \"+de.getActivityContextId()+\" , to deliver the event: \"\n \t\t\t\t\t\t\t\t\t\t\t\t+ highestPrioritySbbEntity.getSbbEntityId());\n \t\t\t\t\t\t\t}\n \n \t\t\t\t\t\t\t// CHANGE CLASS LOADER\n \t\t\t\t\t\t\tinvokerClassLoader = highestPrioritySbbEntity.getSbbComponent().getClassLoader();\n \t\t\t\t\t\t\tThread.currentThread().setContextClassLoader(invokerClassLoader);\n \n \t\t\t\t\t\t\tsbbEntity = highestPrioritySbbEntity;\n \t\t\t\t\t\t\trootSbbEntityId = sbbEntity.getRootSbbId();\n \n \t\t\t\t\t\t\tEventRouterThreadLocals.setInvokingService(sbbEntity.getServiceId());\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t\t// Assign an sbb from the pool\n \t\t\t\t\t\t\tsbbEntity.assignAndActivateSbbObject();\n \t\t\t\t\t\t\tsbbObject = sbbEntity.getSbbObject();\n \t\t\t\t\t\t\tsbbObject.sbbLoad();\n \n \t\t\t\t\t\t\t// GET AND CHECK EVENT MASK FOR THIS SBB ENTITY\n \t\t\t\t\t\t\tSet eventMask = sbbEntity.getMaskedEventTypes(de.getActivityContextId());\n \t\t\t\t\t\t\tif (!eventMask.contains(de.getEventTypeId())) {\n \n \t\t\t\t\t\t\t\t// TIME TO INVOKE THE EVENT HANDLER METHOD\n \t\t\t\t\t\t\t\tsbbObject.setSbbInvocationState(SbbInvocationState.INVOKING_EVENT_HANDLER);\n \t\t\t\t\t\t\t\t\n \t\t\t\t\t\t\t\tif (logger.isDebugEnabled()) {\n \t\t\t\t\t\t\t\t\tlogger\n \t\t\t\t\t\t\t\t\t\t\t.debug(\"---> Invoking event handler: ac=\"+de.getActivityContextId()+\" , sbbEntity=\"+sbbEntity.getSbbEntityId()+\" , sbbObject=\"+sbbObject);\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\tsbbEntity.invokeEventHandler(de,ac,eventContextImpl);\n \n \t\t\t\t\t\t\t\tif (logger.isDebugEnabled()) {\n \t\t\t\t\t\t\t\t\tlogger\n \t\t\t\t\t\t\t\t\t\t\t.debug(\"<--- Invoked event handler: ac=\"+de.getActivityContextId()+\" , sbbEntity=\"+sbbEntity.getSbbEntityId()+\" , sbbObject=\"+sbbObject);\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// check to see if the transaction is marked for\n \t\t\t\t\t\t\t\t// rollback if it is then we need to get out of\n \t\t\t\t\t\t\t\t// here soon as we can.\n \t\t\t\t\t\t\t\tif (txMgr.getRollbackOnly()) {\n \t\t\t\t\t\t\t\t\tthrow new Exception(\"The transaction is marked for rollback\");\n \t\t\t\t\t\t\t\t}\n \n \t\t\t\t\t\t\t\tsbbObject.setSbbInvocationState(SbbInvocationState.NOT_INVOKING);\n \t\t\t\t\t\t\t\t\n \t\t\t\t\t\t\t} else {\n \t\t\t\t\t\t\t\tif (logger.isDebugEnabled()) {\n \t\t\t\t\t\t\t\t\tlogger\n \t\t\t\t\t\t\t\t\t\t\t.debug(\"Not invoking event handler since event is masked\");\n \t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t}\n \n \t\t\t\t\t\t\t// IF IT'S AN ACTIVITY END EVENT DETACH SBB ENTITY HERE\n \t\t\t\t\t\t\tif (de.getEventTypeId().equals(ActivityEndEventImpl.EVENT_TYPE_ID)) {\n \t\t\t\t\t\t\t\tif (logger.isDebugEnabled()) {\n \t\t\t\t\t\t\t\t\tlogger\n \t\t\t\t\t\t\t\t\t\t\t.debug(\"The event is an activity end event, detaching ac=\"+de.getActivityContextId()+\" , sbbEntity=\"+sbbEntity.getSbbEntityId());\n \t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\thighestPrioritySbbEntity.afterACDetach(de.getActivityContextId());\n \t\t\t\t\t\t\t}\n \n \t\t\t\t\t\t\t// CHECK IF WE CAN CLAIM THE ROOT SBB ENTITY\n \t\t\t\t\t\t\tif (rootSbbEntityId != null) {\n \t\t\t\t\t\t\t\tif (SbbEntityFactory.getSbbEntity(rootSbbEntityId).getAttachmentCount() != 0) {\n \t\t\t\t\t\t\t\t\tif (logger.isDebugEnabled()) {\n \t\t\t\t\t\t\t\t\t\tlogger\n \t\t\t\t\t\t\t\t\t\t\t\t.debug(\"Not removing sbb entity \"+sbbEntity.getSbbEntityId()+\" , the attachment count is not 0\");\n \t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t\t// the root sbb entity is not be claimed\n \t\t\t\t\t\t\t\t\trootSbbEntityId = null;\n \t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t} else {\n \t\t\t\t\t\t\t\t// it's a root sbb\n \t\t\t\t\t\t\t\tif (!sbbEntity.isRemoved()\t&& sbbEntity.getAttachmentCount() == 0) {\n \t\t\t\t\t\t\t\t\tif (logger.isDebugEnabled()) {\n \t\t\t\t\t\t\t\t\t\tlogger\n \t\t\t\t\t\t\t\t\t\t\t\t.debug(\"Removing sbb entity \"+sbbEntity.getSbbEntityId()+\" , the attachment count is not 0\");\n \t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t\t// If it's the same entity then this is an\n \t\t\t\t\t\t\t\t\t// \"Op and\n \t\t\t\t\t\t\t\t\t// Remove Invocation Sequence\"\n \t\t\t\t\t\t\t\t\t// so we do the remove in the same\n \t\t\t\t\t\t\t\t\t// invocation\n \t\t\t\t\t\t\t\t\t// sequence as the Op\n \t\t\t\t\t\t\t\t\tSbbEntityFactory.removeSbbEntityWithCurrentClassLoader(sbbEntity,true);\n \t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t}\n \t\t\t\t\t} catch (Exception e) {\n \t\t\t\t\t\tlogger.error(\"Failure while routing event; second phase. DeferredEvent [\"+ de.getEventTypeId() + \"]\", e);\n \t\t\t\t\t\tif (highestPrioritySbbEntity != null) {\n \t\t\t\t\t\t\tsbbObject = highestPrioritySbbEntity.getSbbObject();\n \t\t\t\t\t\t}\n \t\t\t\t\t\tcaught = e;\n \t\t\t\t\t} \n \t\t\t\t\t\t\t\t\t\t\n \t\t\t\t\t// do a final check to see if there is another SBB to\n \t\t\t\t\t// deliver.\n \t\t\t\t\t// We don't want to waste another loop. Note that\n \t\t\t\t\t// rollback\n \t\t\t\t\t// will not has any impact on this because the\n \t\t\t\t\t// ac.DeliveredSet\n \t\t\t\t\t// is not in the cache.\n \t\t\t\t\tif (gotSbb) {\n \t\t\t\t\t\ttry {\n \t\t\t\t\t\t\tif (nextSbbEntityFinder.next(ac, de.getEventTypeId(),de.getService(),sbbEntitiesThatHandledCurrentEvent) == null) {\n \t\t\t\t\t\t\t\tgotSbb = false;\n \t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (Throwable e) {\n \t\t\t\t\t\t\tgotSbb = false;\n \t\t\t\t\t\t} \n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif (!gotSbb) {\n\t\t\t\t\t\tde.eventProcessingSucceed();\n\t\t\t\t\t\tif (logger.isDebugEnabled()) {\n\t\t\t\t\t\t\tlogger.debug(\"Delaying commit for 100ms, needed by wrongly designed tck transaction isolation tests. This only happens with DEBUG log level\");\n\t\t\t\t\t\t\tThread.sleep(100);\n\t\t\t\t\t\t}\t\t\t\t\t\t\n \t\t\t\t\t}\n\t\t\t\t\t\n \t\t\t\t\tThread.currentThread().setContextClassLoader(\n \t\t\t\t\t\t\toldClassLoader);\n \n \t\t\t\t\tboolean invokeSbbRolledBack = handleRollback.handleRollback(sbbObject, caught, invokerClassLoader,txMgr);\n \n \t\t\t\t\tboolean invokeSbbRolledBackRemove = false;\n \t\t\t\t\tClassLoader rootInvokerClassLoader = null;\n \t\t\t\t\tSbbEntity rootSbbEntity = null;\n \n \t\t\t\t\tif (!invokeSbbRolledBack && rootSbbEntityId != null) {\n \t\t\t\t\t\t/*\n \t\t\t\t\t\t * If we get here this means that we need to do a\n \t\t\t\t\t\t * cascading remove of the root sbb entity - since the\n \t\t\t\t\t\t * original invocation was done on a non-root sbb entity\n \t\t\t\t\t\t * then this is done in a different SLEE originated\n \t\t\t\t\t\t * invocation, but inside the same SLEE originated\n \t\t\t\t\t\t * invocation sequence. Confused yet? This is case 3) in\n \t\t\t\t\t\t * my previous comment - the SLEE originated invocation\n \t\t\t\t\t\t * sequence contains two SLEE originated invocations:\n \t\t\t\t\t\t * One \"Op Only\" and One \"Remove Only\" This is the\n \t\t\t\t\t\t * \"Remove Only\" part. We don't bother doing this if we\n \t\t\t\t\t\t * already need to rollback\n \t\t\t\t\t\t */\n \n \t\t\t\t\t\tcaught = null;\n \n \t\t\t\t\t\toldClassLoader = Thread.currentThread().getContextClassLoader();\n \n \t\t\t\t\t\ttry {\n \t\t\t\t\t\t\trootSbbEntity = SbbEntityFactory.getSbbEntity(rootSbbEntityId);\n \n \t\t\t\t\t\t\trootInvokerClassLoader = rootSbbEntity.getSbbComponent().getClassLoader();\n \t\t\t\t\t\t\tThread.currentThread().setContextClassLoader(rootInvokerClassLoader);\n \n \t\t\t\t\t\t\tSbbEntityFactory.removeSbbEntity(rootSbbEntity,true);\n \n \t\t\t\t\t\t} catch (Exception e) {\n \t\t\t\t\t\t\tlogger.error(\"Failure while routing event; third phase. Event Posting [\"+ de + \"]\", e);\n \t\t\t\t\t\t\tcaught = e;\n \t\t\t\t\t\t} finally {\n \n \t\t\t\t\t\t\tThread.currentThread().setContextClassLoader(oldClassLoader);\n \t\t\t\t\t\t}\n \n \t\t\t\t\t\t// We have no target sbb object in a Remove Only SLEE\n \t\t\t\t\t\t// originated invocation\n \t\t\t\t\t\t// FIXME emmartins review\n \t\t\t\t\t\tinvokeSbbRolledBackRemove = handleRollback.handleRollback(null, caught, rootInvokerClassLoader,txMgr);\n \t\t\t\t\t}\n \n \t\t\t\t\t/*\n \t\t\t\t\t * We are now coming to the end of the SLEE originated\n \t\t\t\t\t * invocation sequence We may need to run sbbRolledBack This\n \t\t\t\t\t * is done in the same tx if there is no target sbb entity\n \t\t\t\t\t * in any of the SLEE originated invocations making up this\n \t\t\t\t\t * SLEE originated invocation sequence Otherwise we do it in\n \t\t\t\t\t * a separate tx for each SLEE originated invocation that\n \t\t\t\t\t * has a target sbb entity. In other words we might have a\n \t\t\t\t\t * maximum of 2 sbbrolledback callbacks invoked in separate\n \t\t\t\t\t * tx in the case this SLEE Originated Invocation Sequence\n \t\t\t\t\t * contained an Op Only and a Remove Only (since these have\n \t\t\t\t\t * different target sbb entities) Pretty obvious really! ;)\n \t\t\t\t\t */\n \t\t\t\t\tif (invokeSbbRolledBack && sbbEntity == null) {\n \t\t\t\t\t\t// We do it in this tx\n \t\t\t\t\t\thandleSbbRollback.handleSbbRolledBack(null, sbbObject, null, null, invokerClassLoader, false, txMgr);\n \t\t\t\t\t} else if (sbbEntity != null && !txMgr.getRollbackOnly()\n \t\t\t\t\t\t\t&& sbbEntity.getSbbObject() != null) {\n \n \t\t\t\t\t\tsbbObject.sbbStore();\n \t\t\t\t\t\tsbbEntity.passivateAndReleaseSbbObject();\n \n \t\t\t\t\t}\n \n \t\t\t\t\tif (txMgr.getRollbackOnly()) {\n \t\t\t\t\t\tif (logger.isDebugEnabled()) {\n \t\t\t\t\t\t\tlogger\n \t\t\t\t\t\t\t\t\t.debug(\"Rolling back SLEE Originated Invocation Sequence\");\n \t\t\t\t\t\t}\n \t\t\t\t\t\ttxMgr.rollback();\n \t\t\t\t\t} else {\n \t\t\t\t\t\tif (logger.isDebugEnabled()) {\n \t\t\t\t\t\t\tlogger\n \t\t\t\t\t\t\t\t\t.debug(\"Committing SLEE Originated Invocation Sequence\");\n \t\t\t\t\t\t}\n \t\t\t\t\t\ttxMgr.commit();\n \t\t\t\t\t}\n \n \t\t\t\t\t/*\n \t\t\t\t\t * Now we invoke sbbRolledBack for each SLEE originated\n \t\t\t\t\t * invocation that had a target sbb entity in a new tx - the\n \t\t\t\t\t * new tx creating is handled inside the handleSbbRolledBack\n \t\t\t\t\t * method\n \t\t\t\t\t */\n \t\t\t\t\tif (invokeSbbRolledBack && sbbEntity != null) {\n \t\t\t\t\t\t// Firstly for the \"Op only\" or \"Op and Remove\" part\n \t\t\t\t\t\tsbbEntity.getSbbEntityId();\n \t\t\t\t\t\tif (logger.isDebugEnabled()) {\n \t\t\t\t\t\t\tlogger\n \t\t\t\t\t\t\t\t\t.debug(\"Invoking sbbRolledBack for Op Only or Op and Remove\");\n \n \t\t\t\t\t\t}\n \t\t\t\t\t\t//FIXME: baranowb: de is passed for test: tests/sbb/abstractclass/SbbRolledBackNewTransaction.xml\n \t\t\t\t\t\thandleSbbRollback.handleSbbRolledBack(sbbEntity, null, de, new ActivityContextInterfaceImpl(ac), invokerClassLoader, false, txMgr);\n \t\t\t\t\t}\n \t\t\t\t\tif (invokeSbbRolledBackRemove) {\n \t\t\t\t\t\t// Now for the \"Remove Only\" if appropriate\n \t\t\t\t\t\thandleSbbRollback.handleSbbRolledBack(rootSbbEntity, null, null, null, rootInvokerClassLoader, true, txMgr);\t\t\t\t\t\t\n \t\t\t\t\t}\n \n \t\t\t\t\t/*\n \t\t\t\t\t * A note on exception handling here- Any exceptions thrown\n \t\t\t\t\t * further further up that need to be caught in order to\n \t\t\t\t\t * handle rollback or otherwise maintain consistency of the\n \t\t\t\t\t * SLEE state are all handled further up I.e. We *do not*\n \t\t\t\t\t * need to call rollback here. So any exceptions that get\n \t\t\t\t\t * here do not result in the SLEE being in an inconsistent\n \t\t\t\t\t * state, therefore we just log them and carry on.\n \t\t\t\t\t */\n \n \t\t\t\t\trollbackTx = false;\n \t\t\t\t} catch (RuntimeException e) {\n \t\t\t\t\tlogger.error(\n \t\t\t\t\t\t\t\"Unhandled RuntimeException in event router: \", e);\n \t\t\t\t} catch (Exception e) {\n \t\t\t\t\tlogger.error(\"Unhandled Exception in event router: \", e);\n \t\t\t\t} catch (Error e) {\n \t\t\t\t\tlogger.error(\"Unhandled Error in event router: \", e);\n \t\t\t\t\tthrow e; // Always rethrow errors\n \t\t\t\t} catch (Throwable t) {\n \t\t\t\t\tlogger.error(\"Unhandled Throwable in event router: \", t);\n \t\t\t\t} finally {\n \t\t\t\t\ttry {\n \t\t\t\t\t\tif (txMgr.getTransaction() != null) {\n \t\t\t\t\t\t\tif (rollbackTx) {\n \t\t\t\t\t\t\t\tlogger\n \t\t\t\t\t\t\t\t\t\t.error(\"Rolling back tx in routeTheEvent.\");\n \t\t\t\t\t\t\t\ttxMgr.rollback();\n \t\t\t\t\t\t\t} else {\n \t\t\t\t\t\t\t\tlogger\n \t\t\t\t\t\t\t\t\t\t.error(\"Transaction left open in routeTheEvent! It has to be pinned down and fixed! Debug information follows.\");\n \t\t\t\t\t\t\t\tlogger.error(txMgr\n \t\t\t\t\t\t\t\t\t\t.displayOngoingSleeTransactions());\n \t\t\t\t\t\t\t\ttxMgr.commit();\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t}\n \t\t\t\t\t} catch (SystemException se) {\n \n \t\t\t\t\t\tlogger.error(\"Failure in TX operation\", se);\n \t\t\t\t\t}\n \t\t\t\t\tif (sbbEntity != null) {\n \t\t\t\t\t\tif (logger.isDebugEnabled()) {\n \t\t\t\t\t\t\tlogger\n \t\t\t\t\t\t\t\t\t.debug(\"Finished delivering the event \"\n \t\t\t\t\t\t\t\t\t\t\t+ de.getEventTypeId()\n \t\t\t\t\t\t\t\t\t\t\t+ \" to the sbbEntity = \"\n \t\t\t\t\t\t\t\t\t\t\t+ sbbEntity.getSbbEntityId()\n \t\t\t\t\t\t\t\t\t\t\t+ \"]]] \\n\\n\\n\");\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tEventRouterThreadLocals.setInvokingService(null);\n \t\t\t\t\n \t\t\t\tif (eventContextImpl.isSuspendedNotTransacted()) {\n \t\t\t\t\tif (logger.isDebugEnabled())\n \t\t\t\t\t\tlogger.debug(\"\\n\\n\\nSuspended event delivery : [[[ eventId \"\n \t\t\t\t\t\t\t+ de.getEventTypeId() + \" on ac \"+de.getActivityContextId()+\"\\n\");\n \t\t\t\t\treturn;\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// need to ensure gotSbb = false if and only if iter.hasNext()\n \t\t\t\t// == false\n \t\t\t} while (gotSbb);\n \n \t\t\t\n \t\t\t/*\n \t\t\t * End of SLEE Originated Invocation Sequence\n \t\t\t * ==========================================\n \t\t\t * \n \t\t\t */\n \n \t\t\tif (de.getEventTypeId().equals(ActivityEndEventImpl.EVENT_TYPE_ID)) {\n \t\t\t\tactivityEndEventPostProcessor.process(de.getActivityContextId(), txMgr, this.container.getActivityContextFactory());\n \t\t\t} else if (de.getEventTypeId().equals(TimerEventImpl.EVENT_TYPE_ID)) {\n \t\t\t\ttimerEventPostProcessor.process(de,this.container.getTimerFacility());\n\t\t\t}\t\t\t\n \n \t\t\t// we got to the end of the event routing, remove the event context\n \t\t\tde.getEventRouterActivity().setCurrentEventContext(null);\n \t\t\t// manage event references\n \t\t\tDeferredEventReferencesManagement eventReferencesManagement = container.getEventRouter().getDeferredEventReferencesManagement();\n \t\t\teventReferencesManagement.eventUnreferencedByActivity(de.getEvent(), de.getActivityContextId());\n \t\t\t\n \t\t} catch (Exception e) {\n \t\t\tlogger.error(\"Unhandled Exception in event router top try\", e);\n \t\t}\n \t}", "@Transactional\n @PostMapping(\"/fire-event\")\n public ResponseEntity<Void> fireEvent(@RequestBody IBMQEventPayload payload) {\n service.fireEvent(payload);\n return new ResponseEntity<>(HttpStatus.OK);\n }", "public final void event(final JSONObject builddata) {\n logger.fine(\"Sending event\");\n\n // Gather data\n JSONObject payload = new JSONObject();\n String hostname = nullSafeGetString(builddata, \"hostname\");\n String number = nullSafeGetString(builddata, \"number\");\n String buildurl = nullSafeGetString(builddata, \"buildurl\");\n String job = nullSafeGetString(builddata, \"job\");\n long timestamp = builddata.getLong(\"timestamp\");\n String message = \"\";\n\n // Setting source_type_name here, to allow modification based on type of event\n payload.put(\"source_type_name\", \"jenkins\");\n\n // Build title\n StringBuilder title = new StringBuilder();\n title.append(job).append(\" build #\").append(number);\n if ( \"SUCCESS\".equals( builddata.get(\"result\") ) ) {\n title.append(\" succeeded\");\n payload.put(\"alert_type\", \"success\");\n message = \"%%% \\n [See results for build #\" + number + \"](\" + buildurl + \") \";\n } else if ( builddata.get(\"result\") != null ) {\n title.append(\" failed\");\n payload.put(\"alert_type\", \"failure\");\n message = \"%%% \\n [See results for build #\" + number + \"](\" + buildurl + \") \";\n } else {\n title.append(\" started\");\n payload.put(\"alert_type\", \"info\");\n message = \"%%% \\n [Follow build #\" + number + \" progress](\" + buildurl + \") \";\n // Remove source_type_name to keep started events from being rolled up\n payload.remove(\"source_type_name\");\n }\n title.append(\" on \").append(hostname);\n\n // Add duration\n if ( builddata.get(\"duration\") != null ) {\n message = message + durationToString(builddata.getDouble(\"duration\"));\n }\n\n // Close markdown\n message = message + \" \\n %%%\";\n\n // Build payload\n payload.put(\"title\", title.toString());\n payload.put(\"text\", message);\n payload.put(\"date_happened\", timestamp);\n payload.put(\"event_type\", builddata.get(\"event_type\"));\n payload.put(\"host\", hostname);\n payload.put(\"result\", builddata.get(\"result\"));\n payload.put(\"tags\", assembleTags(builddata));\n payload.put(\"aggregation_key\", job); // Used for job name in event rollups\n\n post(payload, this.EVENT);\n }", "public String execute() {\n\t\ttry {\n\t\t\treturnMsg = MESSAGE_EVENT_ADDED;\n\t\t\tcheckEventClash();\n\t\t\tstoreEvent();\n\t\t\treturn returnMsg;\n\t\t} catch (IOException e) {\n\t\t\treturn MESSAGE_EVENT_ERROR;\n\t\t} finally {\n\t\t\tupdateView();\n\t\t\tMagical.setCurrentTab(\"events\");\n\t\t}\n\t}", "public void submit(Task task) {\n\t\tthis.engine.pushTask(task);\n\t}", "private Void postDataToApi() throws IOException, ParseException {\r\n // List the next 10 events from the primary calendar.\r\n // Quick-add an event\r\n // Refer to the Java quickstart on how to setup the environment:\r\n // https://developers.google.com/google-apps/calendar/quickstart/java\r\n // Change the scope to CalendarScopes.CALENDAR and delete any stored\r\n // credentials.\r\n\r\n Event event = new Event()\r\n .setSummary(calendarText)\r\n .setLocation(martLocation)\r\n .setDescription(\"Reminder to eat healthy food!\");\r\n\r\n DateTime startDateTime = new DateTime(shoppingDateTime);\r\n EventDateTime start = new EventDateTime()\r\n .setDateTime(startDateTime)\r\n .setTimeZone(\"America/New_York\");\r\n event.setStart(start);\r\n DateTime endDateTime = new DateTime(shoppingDateTime);\r\n EventDateTime end = new EventDateTime()\r\n .setDateTime(endDateTime)\r\n .setTimeZone(\"America/New_York\");\r\n event.setEnd(end);\r\n String calendarId = \"primary\";\r\n event = mService.events().insert(calendarId, event).execute();\r\n System.out.printf(\"Event created: %s\\n\", event.getHtmlLink());\r\n return null;\r\n }", "@Override\n public void execute() {\n eslClient.getEventNotificationService().register(newEventNotificationConfig(URL)\n .forEvent(EVENT1)\n .forEvent(EVENT2)\n .forEvent(EVENT3));\n\n // Get the registered event notifications\n eventNotificationConfig = eslClient.getEventNotificationService().getEventNotificationConfig();\n }", "public void onClick(ClickEvent event) {\r\n System.out.println(\"Submit Button geklickt\");\r\n handleEvent();\r\n }", "java.util.concurrent.Future<CreateEventIntegrationResult> createEventIntegrationAsync(CreateEventIntegrationRequest createEventIntegrationRequest);", "private void send() {\n vertx.eventBus().publish(GeneratorConfigVerticle.ADDRESS, toJson());\n }", "public Response fire(EventI event);", "@Override //to be moved to Cloud service\r\n\tpublic void createEvent(String eventName) {\n\t\t\r\n\t}", "@Override\n public void publish(Event<? extends Enum, ?> event) {\n byte[] body = null;\n if (null == event) {\n log.error(\"Captured event is null...\");\n return;\n }\n if (event instanceof DeviceEvent) {\n body = bytesOf(MQUtil.json((DeviceEvent) event));\n } else if (event instanceof TopologyEvent) {\n body = bytesOf(MQUtil.json((TopologyEvent) event));\n } else if (event instanceof LinkEvent) {\n body = bytesOf(MQUtil.json((LinkEvent) event));\n } else {\n log.error(\"Invalid event: '{}'\", event);\n return;\n }\n processAndPublishMessage(body);\n }", "void enqueue(E e);", "public Event createOneShotPublish(Address resource, String event);", "public void submit() {\n fileUploadContainer.upload.submit();\n }", "void registerEventBusForEvent( EventBus eventBus, Consumer<List<? extends EventMessage<?>>> messageProcessor );", "public void submit(OrderInternal order_, OrderManagementContext orderManagementContext_);", "public void submitOrder(BeverageOrder order);", "public Event createPublish(Address resource, String event, int expires);", "@Test\n void sendEvents() {\n // Arrange\n final String messageId = UUID.randomUUID().toString();\n final SendOptions options = new SendOptions().setPartitionId(PARTITION_ID);\n final EventHubProducerAsyncClient producer = toClose(builder.buildAsyncProducerClient());\n final List<EventData> events = TestUtils.getEvents(NUMBER_OF_EVENTS, messageId);\n final PartitionProperties information = producer.getPartitionProperties(PARTITION_ID).block();\n\n assertNotNull(information, \"Should receive partition information.\");\n\n final EventPosition position = EventPosition.fromSequenceNumber(information.getLastEnqueuedSequenceNumber());\n final EventHubConsumerAsyncClient consumer = toClose(builder\n .consumerGroup(EventHubClientBuilder.DEFAULT_CONSUMER_GROUP_NAME)\n .buildAsyncConsumerClient());\n\n // Act\n StepVerifier.create(producer.send(events, options))\n .expectComplete()\n .verify(TIMEOUT);\n\n // Assert\n logger.info(\"Waiting to receive events.\");\n StepVerifier.create(consumer.receiveFromPartition(PARTITION_ID, position)\n .filter(x -> TestUtils.isMatchingEvent(x, messageId)).take(NUMBER_OF_EVENTS))\n .expectNextCount(NUMBER_OF_EVENTS)\n .expectComplete()\n .verify(TIMEOUT);\n }", "public interface EventBus {\n\n public String name();\n\n /**\n * Posts an event to all registered subscribers. This method will return successfully after the\n * event has been posted to all subscribers, and regardless of any exceptions thrown by\n * subscribers.\n *\n * @param event event to post.\n */\n public void post(Object event);\n\n}", "public interface EventBusProducer {\n void post(final Answer answer);\n}", "public void add(IEvent event){\r\n\t\tqueue.add(event);\r\n\t}", "public void submitOrder() throws BackendException;", "private void submit() {\r\n\t\tassignTracked();\r\n\t\tBkitPoma.startLoading(constants.BkitPoma_startLoading_wating());\r\n\t\tpostSubmit();\r\n\t}", "static synchronized void schedule(Event event) {\n if (ENABLED || QUEUE.size() <= MAX_QUEUE_SIZE) {\n QUEUE.add(event);\n }\n\n if (ENABLED) {\n if (QUEUE.size() >= MAX_QUEUE_SIZE) {\n sendAllScheduled();\n } else {\n //The arrival of a new item interrupts the timer and resets the countdown.\n WikipediaApp.getInstance().getMainThreadHandler().removeCallbacks(SEND_RUNNABLE);\n WikipediaApp.getInstance().getMainThreadHandler().postDelayed(SEND_RUNNABLE, WAIT_MS);\n }\n }\n }", "public static void createEvent(String token){\n ensureGraphClient(token);\n\n LinkedList<Option> requestOptions = new LinkedList<Option>();\n //requestOptions.add(new HeaderOption(\"Authorization\", \"Bearer nupl9.C5rb]aO5:yvT:3L.TKcH7tB1Im\" ));\n\n // Participantes:\n LinkedList<Attendee> attendeesList = new LinkedList<Attendee>();\n Attendee mentor = new Attendee();\n Attendee mentorado = new Attendee();\n\n EmailAddress mentorMail = new EmailAddress();\n mentorMail.address = \"[email protected]\";\n mentorMail.name = \"Daniell Wagner\";\n mentor.emailAddress = mentorMail;\n\n EmailAddress mentoradoMail = new EmailAddress();\n mentoradoMail.address = \"[email protected]\";\n mentoradoMail.name = \"Guilherme Carneiro\";\n mentorado.emailAddress = mentoradoMail;\n\n mentor.type = AttendeeType.REQUIRED;\n mentorado.type = AttendeeType.REQUIRED;\n\n attendeesList.add(mentor);\n attendeesList.add(mentorado);\n\n // Evento:\n Event event = new Event();\n event.subject = \"Mentoria com \" + mentor.emailAddress.name;\n\n ItemBody body = new ItemBody();\n body.contentType = BodyType.HTML;\n body.content = \"\" +\n \"<b>Mentoria sobre SCRUM</b> <br>\" +\n \"Olá, \" + mentorado.emailAddress.name + \" <br> \" +\n \"Você tem uma mentoria marcada com o mentor \"\n + mentor.emailAddress.name + \"!!\";\n\n event.body = body;\n\n DateTimeTimeZone start = new DateTimeTimeZone();\n start.dateTime = \"2020-03-26T16:00:00\";\n start.timeZone = \"Bahia Standard Time\";\n event.start = start;\n\n DateTimeTimeZone end = new DateTimeTimeZone();\n end.dateTime = \"2020-03-26T18:00:00\";\n end.timeZone = \"Bahia Standard Time\";\n event.end = end;\n\n Location location = new Location();\n location.displayName = \"Stefanini Campina Grande\";\n event.location = location;\n\n event.attendees = attendeesList;\n\n try {\n graphClient.me().calendar().events()\n .buildRequest()\n .post(event);\n }catch(Exception e) {\n\n System.out.println(\"Deu águia: \");\n e.printStackTrace();\n }\n }", "public void performSubmit() {\n\t\tgetWrappedElement().submit();\n\t}", "public void asyncFire(EventI event);", "public void sendEmployeeEvent(EmployeeEvent employeeEvent) throws JsonProcessingException {\n\n Integer key = employeeEvent.getEmpEventId();\n String value = objectMapper.writeValueAsString(employeeEvent);\n ListenableFuture<SendResult<Integer, String>> listenableFuture = kafkaTemplate.sendDefault(key, value); // sendDefault is of type Listenable future\n listenableFuture.addCallback(new ListenableFutureCallback<SendResult<Integer, String>>() { // Call back is of success and failure types\n @Override\n public void onFailure(Throwable e) {\n handleFailure(key, value, e);\n }\n\n @Override\n public void onSuccess(SendResult<Integer, String> result) { // Published message is successful\n handleSuccess(key, value, result);\n }\n });\n\n }", "@Override\n public void Submit() {\n }", "public void transmitEvents(){\n Log.info(\"Transmitting Events\", EventShare.class);\n for(Entry<Class, List<EventTrigger>> eventGroup: HandlerRegistry.getHandlers().entrySet()){\n String annotation = eventGroup.getKey().getName();\n for(EventTrigger trigger : eventGroup.getValue()){\n if(trigger.getServer()!=this) { // do not send own events...\n if(trigger.getMethod()!=null){ // its a local event\n if(trigger.getMethod().isAnnotationPresent(ES.class)){\n try {\n eventBusServer.write(new ESSharedEvent(annotation, trigger.getTrigger()));\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }else {\n try {\n eventBusServer.write(new ESSharedEvent(annotation, trigger.getTrigger()));\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }\n }\n }\n }", "public void enqueue(E e) {\n\t\tsynchronized(mutex){\n\t\t\ttry {\n\t\t\t\tqueue.add(e);\n\t\t\t} catch(NullPointerException ex) {\n\t\t\t\tthrow new NullPointerException(\"enqueued null element\");\n\t\t\t} catch (ClassCastException ex) {\n\t\t\t\tthrow new ClassCastException(\"enqueued element is incompetible type\");\n\t\t\t}\n\t\t\tsem.release();\n\t\t}\n\t}", "@PostMapping(path = \"/submit\")\n ResponseEntity<UUID> submit (@RequestBody JSONObject incidentJson){\n JSONObject description = incidentJson.getJSONObject(\"description\");\n String eventOpened = description.getString(\"event_opened\");\n Timestamp timestamp = new Timestamp((Instant.from(dtf.parse(eventOpened))).getEpochSecond());\n JSONObject address = incidentJson.getJSONObject(\"address\");\n String lat = address.getString(\"latitude\");\n String lon = address.getString(\"longitude\");\n JSONObject weather = WeatherIntegration.getWeather(lat, lon, timestamp);\n Incident.Builder builder = new Incident.Builder();\n Incident incident = builder.withId(UUID.randomUUID())\n .withIncidentJson(incidentJson)\n .withWeather(weather)\n .withTimestamp(timestamp)\n .build();\n return ResponseEntity.status(HttpStatus.ACCEPTED).body(incident.getId());\n }", "Answer perform(final String event);", "private void sendAsyncEvent(double event_type) {\n\t\tint dsMapIndex = RunnerJNILib.jCreateDsMap(null, null, null);\n\t\tRunnerJNILib.DsMapAddString( dsMapIndex, \"type\", \"kidoz_sdk\" );\n\t\tRunnerJNILib.DsMapAddDouble( dsMapIndex, \"event_type\", event_type);\n\t\tRunnerJNILib.CreateAsynEventWithDSMap(dsMapIndex, EVENT_OTHER_SOCIAL);\n\t}", "@Override\n public void run() {\n if (this.nodeEventUpdateRequest.getAndSet(false)) {\n nodeEventPush.send(FirePushEventsEnum.NODE_EVENT.getMessage());\n }\n if (this.runTaskEventUpdateRequest.getAndSet(false)) {\n runTaskPush.send(FirePushEventsEnum.RUN_TASK_EVENT.getMessage());\n }\n }", "@Override\n public void run() {\n List<Event> events = mDatabase.eventDao().getEventsFromToTimeList(\n Calendar.getInstance().getTimeInMillis(), mDueDateCalendar.getTimeInMillis());\n mScheduler.setEvents(events); //sets events to mScheduler\n Event eventWithTime = mScheduler.scheduleEvent(event, timeLengthInMillis);\n// //if an event couldn't be scheduled\n if(eventWithTime == null){\n toast.show();\n }\n //if a new event is being created\n else if (mEventId == DEFAULT_EVENT_ID) {\n // insert new event\n mDatabase.eventDao().insertEvent(eventWithTime);\n } else {\n //update event\n eventWithTime.setId(mEventId);\n mDatabase.eventDao().updateEvent(eventWithTime);\n }\n finish(); //closes activity\n }", "public Event subscribe(Address resource, String event, int expires, Content body);", "public static synchronized void insert(IEvent e) {\n queue.addLast(e);\r\n EventQueue.class.notifyAll();\r\n }", "public void submitMessage( TolvenMessageWithAttachments tm ) throws Exception {\r\n\t\tgetDocBean().queueTolvenMessage( tm );\r\n\t}", "private void sendEventToServer() throws UnknownHostException, IOException {\n \t\t\n \t\tSocket socket = null; \n \t\t\n \t\tsocket = new Socket(Constants.ServerIp, Constants.Port);\n \t\t\n \t\tObjectOutputStream serializer = null;\n \t\t\n \t\tserializer = new ObjectOutputStream(socket.getOutputStream());\n \t\t//TODO: Send a message to server for new Event\n \t\t\n \t\tMessageType t = MessageType.newPubEventMessage;\n \t\tserializer.writeObject(t);\n \t\tserializer.writeObject(event);\n \t\tserializer.flush();\n \t\t//TODO: Send the event\n \t\t//TODO: Send to Pending Screen\n \t}", "@PostMapping(\"/event-actions/execute\")\n @Timed\n public ResponseEntity<EventActionDTO> executedEventAction(@RequestBody EventActionDTO eventActionDTO) throws URISyntaxException {\n log.debug(\"REST request to process EventAction : {}\", eventActionDTO);\n return new ResponseEntity<EventActionDTO>(eventActionDTO, null, HttpStatus.ACCEPTED);\n }", "public EventQueue(){}", "@ApiMethod(name = \"insertEvent\")\n public Event insertEvent(Event event) {\n DatastoreService datastoreService = DatastoreServiceFactory.getDatastoreService();\n // TODO: Implement this function\n logger.info(\"Calling insertEvent method\");\n return event;\n }", "public void addEvent()\n throws StringIndexOutOfBoundsException, ArrayIndexOutOfBoundsException {\n System.out.println(LINEBAR);\n try {\n String taskDescription = userIn.split(EVENT_IDENTIFIER)[DESCRIPTION].substring(EVENT_HEADER);\n String timing = userIn.split(EVENT_IDENTIFIER)[TIMING];\n Event event = new Event(taskDescription, timing);\n tasks.add(event);\n storage.writeToFile(event);\n ui.echoUserInput(event, tasks.taskIndex);\n } catch (StringIndexOutOfBoundsException e) {\n ui.printStringIndexOOB();\n } catch (ArrayIndexOutOfBoundsException e) {\n ui.printArrayIndexOOB();\n }\n System.out.println(LINEBAR);\n }", "void enqueue(BasePayload payload, EnqueueCallback callback);", "void postJobExecutionEvent(JobExecutionEvent jobExecutionEvent);", "protected void registerEvent(final Event event)\n {\n String encodedEventSignature = EventEncoder.encode(event);\n final EthFilter filter = new EthFilter(DefaultBlockParameterName.EARLIEST, DefaultBlockParameterName.LATEST, getContractAddress()).addSingleTopic(encodedEventSignature);\n\n Async.toPromise(new Callable<Subscription>() {\n\n @Override\n public Subscription call() throws Exception {\n return web3j.ethLogObservable(filter).subscribe(\n new Action1<Log>() {\n @Override\n public void call(Log log) {\n notifyObservers(event.getName(), null);\n }\n });\n }\n }).done(new DoneCallback<Subscription>() {\n @Override\n public void onDone(Subscription result) {\n subscriptions.add(result);\n }\n });\n }", "public void submitMicrotask(Key<Microtask> microtaskKey, String jsonDTOData, String workerID, Project project){\n\t\tWorkerCommand.increaseStat(workerID, \"submits\",1);\n\t\tMicrotask microtask = ofy().load().key( microtaskKey ).now();\n\t\tif(microtask!=null){\t\t\t\n\t\t\t// submit only if the request come from\n\t\t\t// the current assigned worker of the microtask\n\t\t\tif(microtask.isAssignedTo(workerID) ){\t\t\n\t\t\t\t//boolean to signal if review microtask was created -> microtask is waiting review\n\t\t\t\tboolean waitReview = true;\n\t\t\t\t\n\t\t\t\t// If reviewing is enabled and the microtask\n\t\t\t\t// is not in [Review, ReuseSearch,DebugTestFailure],\n\t\t\t\t// spawn a new review microtask\n\t\t\t\tif (reviewsEnabled && !( microtask.getClass().equals(Review.class) || microtask.getClass().equals(ChallengeReview.class)) ){\n\t\t\t\t\tMicrotaskCommand.createReview(microtaskKey, workerID, jsonDTOData, workerID);\n\n\t\t\t\t}\n\t\t\t\t// else submit the microtask\n\t\t\t\telse {\n\t\t\t\t\tMicrotaskCommand.submit(microtaskKey, jsonDTOData, workerID, microtask.getSubmitValue());\n\t\t\t\t\twaitReview = false;\n\t\t\t\t}\n\n\t\t\t\tFirebaseService.writeMicrotaskWaitingReview(Microtask.keyToString(microtaskKey),workerID, this.id, waitReview);\n\t\t\t\t// write the history log entry about the microtask submission\n\t\t\t\tHistoryLog.Init(this.getID()).addEvent(new MicrotaskSubmitted(microtask, workerID));\n\t\t\t\tFirebaseService.writeMicrotaskSubmission(jsonDTOData, Microtask.keyToString(microtaskKey), this.id);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tLogger.getLogger(\"LOGGER\").severe(\"LOAD FAILED: MICROTASK \"+microtaskKey);\n\t\t}\n\n\n\t}", "private void queueEvent(MailEvent mailEvent, Vector vector) {\n Object object = this.qLock;\n synchronized (object) {\n if (this.q == null) {\n EventQueue eventQueue;\n this.q = eventQueue = new EventQueue();\n }\n }\n vector = (Vector)vector.clone();\n this.q.enqueue(mailEvent, vector);\n }", "@EncoderThread\n protected void onEvent(@NonNull String event, @Nullable Object data) {}", "public void storeEvent(Event event) {\n Entity eventEntity = new Entity(\"Event\", event.getEventId().toString());\n eventEntity.setProperty(\"speaker\", event.getSpeaker());\n eventEntity.setProperty(\"organization\", event.getOrganization());\n eventEntity.setProperty(\"eventDate\", event.getEventDate());\n eventEntity.setProperty(\"externalLink\", event.getExternalLink());\n eventEntity.setProperty(\"ownerId\", event.getOwnerId());\n eventEntity.setProperty(\"publicType\", event.getPublicType());\n // eventEntity.setProperty(\"timeStamp\", event.getTimeStamp());\n // This try/catch statement is to prevent null pointer exceptions from fields\n // that might not be defined yet in an event\n // Currently, the events form does not handle these fields so they are in the\n // try catch together\n try {\n eventEntity.setProperty(\"location\", event.getLocation());\n for (String am : event.getAmenities()) {\n storeAmenity(am, event.getEventId());\n }\n for (ThreadComment cm : event.getThread()) {\n storeThreadComment(cm);\n }\n } catch (NullPointerException e) {\n eventEntity.setProperty(\"location\", null);\n }\n\n datastore.put(eventEntity);\n }", "private void realSubmitExcuse(){\r\n\t\ta.submitExcuse(userId, excuseTxt, excuseDesc, \r\n\t\t\t\tnew RestCallback(){\r\n\t\t\t@Override\r\n\t\t\tpublic void onTaskComplete(Object result) {\r\n\t\t\t\tIntent myIntent = new Intent(ExcuseCreate.this, RecordUpdated.class);\r\n\t\t\t\tmyIntent.putExtra(\"message\", \"Excuse Submitted\");\r\n\t\t\t\tstartActivity(myIntent);\r\n\t\t\t}\r\n\t\t});\r\n\t}", "private void sendEvent(Map<String, String> info, String eventType) {\n ServiceReference ref = bundleContext.getServiceReference(EventAdmin.class.getName());\n if (ref != null) {\n EventAdmin eventAdmin = (EventAdmin) bundleContext.getService(ref);\n\n Dictionary<String, Object> properties = new Hashtable<>();\n properties.put(Constants.DISCOVERY_EVENT_TYPE, eventType);\n properties.put(Constants.DISCOVERY_INFO, info);\n\n Event reportGeneratedEvent = new Event(Constants.DISCOVERY_EVENT, properties);\n\n eventAdmin.sendEvent(reportGeneratedEvent);\n\n }\n\n }", "@Override\n public void postPriorityEvent(Event event)\n {\n priorityQueue.offer(event);\n }", "private void persistEvent(Event event) {\n\t\tAssert.notNull(event, \"Event cannot be null persisting received JMS message\");\n\t\tList<EventAttribute> eventAttributes = event.getEventAttributes();\n\t\tfor (EventAttribute eventAttribute : eventAttributes) {\n\t\t\tlog.debug(\n\t\t\t\t\t\"Recieved new via JMS Broker API an event for account number {} and tx amount of {} . About to persist it to the repository.\",\n\t\t\t\t\teventAttribute.getAccountNum(), eventAttribute.getTxAmount());\n\t\t\tevent.setApiType(JMS_BROKER);\n\t\t}\n\t\teventRepository.save(event);\n\t}", "public void push(Event anEvent) throws IOException {\n\t\tLog.debug(\"BCA event=\" + anEvent.toXML());\n\n\t\t// Check if we should refresh\n\t\tif (anEvent.getEventType().equals(Protocol.E_REFRESH)) {\n\t\t\t// Append refresh and tail of HTML document\n\t\t\t// Construct the JS callback line to be sent as last line of doc.\n\t\t\t// This will refresh the request using the unique id to determine\n\t\t\t// the subscriber instance on the server. The client will wait for\n\t\t\t// a number of milliseconds.\n\t\t\tlong refreshWaitMillis = Long.parseLong(anEvent.getField(P_WAIT));\n\n\t\t\t// Create servlet request for requesting next events (refresh)\n\t\t\tString url = anEvent.getField(P_URL);\n\t\t\tString jsRefreshTrigger = \"\\n<script language=\\\"JavaScript\\\">url=\\'\" + url + \"\\';\\n setTimeout(\\\"refresh()\\\", \" + refreshWaitMillis + \");\\n</script>\";\n\n\n\t\t\tsend(jsRefreshTrigger + END_DOCUMENT);\n\t\t} else {\n\t\t\tsend(event2JavaScript(anEvent));\n\t\t}\n\t}", "public void runEvent();", "public void sendJobEvent(final String eventName, final String jobName, final Bundle extras)\n {\n sendEngagementCommand(new Runnable()\n {\n @Override\n public void run()\n {\n try\n {\n mEngagementService.sendJobEvent(eventName, jobName, extras);\n }\n catch (Exception e)\n {\n e.printStackTrace();\n }\n }\n });\n }", "void onBusEvent(Event event);", "boolean sendEventMessage(Event<T> event, Map<String, Object> messageHeaderMap) {\n T entity = event.getData();\n validateEventEntity(entity);\n\n String entityId = getEntityIdAsString(entity);\n String eventInfo = String.format(\"%s %s(id=%s)\", event.getAction(), entityType, entityId);\n log.debug(\"Sending {} event message.\", eventInfo);\n\n Message<Event<T>> message = MessageBuilder.withPayload(event)\n .setHeader(MessageHeaders.CONTENT_TYPE, MimeTypeUtils.APPLICATION_JSON)\n .setHeader(KafkaHeaders.MESSAGE_KEY, entityId.getBytes())\n .copyHeaders(messageHeaderMap)\n .build();\n\n boolean isSent = messageChannel.send(message);\n\n if (isSent) {\n log.debug(\"{} event message is sent successfully.\", eventInfo);\n return true;\n } else {\n String errorMessage = String.format(\"Unable to send %s event message.\", eventInfo);\n log.error(errorMessage);\n throw new MessageDeliveryException(errorMessage);\n }\n }", "@Override\n public void append( LogEvent event ) {\n long eventTimestamp;\n if (event instanceof AbstractLoggingEvent) {\n eventTimestamp = ((AbstractLoggingEvent) event).getTimestamp();\n } else {\n eventTimestamp = System.currentTimeMillis();\n }\n LogEventRequest packedEvent = new LogEventRequest(Thread.currentThread().getName(), // Remember which thread this event belongs to\n event, eventTimestamp); // Remember the event time\n\n if (event instanceof AbstractLoggingEvent) {\n AbstractLoggingEvent dbLoggingEvent = (AbstractLoggingEvent) event;\n switch (dbLoggingEvent.getEventType()) {\n\n case START_TEST_CASE: {\n\n // on Test Executor side we block until the test case start is committed in the DB\n waitForEventToBeExecuted(packedEvent, dbLoggingEvent, true);\n\n // remember the test case id, which we will later pass to ATS agent\n testCaseState.setTestcaseId(eventProcessor.getTestCaseId());\n\n // clear last testcase id\n testCaseState.clearLastExecutedTestcaseId();\n\n //this event has already been through the queue\n return;\n }\n case END_TEST_CASE: {\n\n // on Test Executor side we block until the test case start is committed in the DB\n waitForEventToBeExecuted(packedEvent, dbLoggingEvent, true);\n\n // remember the last executed test case id\n testCaseState.setLastExecutedTestcaseId(testCaseState.getTestcaseId());\n\n // clear test case id\n testCaseState.clearTestcaseId();\n // this event has already been through the queue\n return;\n }\n case GET_CURRENT_TEST_CASE_STATE: {\n // get current test case id which will be passed to ATS agent\n ((GetCurrentTestCaseEvent) event).setTestCaseState(testCaseState);\n\n //this event should not go through the queue\n return;\n }\n case START_RUN:\n\n /* We synchronize the run start:\n * Here we make sure we are able to connect to the log DB.\n * We also check the integrity of the DB schema.\n * If we fail here, it does not make sense to run tests at all\n */\n atsConsoleLogger.info(\"Waiting for \"\n + event.getClass().getSimpleName()\n + \" event completion\");\n\n /** disable root logger's logging in order to prevent deadlock **/\n Level level = LogManager.getRootLogger().getLevel();\n Configurator.setRootLevel(Level.OFF);\n\n AtsConsoleLogger.setLevel(level);\n\n // create the queue logging thread and the DbEventRequestProcessor\n if (queueLogger == null) {\n initializeDbLogging(null);\n }\n\n waitForEventToBeExecuted(packedEvent, dbLoggingEvent, false);\n //this event has already been through the queue\n\n /*Revert Logger's level*/\n Configurator.setRootLevel(level);\n AtsConsoleLogger.setLevel(level);\n\n return;\n case END_RUN: {\n /* We synchronize the run end.\n * This way if there are remaining log events in the Test Executor's queue,\n * the JVM will not be shutdown prior to committing all events in the DB, as\n * the END_RUN event is the last one in the queue\n */\n atsConsoleLogger.info(\"Waiting for \"\n + event.getClass().getSimpleName()\n + \" event completion\");\n\n /** disable root logger's logging in order to prevent deadlock **/\n level = LogManager.getRootLogger().getLevel();\n Configurator.setRootLevel(Level.OFF);\n\n AtsConsoleLogger.setLevel(level);\n\n waitForEventToBeExecuted(packedEvent, dbLoggingEvent, true);\n\n /*Revert Logger's level*/\n Configurator.setRootLevel(level);\n AtsConsoleLogger.setLevel(level);\n\n //this event has already been through the queue\n return;\n }\n case DELETE_TEST_CASE: {\n // tell the thread on the other side of the queue, that this test case is to be deleted\n // on first chance\n eventProcessor.requestTestcaseDeletion( ((DeleteTestCaseEvent) dbLoggingEvent).getTestCaseId());\n // this event is not going through the queue\n return;\n }\n default:\n // do nothing about this event\n break;\n }\n }\n\n passEventToLoggerQueue(packedEvent);\n }", "protected final void postEvent(Object event) {\n mEventBridge.post(event);\n }", "public void postEventSafely(final Object event) {\n new Handler(Looper.getMainLooper()).post(new Runnable() {\n @Override\n public void run() {\n mBus.post(event);\n }\n });\n }", "public void sendEmployeeEventUsingProducerRecord(EmployeeEvent employeeEvent) throws JsonProcessingException {\n\n Integer key = employeeEvent.getEmpEventId();\n String value = objectMapper.writeValueAsString(employeeEvent);\n\n\n ProducerRecord<Integer, String> producerRecord = createProducerRecord(key, value, kafkaTopic);\n// ListenableFuture<SendResult<Integer, String>> listenableFuture = kafkaTemplate.send(kafkaTopic, key, value); // sendDefault is of type Listenable future\n ListenableFuture<SendResult<Integer, String>> listenableFuture = kafkaTemplate.send(producerRecord); // changed overloaded method of send\n\n listenableFuture.addCallback(new ListenableFutureCallback<SendResult<Integer, String>>() { // Call back is of success and failure types\n @Override\n public void onFailure(Throwable e) {\n handleFailure(key, value, e);\n }\n\n @Override\n public void onSuccess(SendResult<Integer, String> result) { // Published message is successful\n handleSuccess(key, value, result);\n }\n });\n\n }", "protected static void putEventToConsumer(String url, String eventInstance, String contentType) throws RESTException {\n\t\t// Prepare HTTP PUT\n PostMethod postMethod = new PostMethod(url); \n \n if(eventInstance != null) {\n\n \tRequestEntity requestEntity = new ByteArrayRequestEntity(eventInstance.getBytes());\n \tpostMethod.setRequestEntity(requestEntity);\n\n \n\t // Specify content type and encoding\n\t // If content encoding is not explicitly specified\n\t // ISO-8859-1 is assumed\n \t// postMethod.setRequestHeader(\"Content-Type\", contentType+\"; charset=ISO-8859-1\");\n \tpostMethod.setRequestHeader(\"Content-Type\", contentType);\n \t\n\t // Get HTTP client\n\t HttpClient httpclient = new HttpClient();\n\t \n\t // Execute request\n\t try {\n\t \n\t int result = httpclient.executeMethod(postMethod);\n\t \t \n\t if (result < 200 || result >= 300)\n\t {\n\t \tHeader [] reqHeaders = postMethod.getRequestHeaders();\n\t \tStringBuffer headers = new StringBuffer();\n\t \tfor (int i=0; i<reqHeaders.length; i++ ){\n\t \t\theaders.append(reqHeaders[i].toString());\n\t \t\theaders.append(\"\\n\");\n\t \t}\n\t \tthrow new RESTException(\"Could not perform POST of event instance: \\n\"+eventInstance+ \"\\nwith request headers:\\n\" +\n\t \t\t\theaders + \"to consumer \"+ url+\", responce result: \"+result);\n\t }\n\t \n\t } catch(Exception e)\n\t {\n\t \tthrow new RESTException(e);\n\t }\n\t finally {\n\t // Release current connection to the connection pool \n\t // once you are done\n\t postMethod.releaseConnection();\n\t }\n } else\n {\n \tSystem.out.println (\"Invalid request\");\n }\n// PutMethod putMethod = new PutMethod(url); \n// \n// if(eventInstance != null) {\n// \tRequestEntity requestEntity = new ByteArrayRequestEntity(eventInstance.getBytes());\n// \tputMethod.setRequestEntity(requestEntity);\n//\n// \n//\t // Specify content type and encoding\n//\t // If content encoding is not explicitly specified\n//\t // ISO-8859-1 is assumed\n//\t putMethod.setRequestHeader(\n//\t \"Content-type\", contentType+\"; charset=ISO-8859-1\");\n//\t \n//\t // Get HTTP client\n//\t HttpClient httpclient = new HttpClient();\n//\t \n//\t // Execute request\n//\t try {\n//\t \n//\t int result = httpclient.executeMethod(putMethod);\n//\t \t \n//\t if (result < 200 || result >= 300)\n//\t {\n//\t \tthrow new RESTException(\"Could not perform PUT of event instance \"+eventInstance+\" to consumer \"+ url+\", responce result: \"+result);\n//\t }\n//\t \n//\t } catch(Exception e)\n//\t {\n//\t \tthrow new RESTException(e);\n//\t }\n//\t finally {\n//\t // Release current connection to the connection pool \n//\t // once you are done\n//\t putMethod.releaseConnection();\n//\t }\n// } else\n// {\n// \tSystem.out.println (\"Invalid request\");\n// }\n\n\t}", "public void setSendEvent(EventOccurrence sendEvent);", "public final void dispatchEvent(AWTEvent e) {\n dispatchEventImpl(e);\n }", "public void sendRegister(ActionEvent actionEvent) {\n }", "@Override\n public void publish(final EventData data) {\n LOGGER.debug(\"async event {} published via LocalAsyncProcessor\", data.getData().ret$PQON());\n LOGGER.debug(\"(currently events are discarded in localtests)\");\n }", "@Override\n public void mySchedule(String date) {\n FastJsonRequest request = new FastJsonRequest(SystemUtils.mainUrl + MethodCode.CLASSSCHEDULE + MethodType.MYSCHEDULEV2, RequestMethod.POST);\n request.add(\"username\", application.getSystemUtils().getDefaultUsername());\n request.add(\"token\", application.getSystemUtils().getToken());\n request.add(\"date\", date);\n request.add(MethodCode.DEVICEID, application.getSystemUtils().getSn());\n request.add(MethodCode.DEVICETYPE, SystemUtils.deviceType);\n request.add(MethodCode.APPVERSION, SystemUtils.getVersionName(context));\n addQueue(MethodCode.EVENT_MYSCHEDULE, request);\n\n\n// startQueue();\n }", "public void postCIAgentEvent(CIAgentEvent event) {\n processCIAgentEvent(event); // don't queue, just process\n }" ]
[ "0.70192045", "0.6357763", "0.61830354", "0.60607636", "0.6056932", "0.5924874", "0.5920299", "0.5918575", "0.5917086", "0.58473283", "0.58449036", "0.58099115", "0.5790711", "0.5731101", "0.57259434", "0.57037956", "0.5665263", "0.56092083", "0.5606461", "0.5600482", "0.5592427", "0.5582021", "0.5572251", "0.5532417", "0.5527729", "0.55274236", "0.55037886", "0.54793096", "0.54644305", "0.5451963", "0.5450494", "0.54225737", "0.538367", "0.5376417", "0.5372226", "0.53692716", "0.536399", "0.5360951", "0.533382", "0.533222", "0.5325985", "0.5314018", "0.53100413", "0.5301543", "0.5300449", "0.5288347", "0.5288016", "0.527318", "0.5272384", "0.5271182", "0.525444", "0.5251465", "0.52512723", "0.5246325", "0.5233848", "0.52304864", "0.52272725", "0.5219413", "0.5214012", "0.5213249", "0.5210454", "0.5204864", "0.52020174", "0.5186607", "0.5183657", "0.51817316", "0.51738244", "0.517367", "0.51715994", "0.51581377", "0.5151805", "0.5150655", "0.5145698", "0.5139824", "0.5120849", "0.51203406", "0.511282", "0.51117337", "0.5110738", "0.51022387", "0.5098898", "0.50828505", "0.50825334", "0.5078649", "0.5068247", "0.5064059", "0.50618654", "0.5061066", "0.504919", "0.5046326", "0.50433534", "0.50316036", "0.50278336", "0.50094783", "0.50077695", "0.50037724", "0.49956298", "0.4994812", "0.49911934", "0.4982607" ]
0.6799165
1
Supplement the outgoing event with additional metadata, if not already present. These include: dt: ISO 8601 timestamp app_session_id: the current session ID app_install_id: app install ID
static void addEventMetadata(Event event) { event.setSessionId(AssociationController.getSessionId()); event.setAppInstallId(Prefs.INSTANCE.getAppInstallId()); event.setDt(DateUtil.iso8601DateFormat(new Date())); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public WriteMetadataEvent() {\n }", "@Override\n public void writeToParcel(Parcel dest, int flags) {\n dest.writeInt(id);\n dest.writeInt(date);\n dest.writeString(event);\n dest.writeString(location);\n dest.writeString(startTime);\n dest.writeString(endTime);\n dest.writeString(notes);\n dest.writeByte((byte) (allDay == null ? 0 : allDay ? 1 : 2));\n dest.writeInt(bigId);\n dest.writeInt(alarm);\n }", "private void getIncomingIntent()\n {\n if(getIntent().hasExtra(\"Title\")\n && getIntent().hasExtra(\"Time\")\n && getIntent().hasExtra(\"Date\")\n && getIntent().hasExtra(\"Duration\")\n && getIntent().hasExtra(\"Location\")\n && getIntent().hasExtra(\"EventDetails\"))\n {\n Title = getIntent().getStringExtra(\"Title\");\n Time = getIntent().getStringExtra(\"Time\");\n Date = getIntent().getStringExtra(\"Date\");\n Duration = getIntent().getStringExtra(\"Duration\");\n Location = getIntent().getStringExtra(\"Location\");\n EventDetails = getIntent().getStringExtra(\"EventDetails\");\n\n setData(Title,Time,Date,Duration,Location,EventDetails);\n }\n }", "@Override\n public void date(SinkEventAttributes attributes)\n {\n }", "public static void postMdcInfoForEvent(Object eventObject) {\n postMdcInfoForEvent(\"\" + eventObject);\n }", "public void onSessionEvent(@NonNull String event, @Nullable Bundle extras) {\n }", "public String getEventInfo()\n {\n return \"Event ID: \" + this.hashCode() + \" | Recorded User\\n\" + String.format(\"\\tName %s \\n\\tDate of Birth %s \\n\\tEmail %s \\n\\tContact Number %s \\n\\tAge %d \\nDate %s \\nTime %s \\nParty Size %d \\nEstablishment \\n\\tName: %s \\n\\tAddress: %s\",\n user.getName(), user.getDateOfBirthAsString(), user.getEmail(), user.getPhoneNumber(), \n user.getAge(), getEventDateAsString(), getEventTimeAsString(), partyNumber, establishment.getName(), establishment.getAddress());\n }", "private void copyCallMetadata(final LifeCycleEvent event,\n final CallMetadata data) throws URISyntaxException {\n final String source = event.getSource();\n data.setCallingDevice(source);\n final String target = event.getTarget();\n data.setCalledDevice(target);\n }", "private JSONObject buildTrackingItemObject(String eventIndex, String event, String params, long time){\n JSONObject trackingObject = null;\n\n if (deviceTrackingObjectDefault == null) {\n trackingObject = new JSONObject();\n deviceTrackingObjectDefault = new JSONObject();\n\n for (Entry<String, String> entry : deviceInformationUtils.getTrackingDeviceInfo().entrySet()) {\n try {\n trackingObject.put(entry.getKey() , entry.getValue());\n deviceTrackingObjectDefault.put(entry.getKey() , entry.getValue());\n } catch (JSONException e) {\n log.error(e.getMessage(), e);\n }\n }\n } else {\n try {\n trackingObject = new JSONObject(deviceTrackingObjectDefault.toString());\n } catch (JSONException e) {\n log.error(e.getMessage(), e);\n }\n }\n\n try {\n trackingObject.put(DataKeys.TRACK_EVENT_INDEX, eventIndex);\n trackingObject.put(DataKeys.TRACK_EVENT_NAME, event);\n trackingObject.put(DataKeys.TRACK_EVENT_PARAM, params);\n trackingObject.put(DataKeys.TRACK_EVENT_TIME, Utils.convertMillisAndFormatDate(time) + \"\");\n trackingObject.put(DataKeys.TRACK_EVENT_TIME_EPOCH, time);\n } catch (JSONException e) {\n log.error(e.getMessage(), e);\n }\n\n try {\n JSONObject attributionObject = new JSONObject();\n\n if (event.equals(TrackingEvents.FIRST_APP_LAUNCH)) {\n Thread.sleep(5000);\n }\n\n attributionObject.put(DataKeys.TRACK_ATD_CLICK_ID, DataContainer.getInstance().pullValueString(InstallReceiver.UTM_CLICK_ID, context));\n attributionObject.put(DataKeys.TRACK_ATD_AFFILIATE_ID, DataContainer.getInstance().pullValueString(InstallReceiver.UTM_AFFILIATE_ID, context));\n attributionObject.put(DataKeys.TRACK_ATD_CAMPAIGN_ID, DataContainer.getInstance().pullValueString(InstallReceiver.UTM_CAMPAIGN_ID, context));\n\n trackingObject.put(DataKeys.TRACK_ATTRIBUTION_DATA, attributionObject);\n\n } catch (JSONException e) {\n log.error(e.getMessage(), e);\n } catch (InterruptedException e) {\n log.error(e.getMessage(), e);\n }\n\n trackingObject = trackingObjectCleanup(trackingObject);\n\n return trackingObject;\n }", "@Override\n public int addChatEventInformation(ChatEventStructForBinder chatEventStruct)\n throws RemoteException {\n Logger.v(TAG, \"addChatEventInformation(), chatEventStruct = \"\n + chatEventStruct);\n return 0;\n }", "private void buildMetadataLine(SuggestedPodcast addPodcastFormData) {\n\n\t\tStringBuffer metadataLine = new StringBuffer();\n\t\tmetadataLine.append(addPodcastFormData.getFeedUrl());\n\t\tmetadataLine.append(\"; \");\n\n\t\tmetadataLine.append(addPodcastFormData.getIdentifier());\n\t\tmetadataLine.append(\"; \");\n\n\t\tif (addPodcastFormData.getCategories() != null) {\n\t\t\t// build categories String\n\t\t\tString categoriesStr = \"\";\n\t\t\tfor (String s : addPodcastFormData.getCategories()) {\n\t\t\t\tcategoriesStr += s + \", \";\n\t\t\t}\n\t\t\t// we add the categories separated by comma, and remove the last\n\t\t\t// comma and space\n\t\t\tmetadataLine.append(categoriesStr.subSequence(0,\n\t\t\t\t\tcategoriesStr.length() - 2));\n\t\t\tmetadataLine.append(\"; \");\n\t\t}\n\n\t\t// add language code\n\t\tmetadataLine.append(addPodcastFormData.getLanguageCode().toString());\n\t\tmetadataLine.append(\"; \");\n\n\t\t// add media type\n\t\tmetadataLine.append(addPodcastFormData.getMediaType().toString());\n\t\tmetadataLine.append(\"; \");\n\n\t\t// add frequency type\n\t\tmetadataLine.append(addPodcastFormData.getUpdateFrequency().toString());\n\t\tmetadataLine.append(\"; \");\n\n\t\t// add tags/keywords\n\n String suggestedTags = addPodcastFormData.getSuggestedTags();\n metadataLine.append(suggestedTags);\n\t\tmetadataLine.append(\"; \");\n\n\t\t// add facebook fan page\n\t\tmetadataLine.append(addPodcastFormData.getFacebookPage());\n\t\tmetadataLine.append(\"; \");\n\n\t\t// add twitter fan page\n\t\tmetadataLine.append(addPodcastFormData.getTwitterPage());\n\t\tmetadataLine.append(\"; \");\n\n\t\t// add twitter fan page\n\t\tmetadataLine.append(addPodcastFormData.getGplusPage());\n\t\tmetadataLine.append(\"; \");\n\n\t\t// add name of the visitor that submitted the podcast\n\t\tmetadataLine.append(addPodcastFormData.getName());\n\t\tmetadataLine.append(\"; \");\n\n\t\t// add email of the visitor who suggested the podcast, so that we sent\n\t\t// him a thank you email if added - ahaaa\n\t\tmetadataLine.append(addPodcastFormData.getEmail());\n\n\t\t// set the metadataLine\n\t\taddPodcastFormData.setMetadataLine(metadataLine.toString());\n\n\t}", "@Override\n public io.emqx.exhook.RequestMeta getMeta() {\n return meta_ == null ? io.emqx.exhook.RequestMeta.getDefaultInstance() : meta_;\n }", "void onMetaData(\n long sessionId,\n MetaDataStatus status,\n DirectBuffer buffer,\n int offset,\n int length);", "protected static JSONObject appendStackMetadata(JSONObject additionalMetadata) {\n JSONObject jsonMetadata;\n\n if(additionalMetadata != null){\n jsonMetadata = additionalMetadata;\n }\n else{\n jsonMetadata = new JSONObject();\n }\n\n try {\n // try/catch Exception wraps all because I don't know yet if I can trust getStackTrace... needs more testing\n // below is slightly more performant than: Thread.currentThread().getStackTrace();\n StackTraceElement[] stackTraceElements = new Exception().getStackTrace();\n\n int index = 0;\n // find the start of the Logger call stack:\n while(!stackTraceElements[index].getClassName ().equals (LogPersister.class.getName())) {\n index++;\n }\n // then find the caller:\n while(stackTraceElements[index].getClassName().equals (LogPersister.class.getName())\n || stackTraceElements[index].getClassName().startsWith (JULHandler.class.getName())\n || stackTraceElements[index].getClassName().startsWith (java.util.logging.Logger.class.getName())\n || stackTraceElements[index].getClassName().startsWith (BMSAnalytics.class.getName())) {\n index++;\n }\n\n jsonMetadata.put (\"$class\", stackTraceElements[index].getClassName ());\n jsonMetadata.put (\"$file\", stackTraceElements[index].getFileName ());\n jsonMetadata.put (\"$method\", stackTraceElements[index].getMethodName ());\n jsonMetadata.put (\"$line\", stackTraceElements[index].getLineNumber ());\n jsonMetadata.put (\"$src\", \"java\");\n\n } catch (Exception e) {\n Log.e(LOG_TAG_NAME, \"Could not generate jsonMetadata object.\", e);\n }\n\n return jsonMetadata;\n }", "public void reportCustomEventNoData(String eventName) {\n Tracking.setEvent(eventName);\n }", "@PublicApi\npublic interface DataImportEvent\n{\n /**\n * @return time in milliseconds when the imported data was exported.\n */\n Option<Long> getXmlExportTime();\n}", "@Override\n public void filterResponse(HttpResponse response, HttpMessageContents contents, HttpMessageInfo messageInfo) {\n timestampWriter.write(new HttpResponseDetail(System.currentTimeMillis(), response, contents, messageInfo));\n }", "protected Map<String, String> getMetaData(Response response) {\r\n\t\tMap<String, String> metadata = new HashMap<String, String>();\r\n Request request = response.getRequest();\r\n\r\n User authUser = request.getActiveUser();\r\n String user = \"?\";\r\n if (authUser != null) {\r\n user = authUser.getUserId();\r\n }\r\n\r\n\t\tmetadata.put(\"user\", encodeValue(user));\r\n\t\tmetadata.put(\"request\", encodeValue(RequestUtil.getRequestURL(request).toString()));\r\n\t\tmetadata.put(\"status\", encodeValue(\"ok\"));\r\n\r\n\r\n\t\tif ( null != request ) {\r\n\t\t\tmetadata.put(\"startTime\", metaDataTimeFormat.format(request.getCreateTime()));\r\n\t\t\tmetadata.put(\"endTime\", metaDataTimeFormat.format(System.currentTimeMillis()));\r\n\t\t}\r\n\r\n\t\treturn metadata;\r\n\t}", "public void setMetadata(PDMetadata meta) {\n/* 557 */ this.stream.setItem(COSName.METADATA, meta);\n/* */ }", "public void setEventCreated() {\n Date now = new Date();\n this.eventCreated = now;\n }", "public void logEvent(long timestamp, int componentTag, int eventTag, Parcelable data) {\n }", "public interface SessionDetails extends WriteMarshallable {\n\n // a unique id used to identify this session, this field is by contract immutable\n UUID sessionId();\n\n // a unique id used to identify the client\n UUID clientId();\n\n @Nullable\n String userId();\n\n @Nullable\n String securityToken();\n\n @Nullable\n String domain();\n\n SessionMode sessionMode();\n\n @Nullable\n InetSocketAddress clientAddress();\n\n long connectTimeMS();\n\n <I> void set(Class<I> infoClass, I info);\n\n @NotNull\n <I> I get(Class<I> infoClass);\n\n @Nullable\n WireType wireType();\n\n byte hostId();\n\n @Override\n default void writeMarshallable(@NotNull WireOut w) {\n w.writeEventName(EventId.userId).text(userId())\n .writeEventName(EventId.domain).text(domain());\n if (sessionMode() != null)\n w.writeEventName(EventId.sessionMode).text(sessionMode().toString());\n w.writeEventName(EventId.securityToken).text(securityToken())\n .writeEventName(EventId.clientId).text(clientId().toString())\n .writeEventName(EventId.hostId).int8(hostId())\n .writeEventName(EventId.wireType).asEnum(wireType());\n }\n}", "@Override\n protected void append(LoggingEvent event) {\n if (event.getMessage() instanceof WrsAccessLogEvent) {\n WrsAccessLogEvent wrsLogEvent = (WrsAccessLogEvent) event.getMessage();\n\n try {\n HttpServletRequest request = wrsLogEvent.getRequest();\n if (request != null) {\n String pageHash = ((String)MDC.get(RequestLifeCycleFilter.MDC_KEY_BCD_PAGEHASH));\n String requestHash = ((String)MDC.get(RequestLifeCycleFilter.MDC_KEY_BCD_REQUESTHASH));\n String sessionId = ((String)MDC.get(RequestLifeCycleFilter.MDC_KEY_SESSION_ID));\n String requestUrl = request.getRequestURL().toString();\n String reqQuery = request.getQueryString();\n requestUrl += (reqQuery != null ? \"?\" + reqQuery : \"\");\n if (requestUrl.length()> 2000)\n requestUrl = requestUrl.substring(0, 2000);\n String bindingSetName = wrsLogEvent.getBindingSetName();\n if (bindingSetName != null && bindingSetName.length()> 255)\n bindingSetName = bindingSetName.substring(0, 255);\n String requestXML = wrsLogEvent.getRequestDoc()!=null ? Utils.serializeElement(wrsLogEvent.getRequestDoc()) : null;\n\n // log access\n if(AccessSqlLogger.getInstance().isEnabled()) {\n final AccessSqlLogger.LogRecord recordAccess = new AccessSqlLogger.LogRecord(\n sessionId\n , requestUrl\n , pageHash\n , requestHash\n , bindingSetName\n , requestXML\n , wrsLogEvent.getRowCount()\n , wrsLogEvent.getValueCount()\n , wrsLogEvent.getRsStartTime()\n , wrsLogEvent.getRsEndTime()\n , wrsLogEvent.getWriteDuration()\n , wrsLogEvent.getExecuteDuration()\n );\n AccessSqlLogger.getInstance().process(recordAccess);\n }\n }\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n }\n }", "@Override\n\t\t\tpublic void onCompletion(RecordMetadata metadata, Exception exception) {\n\t\t\t\tif( exception == null) {\n\t\t\t\t\tlogger.info(\"Received new metadata \\n\"\n\t\t\t\t\t\t\t+\"Topic Name : \"+metadata.topic()+\"\\n\"\n\t\t\t\t\t\t\t+\"Partion Id : \"+metadata.partition()+\"\\n\"\n\t\t\t\t\t\t\t+\"Offset Id : \"+metadata.offset()+\"\\n\"\n\t\t\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tlogger.error(\"Error in Publishing the message\"+exception);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}", "@Test\n public void createAnalyticsEvent() throws JSONException{\n AnalyticsEvent analyticsEvent = new AnalyticsEvent(\"up\",\"300\");\n\n analyticsEvent.setIpAddress(\"192.168.0.1\");\n analyticsEvent.setInstallationID(\"installationId\");\n analyticsEvent.setApplicationVersion(\"0.2.0\");\n analyticsEvent.setDeviceType(\"HUAWEI P7-L10\");\n analyticsEvent.setOperatingSystem(\"Android 4.4.2\");\n analyticsEvent.setApplicationID(10069);\n analyticsEvent.setProjectId(40003);\n analyticsEvent.setUserID(310375);\n analyticsEvent.setLocation(37.332331, -122.031219);\n HashMap<String, String> metadata = new HashMap<String, String>();\n metadata.put(\"key\", \"value\");\n analyticsEvent.setMetaData(metadata);\n\n JSONObject jsonObject = analyticsEvent.toJSONObject();\n\n assertNotNull(\"Date not set\", jsonObject.getString(\"EventDate\"));\n assertEquals(\"ProjectId not match\", 40003, jsonObject.getInt(\"ProjectId\"));\n assertEquals(\"IpAddress not match\", \"192.168.0.1\", jsonObject.getString(\"IpAddress\"));\n assertEquals(\"EventType not match\", \"up\", jsonObject.getString(\"EventType\"));\n assertEquals(\"EventValue not match\", 300d, jsonObject.getDouble(\"EventValue\"));\n assertEquals(\"PhoenixIdentity_UserId not match\", 310375, jsonObject.getInt(\"PhoenixIdentity_UserId\"));\n assertEquals(\"PhoenixIdentity_ApplicationId not match\", 10069, jsonObject.getInt(\"PhoenixIdentity_ApplicationId\"));\n assertEquals(\"PhoenixIdentity_InstallationId not match\", \"installationId\", jsonObject.getString(\"PhoenixIdentity_InstallationId\"));\n assertEquals(\"ApplicationVersion not match\", \"0.2.0\", jsonObject.getString(\"ApplicationVersion\"));\n assertEquals(\"DeviceType not match\", \"HUAWEI P7-L10\", jsonObject.getString(\"DeviceType\"));\n assertEquals(\"OperatingSystemVersion not match\", \"Android 4.4.2\", jsonObject.getString(\"OperatingSystemVersion\"));\n assertEquals(\"Longitude not match\", 37.332331, jsonObject.getJSONObject(\"Geolocation\").getDouble(\"Longitude\"));\n assertEquals(\"Latitude not match\", -122.031219, jsonObject.getJSONObject(\"Geolocation\").getDouble(\"Latitude\"));\n assertEquals(\"MetaData not match\", \"{\\\"key\\\":\\\"value\\\"}\", jsonObject.getJSONObject(\"MetaData\").toString());\n }", "private void exportMeetingViaIntention(MeetingItem item) {\n Intent intent = new Intent(Intent.ACTION_INSERT);\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n intent.setType(\"vnd.android.cursor.item/event\");\n intent.putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME, item.getMeeting().getStartdate().getMillis());\n intent.putExtra(CalendarContract.EXTRA_EVENT_END_TIME, item.getMeeting().getEnddate().getMillis());\n intent.putExtra(Events.TITLE, item.getMeeting().getTitle());\n intent.putExtra(Events.DESCRIPTION, getMeetingDescription(item));\n intent.putExtra(Events.EVENT_TIMEZONE, \"Europe/Amsterdam\");\n intent.putExtra(Events.EVENT_LOCATION, item.getMeeting().getLocation());\n intent.putExtra(Events.ACCESS_LEVEL, Events.ACCESS_PRIVATE);\n intent.putExtra(Events.AVAILABILITY, Events.AVAILABILITY_BUSY);\n App.getContext().startActivity(intent);\n }", "private String makeEventStamp() {\n String name = \"DTSTAMP\";\n return formatTimeProperty(LocalDateTime.now(), name) + \"\\n\";\n }", "public Map<String, Object> toMap(){\n Map<String, Object> newEvent = new HashMap<>();\n newEvent.put(\"uid\", getUid());\n newEvent.put(\"name\", getName());\n newEvent.put(\"host\", getHost());\n newEvent.put(\"hostContribution\", isHostContribution());\n newEvent.put(\"startTime\", getEpochTime());\n newEvent.put(\"location\", getLocation());\n newEvent.put(\"description\", getDescription());\n newEvent.put(\"coverImageUrl\", getCoverImageUrl());\n newEvent.put(\"amountNeeded\", getAmountNeeded());\n return newEvent;\n }", "private void addPaymentStartEvent() {\n /*09th July 2019, Resolved Pyze library issue*/\n HashMap<String, Object> customAttributes = new HashMap<String, Object>();\n customAttributes.put(\"packageID\", String.valueOf(PackageID));\n customAttributes.put(\"userID\", String.valueOf(UserID));\n customAttributes.put(\"paymentType\", getIntent().getStringExtra(\"PaymentType\"));\n PyzeEvents.PyzeCommercePayment.postPaymentStarted(customAttributes);\n }", "protected void ProcessOutboundEvent(XMSEvent evt){\n switch(evt.getEventType()){\n case CALL_CONNECTED:\n System.out.println(\"***** Outbound call connected *****\");\n SetOutboundCallState(OutboundCallStates.CALLCONNECTED);\n ConnectCalls();\n break;\n case CALL_RECORD_END:\n \n break; \n case CALL_SENDDTMF_END:\n System.out.println(\"***** END_DTMF *****\");\n System.out.println(\"***** ReJoin Calls *****\");\n ConnectCalls();\n \n break; \n case CALL_DTMF:\n \n System.out.println(\"***** outbound CALL_DTMF *****\");\n System.out.println(\"data=\" + evt.getData());\n myInboundCall.SendInfo(\"DTMF_\" + evt.getData());\n \n break; \n case CALL_INFO:\n \n System.out.println(\"***** Outbound CALL_INFO *****\");\n System.out.println(\"data=\" + evt.getData());\n myInboundCall.SendInfo(evt.getData());\n\n break;\n case CALL_PLAY_END:\n //May need to do something here\n break;\n case CALL_DISCONNECTED: // The far end hung up will simply wait for the media\n System.out.println(\"***** outbound CALL_Disconnected *****\");\n DisconnectCalls();\n break;\n default:\n System.out.println(\"Unknown Event Type!!\");\n }\n }", "private JSONObject joinAdditionalData() {\n JSONObject additionalData = new JSONObject();\n\n try {\n if (mMessageChannel != null) {\n additionalData.put(IPC_MESSAGE_DATA_CHANNELBASEURL,\n \"ws://\" + mFlintServerIp + \":9439/channels/\"\n + mMessageChannel.getName());\n }\n\n if (mCustAdditionalData != null) {\n additionalData.put(\"customData\", mCustAdditionalData);\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n if (additionalData.length() > 0) {\n return additionalData;\n }\n\n return null;\n }", "@Override\r\n protected void append(LoggingEvent event)\r\n {\n String category = event.getLoggerName();\r\n String logMessage = event.getRenderedMessage();\r\n String nestedDiagnosticContext = event.getNDC();\r\n String threadDescription = event.getThreadName();\r\n String level = event.getLevel().toString();\r\n long time = event.timeStamp;\r\n LocationInfo locationInfo = event.getLocationInformation();\r\n\r\n // Add the logging event information to a LogRecord\r\n Log4JLogRecord record = new Log4JLogRecord();\r\n\r\n record.setCategory(category);\r\n record.setMessage(logMessage);\r\n record.setLocation(locationInfo.fullInfo);\r\n record.setMillis(time);\r\n record.setThreadDescription(threadDescription);\r\n\r\n if (nestedDiagnosticContext != null) {\r\n record.setNDC(nestedDiagnosticContext);\r\n } else {\r\n record.setNDC(\"\");\r\n }\r\n\r\n if (event.getThrowableInformation() != null) {\r\n record.setThrownStackTrace(event.getThrowableInformation());\r\n }\r\n\r\n try {\r\n record.setLevel(LogLevel.valueOf(level));\r\n } catch (LogLevelFormatException e) {\r\n // If the priority level doesn't match one of the predefined\r\n // log levels, then set the level to warning.\r\n record.setLevel(LogLevel.WARN);\r\n }\r\n MgcLogBrokerMonitor monitor = Lf5MainWindowController.getMonitor();\r\n if (monitor != null) {\r\n monitor.addMessage(record);\r\n }\r\n }", "public interface Extender {\n void extend(CustomEvent.Builder builder, Map<String, String> json, GoogleAnalyticsTracker tracker);\n }", "@Override\n\tpublic String getExtraInformation() {\n\t\tDateTimeFormatter fmt = DateTimeFormat.forPattern(\"dd-MM-yyyy HH:mm\");\n\t\treturn \"Deadline: \" + fmt.print(this.getDeadLine());\n\t}", "protected void forward(IAnnounceEvent event){\r\n \t\ttry {\r\n \t\t\t_wrappedOut.write(event.getSerial());\r\n \t\t\t_output.writeASE(event.toSExp());\r\n \t\t} catch (IOException e) {\r\n \t\t\tSystem.err.println(\"Failed forwarding the message:\\n\"+event.toSExp()+\"\\nbecause: \"+e.getMessage());\r\n \t\t}\r\n \t}", "private void logPushExtras(Intent intent) {\n Set<String> keys = intent.getExtras().keySet();\n for (String key : keys) {\n\n // ignore standard C2DM extra keys\n List<String> ignoredKeys = (List<String>) Arrays.asList(\n \"collapse_key\",// c2dm collapse key\n \"from\",// c2dm sender\n PushManager.EXTRA_NOTIFICATION_ID,// int id of generated notification (ACTION_PUSH_RECEIVED only)\n PushManager.EXTRA_PUSH_ID,// internal UA push id\n PushManager.EXTRA_ALERT);// ignore alert\n if (ignoredKeys.contains(key)) {\n continue;\n }\n Log.i(logTag,\n \"Push Notification Extra: [\" + key + \" : \"\n + intent.getStringExtra(key) + \"]\"\n );\n }\n }", "protected void sequence_ALL_CURRENT_EVENTS_EXPIRED_OutputEventType_RAW(ISerializationContext context, OutputEventType semanticObject) {\n\t\tgenericSequencer.createSequence(context, semanticObject);\n\t}", "@Override\n public void processBroadcastElement(SocketEvent event, Context ctx, Collector<KeyedDataPoint> out) throws Exception {\n BroadcastState<String, SocketEvent> bcState = ctx.getBroadcastState(amplificationDesc);\n // storing in MapState with null as VOID default value\n bcState.put(event.streamKey, event);\n }", "@Override\n public void publish(Event<? extends Enum, ?> event) {\n byte[] body = null;\n if (null == event) {\n log.error(\"Captured event is null...\");\n return;\n }\n if (event instanceof DeviceEvent) {\n body = bytesOf(MQUtil.json((DeviceEvent) event));\n } else if (event instanceof TopologyEvent) {\n body = bytesOf(MQUtil.json((TopologyEvent) event));\n } else if (event instanceof LinkEvent) {\n body = bytesOf(MQUtil.json((LinkEvent) event));\n } else {\n log.error(\"Invalid event: '{}'\", event);\n return;\n }\n processAndPublishMessage(body);\n }", "@Override\n public void append( LogEvent event ) {\n long eventTimestamp;\n if (event instanceof AbstractLoggingEvent) {\n eventTimestamp = ((AbstractLoggingEvent) event).getTimestamp();\n } else {\n eventTimestamp = System.currentTimeMillis();\n }\n LogEventRequest packedEvent = new LogEventRequest(Thread.currentThread().getName(), // Remember which thread this event belongs to\n event, eventTimestamp); // Remember the event time\n\n if (event instanceof AbstractLoggingEvent) {\n AbstractLoggingEvent dbLoggingEvent = (AbstractLoggingEvent) event;\n switch (dbLoggingEvent.getEventType()) {\n\n case START_TEST_CASE: {\n\n // on Test Executor side we block until the test case start is committed in the DB\n waitForEventToBeExecuted(packedEvent, dbLoggingEvent, true);\n\n // remember the test case id, which we will later pass to ATS agent\n testCaseState.setTestcaseId(eventProcessor.getTestCaseId());\n\n // clear last testcase id\n testCaseState.clearLastExecutedTestcaseId();\n\n //this event has already been through the queue\n return;\n }\n case END_TEST_CASE: {\n\n // on Test Executor side we block until the test case start is committed in the DB\n waitForEventToBeExecuted(packedEvent, dbLoggingEvent, true);\n\n // remember the last executed test case id\n testCaseState.setLastExecutedTestcaseId(testCaseState.getTestcaseId());\n\n // clear test case id\n testCaseState.clearTestcaseId();\n // this event has already been through the queue\n return;\n }\n case GET_CURRENT_TEST_CASE_STATE: {\n // get current test case id which will be passed to ATS agent\n ((GetCurrentTestCaseEvent) event).setTestCaseState(testCaseState);\n\n //this event should not go through the queue\n return;\n }\n case START_RUN:\n\n /* We synchronize the run start:\n * Here we make sure we are able to connect to the log DB.\n * We also check the integrity of the DB schema.\n * If we fail here, it does not make sense to run tests at all\n */\n atsConsoleLogger.info(\"Waiting for \"\n + event.getClass().getSimpleName()\n + \" event completion\");\n\n /** disable root logger's logging in order to prevent deadlock **/\n Level level = LogManager.getRootLogger().getLevel();\n Configurator.setRootLevel(Level.OFF);\n\n AtsConsoleLogger.setLevel(level);\n\n // create the queue logging thread and the DbEventRequestProcessor\n if (queueLogger == null) {\n initializeDbLogging(null);\n }\n\n waitForEventToBeExecuted(packedEvent, dbLoggingEvent, false);\n //this event has already been through the queue\n\n /*Revert Logger's level*/\n Configurator.setRootLevel(level);\n AtsConsoleLogger.setLevel(level);\n\n return;\n case END_RUN: {\n /* We synchronize the run end.\n * This way if there are remaining log events in the Test Executor's queue,\n * the JVM will not be shutdown prior to committing all events in the DB, as\n * the END_RUN event is the last one in the queue\n */\n atsConsoleLogger.info(\"Waiting for \"\n + event.getClass().getSimpleName()\n + \" event completion\");\n\n /** disable root logger's logging in order to prevent deadlock **/\n level = LogManager.getRootLogger().getLevel();\n Configurator.setRootLevel(Level.OFF);\n\n AtsConsoleLogger.setLevel(level);\n\n waitForEventToBeExecuted(packedEvent, dbLoggingEvent, true);\n\n /*Revert Logger's level*/\n Configurator.setRootLevel(level);\n AtsConsoleLogger.setLevel(level);\n\n //this event has already been through the queue\n return;\n }\n case DELETE_TEST_CASE: {\n // tell the thread on the other side of the queue, that this test case is to be deleted\n // on first chance\n eventProcessor.requestTestcaseDeletion( ((DeleteTestCaseEvent) dbLoggingEvent).getTestCaseId());\n // this event is not going through the queue\n return;\n }\n default:\n // do nothing about this event\n break;\n }\n }\n\n passEventToLoggerQueue(packedEvent);\n }", "@Override\n public io.emqx.exhook.RequestMetaOrBuilder getMetaOrBuilder() {\n return getMeta();\n }", "public interface Event extends Serializable {\n\n Long getEventId();\n\n String getEventTitle();\n\n String getEventDescription();\n\n Long getEventAssignerId();\n\n Date getOriginalEventStartDate();\n\n Date getEventStartDate();\n\n /***\n * Sets the new start date for new generating event.\n *\n * @param startEventDate\n */\n void setEventStartDate(Date startEventDate);\n\n Date getEventEndDate();\n\n /***\n * Sets the new end date for new generating event.\n *\n * @param endEventDate\n */\n void setEventEndDate(Date endEventDate);\n//\n// Date getEventRemindDate();\n//\n// /***\n// * Sets the new remind date for new generating event.\n// *\n// * @param endEventDate\n// */\n// void setEventRemindDate(Date endEventDate);\n\n /***\n * Return calendarId field generated with system calendar after sync it\n *\n * @return\n * @see SyncUtils\n */\n Long getCalendarId();\n\n /***\n * Sets calendarId field generated with system calendar after sync it\n *\n * @param calendarId\n * @see SyncUtils\n */\n void setCalendarId(Long calendarId);\n\n /***\n * @return repeat period for current entity instance\n * @see EventProperties.RepeatPeriod\n */\n @EventProperties.RepeatPeriod\n int getEventRepeatPeriod();\n\n /***\n * @return event icon url\n */\n String getEventIconUrl();\n\n /***\n * @return boolean which indicates is event editable\n */\n Boolean isEditable();\n\n /***\n * @return boolean which indicates is event length All day long\n */\n Boolean isAllDayEvent();\n}", "public com.opentext.bn.converters.avro.entity.DocumentEvent.Builder clearEventTimestamp() {\n eventTimestamp = null;\n fieldSetFlags()[14] = false;\n return this;\n }", "@Override\n public void author(SinkEventAttributes attributes)\n {\n }", "public WebSocketResponseMetaDataXML toXML() throws TransportException {\n WebSocketResponseMetaDataXML responseMetaData =super.toXML();\n\n if (endPointHost != null) {\n responseMetaData.setServiceEndpointHost(endPointHost);\n }\n if (endPointIP != null) {\n responseMetaData.setServiceEndpointIp(endPointIP);\n }\n return responseMetaData;\n }", "public void incomingExtendedServicesRequest(APDUEvent e)\n {\n LOGGER.finer(\"Incoming extendedServicesRequest\");\n }", "public ApplicationEvent(Object source) {\n super(source);\n this.timestamp = System.currentTimeMillis();\n }", "public boolean hasEventTimestamp() {\n return fieldSetFlags()[14];\n }", "@RequestMapping(value = \"/publish\", method = RequestMethod.POST)\n public String publish(@RequestParam(value = \"destination\", required = false, defaultValue = \"**\") String destination) {\n\n final String myUniqueId = \"config-client1:7002\";\n System.out.println(context.getId());\n final MyCustomRemoteEvent event =\n new MyCustomRemoteEvent(this, myUniqueId, destination, \"--------dfsfsdfsdfsdfs\");\n //Since we extended RemoteApplicationEvent and we've configured the scanning of remote events using @RemoteApplicationEventScan, it will be treated as a bus event rather than just a regular ApplicationEvent published in the context.\n //因为我们在启动类上设置了@RemoteApplicationEventScan注解,所以通过context发送的时间将变成一个bus event总线事件,而不是在自身context中发布的一个ApplicationEvent\n context.publishEvent(event);\n\n return \"event published\";\n }", "public Event(String description, String info) {\n super(description);\n this.details = new Date(info);\n this.info = info.trim();\n }", "public void getEventDetails() {\r\n\t\t// Query DB to get specific event information based on EventID.\r\n\t}", "@DefaultStyle\[email protected]\npublic interface EventOutput {\n Integer getEventId();\n\n String getName();\n\n String getLocation();\n\n @JsonFormat(pattern = \"yyyy-MM-dd\")\n LocalDate getStartDate();\n\n @JsonFormat(pattern = \"yyyy-MM-dd\")\n LocalDate getEndDate();\n\n EventStatus getEventStatus();\n\n /**\n * @return indicate this is the current event, so will be used for the default view or sub-data, such as teams.\n * The application is responsible for ensuring we have one current event.\n */\n boolean isCurrent();\n}", "private CoreEventInfo postGetEvent(BwEvent ev, final int desiredAccess,\n final boolean nullForNoAccess,\n final Filters f) throws CalFacadeException {\n if (ev == null) {\n return null;\n }\n\n CurrentAccess ca = access.checkAccess(ev, desiredAccess, nullForNoAccess);\n\n if (!ca.getAccessAllowed()) {\n return null;\n }\n\n /* XXX-ALARM\n if (currentMode == userMode) {\n ev.setAlarms(getAlarms(ev, user));\n }\n */\n\n if (ev instanceof BwEventAnnotation) {\n ev = new BwEventProxy((BwEventAnnotation)ev);\n\n if ((f != null) && !f.postFilter(ev)) {\n return null;\n }\n }\n\n CoreEventInfo cei = new CoreEventInfo(ev, ca);\n\n return cei;\n }", "@MessagingGateway(defaultRequestChannel = \"eventOutput\")\ninterface EventWriter {\n\n @Gateway(requestChannel = \"eventOutput\")\n void writeEvent(Event event);\n}", "private void sendEvent(Map<String, String> info, String eventType) {\n ServiceReference ref = bundleContext.getServiceReference(EventAdmin.class.getName());\n if (ref != null) {\n EventAdmin eventAdmin = (EventAdmin) bundleContext.getService(ref);\n\n Dictionary<String, Object> properties = new Hashtable<>();\n properties.put(Constants.DISCOVERY_EVENT_TYPE, eventType);\n properties.put(Constants.DISCOVERY_INFO, info);\n\n Event reportGeneratedEvent = new Event(Constants.DISCOVERY_EVENT, properties);\n\n eventAdmin.sendEvent(reportGeneratedEvent);\n\n }\n\n }", "public interface EventChannel {\n /**\n * Gets the id property: Fully qualified resource Id for the resource.\n *\n * @return the id value.\n */\n String id();\n\n /**\n * Gets the name property: The name of the resource.\n *\n * @return the name value.\n */\n String name();\n\n /**\n * Gets the type property: The type of the resource.\n *\n * @return the type value.\n */\n String type();\n\n /**\n * Gets the systemData property: The system metadata relating to Event Channel resource.\n *\n * @return the systemData value.\n */\n SystemData systemData();\n\n /**\n * Gets the source property: Source of the event channel. This represents a unique resource in the partner's\n * resource model.\n *\n * @return the source value.\n */\n EventChannelSource source();\n\n /**\n * Gets the destination property: Represents the destination of an event channel.\n *\n * @return the destination value.\n */\n EventChannelDestination destination();\n\n /**\n * Gets the provisioningState property: Provisioning state of the event channel.\n *\n * @return the provisioningState value.\n */\n EventChannelProvisioningState provisioningState();\n\n /**\n * Gets the partnerTopicReadinessState property: The readiness state of the corresponding partner topic.\n *\n * @return the partnerTopicReadinessState value.\n */\n PartnerTopicReadinessState partnerTopicReadinessState();\n\n /**\n * Gets the expirationTimeIfNotActivatedUtc property: Expiration time of the event channel. If this timer expires\n * while the corresponding partner topic is never activated, the event channel and corresponding partner topic are\n * deleted.\n *\n * @return the expirationTimeIfNotActivatedUtc value.\n */\n OffsetDateTime expirationTimeIfNotActivatedUtc();\n\n /**\n * Gets the filter property: Information about the filter for the event channel.\n *\n * @return the filter value.\n */\n EventChannelFilter filter();\n\n /**\n * Gets the partnerTopicFriendlyDescription property: Friendly description about the topic. This can be set by the\n * publisher/partner to show custom description for the customer partner topic. This will be helpful to remove any\n * ambiguity of the origin of creation of the partner topic for the customer.\n *\n * @return the partnerTopicFriendlyDescription value.\n */\n String partnerTopicFriendlyDescription();\n\n /**\n * Gets the inner com.azure.resourcemanager.eventgrid.fluent.models.EventChannelInner object.\n *\n * @return the inner object.\n */\n EventChannelInner innerModel();\n\n /** The entirety of the EventChannel definition. */\n interface Definition\n extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate {\n }\n /** The EventChannel definition stages. */\n interface DefinitionStages {\n /** The first stage of the EventChannel definition. */\n interface Blank extends WithParentResource {\n }\n /** The stage of the EventChannel definition allowing to specify parent resource. */\n interface WithParentResource {\n /**\n * Specifies resourceGroupName, partnerNamespaceName.\n *\n * @param resourceGroupName The name of the resource group within the user's subscription.\n * @param partnerNamespaceName Name of the partner namespace.\n * @return the next definition stage.\n */\n WithCreate withExistingPartnerNamespace(String resourceGroupName, String partnerNamespaceName);\n }\n /**\n * The stage of the EventChannel definition which contains all the minimum required properties for the resource\n * to be created, but also allows for any other optional properties to be specified.\n */\n interface WithCreate\n extends DefinitionStages.WithSource,\n DefinitionStages.WithDestination,\n DefinitionStages.WithExpirationTimeIfNotActivatedUtc,\n DefinitionStages.WithFilter,\n DefinitionStages.WithPartnerTopicFriendlyDescription {\n /**\n * Executes the create request.\n *\n * @return the created resource.\n */\n EventChannel create();\n\n /**\n * Executes the create request.\n *\n * @param context The context to associate with this operation.\n * @return the created resource.\n */\n EventChannel create(Context context);\n }\n /** The stage of the EventChannel definition allowing to specify source. */\n interface WithSource {\n /**\n * Specifies the source property: Source of the event channel. This represents a unique resource in the\n * partner's resource model..\n *\n * @param source Source of the event channel. This represents a unique resource in the partner's resource\n * model.\n * @return the next definition stage.\n */\n WithCreate withSource(EventChannelSource source);\n }\n /** The stage of the EventChannel definition allowing to specify destination. */\n interface WithDestination {\n /**\n * Specifies the destination property: Represents the destination of an event channel..\n *\n * @param destination Represents the destination of an event channel.\n * @return the next definition stage.\n */\n WithCreate withDestination(EventChannelDestination destination);\n }\n /** The stage of the EventChannel definition allowing to specify expirationTimeIfNotActivatedUtc. */\n interface WithExpirationTimeIfNotActivatedUtc {\n /**\n * Specifies the expirationTimeIfNotActivatedUtc property: Expiration time of the event channel. If this\n * timer expires while the corresponding partner topic is never activated, the event channel and\n * corresponding partner topic are deleted..\n *\n * @param expirationTimeIfNotActivatedUtc Expiration time of the event channel. If this timer expires while\n * the corresponding partner topic is never activated, the event channel and corresponding partner topic\n * are deleted.\n * @return the next definition stage.\n */\n WithCreate withExpirationTimeIfNotActivatedUtc(OffsetDateTime expirationTimeIfNotActivatedUtc);\n }\n /** The stage of the EventChannel definition allowing to specify filter. */\n interface WithFilter {\n /**\n * Specifies the filter property: Information about the filter for the event channel..\n *\n * @param filter Information about the filter for the event channel.\n * @return the next definition stage.\n */\n WithCreate withFilter(EventChannelFilter filter);\n }\n /** The stage of the EventChannel definition allowing to specify partnerTopicFriendlyDescription. */\n interface WithPartnerTopicFriendlyDescription {\n /**\n * Specifies the partnerTopicFriendlyDescription property: Friendly description about the topic. This can be\n * set by the publisher/partner to show custom description for the customer partner topic. This will be\n * helpful to remove any ambiguity of the origin of creation of the partner topic for the customer..\n *\n * @param partnerTopicFriendlyDescription Friendly description about the topic. This can be set by the\n * publisher/partner to show custom description for the customer partner topic. This will be helpful to\n * remove any ambiguity of the origin of creation of the partner topic for the customer.\n * @return the next definition stage.\n */\n WithCreate withPartnerTopicFriendlyDescription(String partnerTopicFriendlyDescription);\n }\n }\n /**\n * Begins update for the EventChannel resource.\n *\n * @return the stage of resource update.\n */\n EventChannel.Update update();\n\n /** The template for EventChannel update. */\n interface Update\n extends UpdateStages.WithSource,\n UpdateStages.WithDestination,\n UpdateStages.WithExpirationTimeIfNotActivatedUtc,\n UpdateStages.WithFilter,\n UpdateStages.WithPartnerTopicFriendlyDescription {\n /**\n * Executes the update request.\n *\n * @return the updated resource.\n */\n EventChannel apply();\n\n /**\n * Executes the update request.\n *\n * @param context The context to associate with this operation.\n * @return the updated resource.\n */\n EventChannel apply(Context context);\n }\n /** The EventChannel update stages. */\n interface UpdateStages {\n /** The stage of the EventChannel update allowing to specify source. */\n interface WithSource {\n /**\n * Specifies the source property: Source of the event channel. This represents a unique resource in the\n * partner's resource model..\n *\n * @param source Source of the event channel. This represents a unique resource in the partner's resource\n * model.\n * @return the next definition stage.\n */\n Update withSource(EventChannelSource source);\n }\n /** The stage of the EventChannel update allowing to specify destination. */\n interface WithDestination {\n /**\n * Specifies the destination property: Represents the destination of an event channel..\n *\n * @param destination Represents the destination of an event channel.\n * @return the next definition stage.\n */\n Update withDestination(EventChannelDestination destination);\n }\n /** The stage of the EventChannel update allowing to specify expirationTimeIfNotActivatedUtc. */\n interface WithExpirationTimeIfNotActivatedUtc {\n /**\n * Specifies the expirationTimeIfNotActivatedUtc property: Expiration time of the event channel. If this\n * timer expires while the corresponding partner topic is never activated, the event channel and\n * corresponding partner topic are deleted..\n *\n * @param expirationTimeIfNotActivatedUtc Expiration time of the event channel. If this timer expires while\n * the corresponding partner topic is never activated, the event channel and corresponding partner topic\n * are deleted.\n * @return the next definition stage.\n */\n Update withExpirationTimeIfNotActivatedUtc(OffsetDateTime expirationTimeIfNotActivatedUtc);\n }\n /** The stage of the EventChannel update allowing to specify filter. */\n interface WithFilter {\n /**\n * Specifies the filter property: Information about the filter for the event channel..\n *\n * @param filter Information about the filter for the event channel.\n * @return the next definition stage.\n */\n Update withFilter(EventChannelFilter filter);\n }\n /** The stage of the EventChannel update allowing to specify partnerTopicFriendlyDescription. */\n interface WithPartnerTopicFriendlyDescription {\n /**\n * Specifies the partnerTopicFriendlyDescription property: Friendly description about the topic. This can be\n * set by the publisher/partner to show custom description for the customer partner topic. This will be\n * helpful to remove any ambiguity of the origin of creation of the partner topic for the customer..\n *\n * @param partnerTopicFriendlyDescription Friendly description about the topic. This can be set by the\n * publisher/partner to show custom description for the customer partner topic. This will be helpful to\n * remove any ambiguity of the origin of creation of the partner topic for the customer.\n * @return the next definition stage.\n */\n Update withPartnerTopicFriendlyDescription(String partnerTopicFriendlyDescription);\n }\n }\n /**\n * Refreshes the resource to sync with Azure.\n *\n * @return the refreshed resource.\n */\n EventChannel refresh();\n\n /**\n * Refreshes the resource to sync with Azure.\n *\n * @param context The context to associate with this operation.\n * @return the refreshed resource.\n */\n EventChannel refresh(Context context);\n}", "private void createNotification(FoodEvents event) {\n Context context = getBaseContext();\n NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context).setSmallIcon(R.drawable.ic_launcher).setContentTitle(event.getTitle())\n .setContentText(event.getDescription());\n Intent resultIntent = new Intent(this, EventDetails.class);\n resultIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n resultIntent.putExtra(EventDetails.EXTRA_EVENT, event);\n PendingIntent resultPendingIntent = PendingIntent.getActivity(getBaseContext(), 0, resultIntent, PendingIntent.FLAG_UPDATE_CURRENT, null);\n mBuilder.setContentIntent(resultPendingIntent);\n NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);\n mNotificationManager.notify(MESSAGE_NOTIFICATION_ID, mBuilder.build());\n notifyMyWatch(event);\n }", "@Override\n protected void append(E eventObject) {\n if (!isStarted()) {\n return;\n }\n if (evWarnError != null) {\n ILoggingEvent ev = ((ILoggingEvent) eventObject);\n if (ev.getLevel().equals(Level.ERROR) || ev.getLevel().equals(Level.WARN)) {\n evWarnError.updateEventWithFlush(\n new WarnErrorEvent(ev.getFormattedMessage(), ev.getLevel(),\n ev.getThreadName(), ev.getLoggerName()));\n }\n }\n }", "public static Notification buildNotification(Event event, Map<String, String> placeHolderData)\n throws IdentityEventException, NotificationRuntimeException {\n String sendTo = placeHolderData.get(NotificationConstants.EmailNotification.ARBITRARY_SEND_TO);\n Map<String, String> userClaims = new HashMap<>();\n String notificationEvent = (String) event.getEventProperties().get(NotificationConstants.EmailNotification.EMAIL_TEMPLATE_TYPE);\n String username = (String) event.getEventProperties().get(IdentityEventConstants.EventProperty.USER_NAME);\n org.wso2.carbon.user.core.UserStoreManager userStoreManager = (org.wso2.carbon.user.core.UserStoreManager) event.getEventProperties().get(\n IdentityEventConstants.EventProperty.USER_STORE_MANAGER);\n String userStoreDomainName = (String) event.getEventProperties().get(IdentityEventConstants.EventProperty.USER_STORE_DOMAIN);\n String tenantDomain = (String) event.getEventProperties().get(IdentityEventConstants.EventProperty.TENANT_DOMAIN);\n String sendFrom = (String) event.getEventProperties().get(NotificationConstants.EmailNotification.ARBITRARY_SEND_FROM);\n\n if (StringUtils.isNotBlank(username) && userStoreManager != null) {\n userClaims = NotificationUtil.getUserClaimValues(username, userStoreManager);\n } else if (StringUtils.isNotBlank(username) && StringUtils.isNotBlank(userStoreDomainName) &&\n StringUtils.isNotBlank(tenantDomain)) {\n userClaims = NotificationUtil.getUserClaimValues(username, userStoreDomainName, tenantDomain);\n }\n\n String locale = NotificationConstants.EmailNotification.LOCALE_DEFAULT;\n if (userClaims.containsKey(NotificationConstants.EmailNotification.CLAIM_URI_LOCALE)) {\n locale = userClaims.get(NotificationConstants.EmailNotification.CLAIM_URI_LOCALE);\n }\n //Only sendTo value read from claims if it is not set the event sender.\n if (StringUtils.isEmpty(sendTo)) {\n if (userClaims.containsKey(NotificationConstants.EmailNotification.CLAIM_URI_EMAIL)) {\n sendTo = userClaims.get(NotificationConstants.EmailNotification.CLAIM_URI_EMAIL);\n }\n if (StringUtils.isEmpty(sendTo)) {\n throw new IdentityEventException(\"Email notification sending failed. \" +\n \"Sending email address is not configured for the user.\");\n }\n }\n\n EmailTemplate emailTemplate;\n try {\n emailTemplate = NotificationHandlerDataHolder.getInstance().getEmailTemplateManager().getEmailTemplate(notificationEvent, locale, tenantDomain);\n } catch (I18nEmailMgtException e) {\n String message = \"Error when retrieving template from tenant registry.\";\n throw NotificationRuntimeException.error(message, e);\n }\n\n // This is added to change the copyright year in the email templates dynamically.\n int currentYear = Calendar.getInstance().get(Calendar.YEAR);\n placeHolderData.put(\"current-year\", String.valueOf(currentYear));\n\n NotificationUtil.getPlaceholderValues(emailTemplate, placeHolderData, userClaims);\n\n Notification.EmailNotificationBuilder builder =\n new Notification.EmailNotificationBuilder(sendTo);\n builder.setSendFrom(sendFrom);\n builder.setTemplate(emailTemplate);\n builder.setPlaceHolderData(placeHolderData);\n Notification emailNotification = builder.build();\n return emailNotification;\n }", "@Override\n public void writeTo(MwsWriter w) {\n w.write(\"http://mws.amazonservices.com/Finances/2015-05-01\", \"PayWithAmazonEvent\",this);\n }", "public WrappingRequestMessageAdaptationEvent(RequestMessage message, AdaptationEvent event) {\r\n this.message = message;\r\n this.event = event;\r\n }", "public void saveMeta( HadoopExitMeta meta ) {\n // Set outKey\n if ( meta.getOutKeyFieldname() == null && getOutKeyFieldname() != null ) {\n meta.setOutKeyFieldname( getOutKeyFieldname() );\n meta.setChanged();\n } else if ( meta.getOutKeyFieldname() != null && !meta.getOutKeyFieldname().equals( getOutKeyFieldname() ) ) {\n meta.setOutKeyFieldname( getOutKeyFieldname() );\n meta.setChanged();\n }\n\n // Set outValue\n if ( meta.getOutValueFieldname() == null && getOutValueFieldname() != null ) {\n meta.setOutValueFieldname( getOutValueFieldname() );\n meta.setChanged();\n } else if ( meta.getOutValueFieldname() != null && !meta.getOutValueFieldname().equals( getOutValueFieldname() ) ) {\n meta.setOutValueFieldname( getOutValueFieldname() );\n meta.setChanged();\n }\n }", "@Override\n\tpublic void onApplicationEvent(SessionDisconnectEvent event) {\n\t\tLOGGER.info(\"offline: {}\",\"SessionDisconnectEvent\");\n\t}", "public String getEventNote() {\r\n\t\treturn eventNote;\r\n\t}", "protected void normalizeEventTimes()\n {\n this.m_eventStartTime = (this.event_start_time == EASMessage.IMMEDIATE_START_TIME) ? System.currentTimeMillis()\n : (this.event_start_time * 1000L) + EASMessage.START_TIME_EPOCH;\n\n this.m_eventExpirationTime = (this.event_duration == EASMessage.INDEFINITE_EVENT_DURATION) ? Long.MAX_VALUE\n : this.m_eventStartTime + (this.event_duration * 60L * 1000L);\n }", "public interface Events {\n\n /**\n * Archive has stored the entities within a SIP.\n * <p>\n * Indicates that a SIP has been sent to the archive. May represent an add,\n * or an update.\n * </p>\n * <p>\n * <dl>\n * <dt>eventType</dt>\n * <dd>{@value}</dd>\n * <dt>eventOutcome</dt>\n * <dd>Number of entities archived</dd>\n * <dt>eventTarget</dt>\n * <dd>every archived entity</dd>\n * </dl>\n * </p>\n */\n public static final String ARCHIVE = \"archive\";\n\n /**\n * Signifies that an entity has been identified as a member of a specific\n * batch load process.\n * <p>\n * There may be an arbitrary number of independent events signifying the\n * same batch (same outcome, date, but different sets of targets). A unique\n * combination of date and outcome (batch label) identify a batch.\n * </p>\n * <p>\n * <dl>\n * <dt>eventType</dt>\n * <dd>{@value}</dd>\n * <dt>eventOutcome</dt>\n * <dd>Batch label/identifier</dd>\n * <dt>eventTarget</dt>\n * <dd>Entities in a batch</dd>\n * </dl>\n * </p>\n */\n public static final String BATCH = \"batch\";\n\n /**\n * File format characterization.\n * <p>\n * Indicates that a format has been verifiably characterized. Format\n * characterizations not accompanied by a corresponding characterization\n * event can be considered to be unverified.\n * </p>\n * <p>\n * <dl>\n * <dt>eventType</dt>\n * <dd>{@value}</dd>\n * <dt>eventOutcome</dt>\n * <dd>format, in the form \"scheme formatId\" (whitespace separated)</dd>\n * <dt>eventTarget</dt>\n * <dd>id of characterized file</dd>\n * </dl>\n * </p>\n */\n public static final String CHARACTERIZATION_FORMAT =\n \"characterization.format\";\n\n /**\n * Advanced file characterization and/or metadata extraction.\n * <p>\n * Indicates that some sort of characterization or extraction has produced a\n * document containing file metadata.\n * </p>\n * *\n * <dl>\n * <dt>eventType</dt>\n * <dd>{@value}</dd>\n * <dt>eventOutcome</dt>\n * <dd>id of File containing metadata</dd>\n * <dt>eventTarget</dt>\n * <dd>id of File the metadata describes</dd>\n * </dl>\n */\n public static final String CHARACTERIZATION_METADATA =\n \"characterization.metadata\";\n\n /**\n * Initial deposit/transfer of an item into the DCS, preceding ingest.\n * <p>\n * <dl>\n * <dt>eventType</dt>\n * <dd>{@value}</dd>\n * <dt>eventOutcome</dt>\n * <dd>SIP identifier uid</dd>\n * <dt>eventTarget</dt>\n * <dd>id of deposited entity</dd>\n * </dl>\n * </p>\n */\n public static final String DEPOSIT = \"deposit\";\n\n /**\n * Content retrieved by dcs.\n * <p>\n * Represents the fact that content has been downloaded/retrieved by the\n * dcs.\n * </p>\n * <dl>\n * <dt>eventType</dt>\n * <dd>{@value}</dd>\n * <dt>eventOutcome</dt>\n * <dd>http header-like key/value pairs representing circumstances\n * surrounding upload</dd>\n * <dt>eventTarget</dt>\n * <dd>id of File whose staged content has been downloaded</dd>\n * </dl>\n */\n public static final String FILE_DOWNLOAD = \"file.download\";\n\n /**\n * uploaaded/downloaded file content resolution.\n * <p>\n * Indicates that the reference URI to a unit of uploaded or downloaded file\n * content has been resolved and replaced with the DCS file access URI.\n * </p>\n * <dl>\n * <dt>eventType</dt>\n * <dd>{@value}</dd>\n * <dt>eventOutcome</dt>\n * <dd><code>reference_URI</code> 'to' <code>dcs_URI</code></dd>\n * <dt>eventTarget</dt>\n * <dd>id of File whose staged content has been resolved</dd>\n * </dl>\n */\n public static final String FILE_RESOLUTION_STAGED = \"file.resolution\";\n\n /**\n * Indicates the uploading of file content.\n * <p>\n * Represents the physical receipt of bytes from a client.\n * </p>\n * <dl>\n * <dt>eventType</dt>\n * <dd>{@value}</dd>\n * <dt>eventOutcome</dt>\n * <dd>http header-like key/value pairs representing circumstanced\n * surrounding upload</dd>\n * <dt>eventTarget</dt>\n * <dd>id of File whose staged content has been uploaded</dd>\n * </dl>\n */\n public static final String FILE_UPLOAD = \"file.upload\";\n\n /**\n * Fixity computation/validation for a particular File.\n * <p>\n * Indicates that a particular digest has been computed for given file\n * content. Digest values not accompanied by a corresponding event may be\n * considered to be un-verified.\n * </p>\n * <p>\n * <dl>\n * <dt>eventType</dt>\n * <dd>{@value}</dd>\n * <dt>eventOutcome</dt>\n * <dd>computed digest value of the form \"alorithm value\" (whitepsace\n * separated)</dd>\n * <dt>eventTarget</dt>\n * <dd>id of digested file</dd>\n * </dl>\n * </p>\n */\n public static final String FIXITY_DIGEST = \"fixity.digest\";\n\n /**\n * Assignment of an identifier to the given entity, replacing an\n * existing/temporary id. *\n * <dl>\n * <dt>eventType</dt>\n * <dd>{@value}</dd>\n * <dt>eventOutcome</dt>\n * <dd><code>old_identifier</code> 'to' <code>new_identifier</code></dd>\n * <dt>eventTarget</dt>\n * <dd>new id of object</dd>\n * </dl>\n */\n public static final String ID_ASSIGNMENT = \"identifier.assignment\";\n\n /**\n * Marks the start of an ingest process.\n * <p>\n * <dl>\n * <dt>eventType</dt>\n * <dd>{@value}</dd>\n * <dt>eventTarget</dt>\n * <dd>id of all entities an ingest SIP</dd>\n * </dl>\n * </p>\n */\n public static final String INGEST_START = \"ingest.start\";\n\n /**\n * Signifies a successful ingest outcome.\n * <p>\n * <dl>\n * <dt>eventType</dt>\n * <dd>{@value}</dd>\n * <dt>eventTarget</dt>\n * <dd>id of all entities an ingest SIP</dd>\n * </dl>\n * </p>\n */\n public static final String INGEST_SUCCESS = \"ingest.complete\";\n\n /**\n * Signifies a failed ingest outcome.\n * <p>\n * <dl>\n * <dt>eventType</dt>\n * <dd>{@value}</dd>\n * <dt>eventTarget</dt>\n * <dd>id of all entities an ingest SIP</dd>\n * </dl>\n * </p>\n */\n public static final String INGEST_FAIL = \"ingest.fail\";\n\n /**\n * Signifies that a feature extraction or transform has successfully\n * occurred.\n * <p>\n * <dl>\n * <dt>eventType</dt>\n * <dd>{@value}</dd>\n * <dt>eventTarget</dt>\n * <dd>id of a DeliverableUnit or Collection</dd>\n * </dl>\n * </p>\n */\n public static final String TRANSFORM = \"transform\";\n\n /**\n * Signifies that a feature extraction or transform failed.\n * <p>\n * <dl>\n * <dt>eventType</dt>\n * <dd>{@value}</dd>\n * <dt>eventTarget</dt>\n * <dd>id of a DeliverableUnit or Collection</dd>\n * </dl>\n * </p>\n */\n public static final String TRANSFORM_FAIL = \"transform.fail\";\n\n /**\n * Signifies a file has been scanned by the virus scanner.\n * <p>\n * Indicates that a file has been scanned by a virus scanner. There could be\n * more than one event for a file.\n * </p>\n * <p>\n * <dl>\n * <dt>eventType</dt>\n * <dd>{@value}</dd>\n * <dt>eventTarget</dt>\n * <dd>id of file whose content was scanned</dd>\n * </dl>\n * </p>\n */\n public static final String VIRUS_SCAN = \"virus.scan\";\n\n /**\n * Signifies an new deliverable unit is being ingested as an update to the target deliverable unit.\n * <p>\n * <dl>\n * <dt>eventType</dt>\n * <dd>{@value}</dd>\n * <dt>eventTarget</dt>\n * <dd>id of the deliverable unit being updated</dd>\n * </dl>\n * </p>\n */\n public static final String DU_UPDATE = \"du.update\";\n\n}", "protected DsSipEventHeaderBase(DsByteString eventPackage, DsByteString subPackage) {\n m_strPackage = eventPackage;\n appendSubPackage(subPackage);\n }", "@Override\n public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer) {\n outputFieldsDeclarer.declareStream(METRONOME_H_STREAM_ID, new Fields(CREATE_DATE, CURRENT_TIMESTAMP));\n outputFieldsDeclarer.declareStream(METRONOME_D_STREAM_ID, new Fields(CREATE_DATE, CURRENT_TIMESTAMP));\n }", "protected void append(LoggingEvent event) {\n if(sh != null) {\n sh.send(layout.format(event));\n if(layout.ignoresThrowable()) {\n String[] s = event.getThrowableStrRep();\n if (s != null) {\n StringBuilder buf = new StringBuilder();\n for(int i = 0; i < s.length; i++) {\n buf.append(s[i]);\n buf.append(EOL);\n }\n sh.send(buf.toString());\n }\n }\n }\n }", "public interface Attribute\n{\n /**\n * Attributes common to all events.\n */\n\tpublic interface Event\n\t{\n\t\tpublic static final String EVENT_ID = \"aether.event.id\";\n\t\tpublic static final String TIME = \"aether.event.time\";\n\t\tpublic static final String EVENT_TYPE = \"aether.event.type\";\n\t}\n\n /**\n * Attributes unique to NOTICE events.\n */\n\tpublic interface Notice extends Event\n\t{\n\t\tpublic static final String TOPIC_ID = \"aether.notice.topic.id\";\n\t}\n\n /**\n * Attributes unique to Message events.\n */\n\tpublic interface Message\n\t{\n\t\tpublic static final String LINK_ID = \"aether.message.link.id\";\n }\n\n /**\n * Attributes unique to REQUEST events.\n */\n\tpublic interface Request extends Message\n\t{\n String DESTINATION = \"aether.message.dest\";\n }\n\n /**\n * Attributes unique to RESPONSE events.\n */\n\tpublic interface Response extends Message\n\t{\n public static final String RESPONSE_TO = \"aether.response.response-to\";\n\t}\n}", "WithCreate withDestination(EventChannelDestination destination);", "@JsonProperty(\"EventDateTime\")\r\n\tpublic void setEventDateTime(String eventDateTime) {\r\n\t\tthis.eventDateTime = eventDateTime;\r\n\t}", "<E extends CtElement> E putMetadata(String key, Object val);", "private void addPaymentAbandonedEvent() {\n /*09th July 2019, Resolved Pyze library issue*/\n HashMap<String, Object> customAttributes = new HashMap<String, Object>();\n customAttributes.put(\"packageID\", String.valueOf(PackageID));\n customAttributes.put(\"userID\", String.valueOf(UserID));\n customAttributes.put(\"paymentType\", getIntent().getStringExtra(\"PaymentType\"));\n PyzeEvents.PyzeCommercePayment.postPaymentAbandoned(customAttributes);\n\n sendToMixpanel(false, true);\n\n }", "public interface FlowEventDumpData {\n String getTaskId();\n\n void setTaskId(String taskId);\n\n String getFlowId();\n\n void setFlowId(String flowId);\n\n String getType();\n\n void setType(String type);\n\n long getBandwidth();\n\n void setBandwidth(long bandwidth);\n\n boolean isIgnoreBandwidth();\n\n void setIgnoreBandwidth(boolean ignoreBandwidth);\n\n FlowSegmentCookie getForwardCookie();\n\n void setForwardCookie(FlowSegmentCookie forwardCookie);\n\n FlowSegmentCookie getReverseCookie();\n\n void setReverseCookie(FlowSegmentCookie reverseCookie);\n\n SwitchId getSourceSwitch();\n\n void setSourceSwitch(SwitchId sourceSwitch);\n\n SwitchId getDestinationSwitch();\n\n void setDestinationSwitch(SwitchId destinationSwitch);\n\n int getSourcePort();\n\n void setSourcePort(int sourcePort);\n\n int getDestinationPort();\n\n void setDestinationPort(int destinationPort);\n\n int getSourceVlan();\n\n void setSourceVlan(int sourceVlan);\n\n int getDestinationVlan();\n\n void setDestinationVlan(int destinationVlan);\n\n Integer getSourceInnerVlan();\n\n void setSourceInnerVlan(Integer sourceInnerVlan);\n\n Integer getDestinationInnerVlan();\n\n void setDestinationInnerVlan(Integer destinationInnerVlan);\n\n MeterId getForwardMeterId();\n\n void setForwardMeterId(MeterId forwardMeterId);\n\n MeterId getReverseMeterId();\n\n void setReverseMeterId(MeterId reverseMeterId);\n\n String getDiverseGroupId();\n\n void setDiverseGroupId(String diverseGroupId);\n\n String getAffinityGroupId();\n\n void setAffinityGroupId(String affinityGroupId);\n\n String getForwardPath();\n\n void setForwardPath(String forwardPath);\n\n String getReversePath();\n\n void setReversePath(String reversePath);\n\n FlowPathStatus getForwardStatus();\n\n void setForwardStatus(FlowPathStatus forwardStatus);\n\n FlowPathStatus getReverseStatus();\n\n void setReverseStatus(FlowPathStatus reverseStatus);\n\n Boolean isAllocateProtectedPath();\n\n void setAllocateProtectedPath(Boolean allocateProtectedPath);\n\n Boolean isPinned();\n\n void setPinned(Boolean pinned);\n\n Boolean isPeriodicPings();\n\n void setPeriodicPings(Boolean periodicPings);\n\n FlowEncapsulationType getEncapsulationType();\n\n void setEncapsulationType(FlowEncapsulationType encapsulationType);\n\n PathComputationStrategy getPathComputationStrategy();\n\n void setPathComputationStrategy(PathComputationStrategy pathComputationStrategy);\n\n Long getMaxLatency();\n\n void setMaxLatency(Long maxLatency);\n\n Long getMaxLatencyTier2();\n\n void setMaxLatencyTier2(Long maxLatencyTier2);\n\n Integer getPriority();\n\n void setPriority(Integer priority);\n\n List<MirrorPointStatus> getMirrorPointStatuses();\n\n void setMirrorPointStatuses(List<MirrorPointStatus> mirrorPointStatuses);\n\n boolean isStrictBandwidth();\n\n void setStrictBandwidth(boolean ignoreBandwidth);\n\n SwitchId getLoopSwitchId();\n\n void setLoopSwitchId(SwitchId switchId);\n\n }", "@Override\n\tpublic List generateScheduledEventData(List<Meeting> meetings) {\n\t\treturn null;\n\t}", "@Override\n public void onCustomEvent(CustomEvent customEvent) {\n }", "interface WithExpirationTimeIfNotActivatedUtc {\n /**\n * Specifies the expirationTimeIfNotActivatedUtc property: Expiration time of the event channel. If this\n * timer expires while the corresponding partner topic is never activated, the event channel and\n * corresponding partner topic are deleted..\n *\n * @param expirationTimeIfNotActivatedUtc Expiration time of the event channel. If this timer expires while\n * the corresponding partner topic is never activated, the event channel and corresponding partner topic\n * are deleted.\n * @return the next definition stage.\n */\n WithCreate withExpirationTimeIfNotActivatedUtc(OffsetDateTime expirationTimeIfNotActivatedUtc);\n }", "Event persist(String origin, String aggregateId, String type, String payload);", "public DaprSubscriptionBuilder setMetadata(Map<String, String> metadata) {\n this.metadata = metadata;\n return this;\n }", "public void setMetadata(PDMetadata meta)\n {\n stream.setItem(COSName.METADATA, meta);\n }", "@Override\n\tpublic String toString() {\n\t\t\n\t\treturn \"[ \"+ event_code + \",\"+ insert_ts + \" ] = \" + short_description ;\n\t\t\n//\t\treturn \"[ \\\"event_code\\\" : \" + \"\\\"\" + event_code + \"\\\" , \\\"update_TS\\\" : \" + \"\\\"\" + insert_ts + \"\\\", \\\"short_Description\\\" : \\\" \"\n//\t\t\t\t+ \"\\\"\" + short_description + \"\\\"\" + \" ]\";\n\t}", "public void sendMetadataPacket(Object nmsEntity, int entityId) {\n // The NMS DataWatcher deals with checking an entity for data changes, we use it to send the metadata packet\n Object dataWatcher = ReflectUtils.getField(nmsEntity, \"datawatcher\");\n Object dataPacket = ReflectUtils.newInstance(\"PacketPlayOutEntityMetadata\", new Class[]{int.class, dataWatcher.getClass(), boolean.class},\n new Object[]{entityId, dataWatcher, true});\n sendPacket(dataPacket);\n \n }", "Observable<Session> updateSession(RelyingParty relyingParty, Session session, Map<String, String> additionalUserInfo);", "protected void publishToStream(Map<String, String> dataMap, Event event) throws IdentityEventException{\n\n EventStreamService service = NotificationHandlerDataHolder.getInstance().getEventStreamService();\n org.wso2.carbon.databridge.commons.Event databridgeEvent = new org.wso2.carbon.databridge.commons.Event();\n databridgeEvent.setTimeStamp(System.currentTimeMillis());\n\n try {\n databridgeEvent.setStreamId(getStreamDefinitionID(event));\n } catch (IdentityEventException e) {\n throw new IdentityEventException(\"Stream definition was not specified in the \" +\n \"identity-event.properties file for \" + event.getEventName());\n }\n\n databridgeEvent.setArbitraryDataMap(dataMap);\n service.publish(databridgeEvent);\n }", "@Override\n\tpublic void insertOrderOutCallLog(Map req) {\n\t\tString log_id=this.baseDaoSupport.getSequences(\"o_outcall_log\");\n\t\treq.put(\"log_id\",log_id);\n//\t\tthis.baseDaoSupport.in\n\t this.baseDaoSupport.insert(\"es_order_outcall_log\", req);\n\t}", "private boolean hidePayload() {\n return Optional.ofNullable(tenantPropertiesService.getTenantProps())\n .map(TenantProperties::getEvent)\n .map(TenantProperties.Event::getHidePayload)\n .orElse(Boolean.TRUE);\n }", "interface WithExpirationTimeIfNotActivatedUtc {\n /**\n * Specifies the expirationTimeIfNotActivatedUtc property: Expiration time of the event channel. If this\n * timer expires while the corresponding partner topic is never activated, the event channel and\n * corresponding partner topic are deleted..\n *\n * @param expirationTimeIfNotActivatedUtc Expiration time of the event channel. If this timer expires while\n * the corresponding partner topic is never activated, the event channel and corresponding partner topic\n * are deleted.\n * @return the next definition stage.\n */\n Update withExpirationTimeIfNotActivatedUtc(OffsetDateTime expirationTimeIfNotActivatedUtc);\n }", "@Override\r\n\tpublic void endElement(String uri, String localName, String qName)\r\n\t\t\tthrows SAXException {\n\t\tif(qName.equalsIgnoreCase(\"item\")){\r\n\t\t\t//tempEvent = new PragyanEventData();\r\n\t\t}\r\n\t\tif(qName.equalsIgnoreCase(\"item\")){\r\n\t\t\ttempEvent = new PragyanEventData();\r\n\t\t}\r\n\t\tif(qName.equalsIgnoreCase(\"itemname\")){\r\n\t\t\ttempEvent.setEventName(tempString);\r\n\t\t}\r\n\t\tif(qName.equalsIgnoreCase(\"one\")){\r\n\t\t\ttempEvent.setEventCaption(tempString);\r\n\t\t}\r\n\t\t\r\n\t\tif(qName.equalsIgnoreCase(\"imgurl\")){\r\n\t\t\ttempEvent.setEventImage(tempString);\r\n\t\t}\r\n\t\tif(qName.equalsIgnoreCase(\"starttime\")){\r\n\t\t\ttry { \r\n\t\t\t\t//Log.d(\"TIMESTART\", tempString);\r\n\t\t\t Date time = format.parse(dateWriter.toString()); \r\n\t\t\t \r\n\t\t\t tempEvent.addStartTime(time);\r\n\t\t\t\t\r\n\t\t\t\twritingDate = false;\r\n\t\t\t\tdateWriter.reset();\r\n\t\t\t} catch (java.text.ParseException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\ttempString=\"\";\r\n\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tfinally{}\r\n\t\t}\r\n\t\t\r\n\t\tif(qName.equalsIgnoreCase(\"endtime\")){\r\n\t\t\ttry { \r\n\t\t\t\t//Log.d(\"TIMEEND\", tempString);\r\n\t\t\t Date time = format.parse(dateWriter.toString()); \r\n\t\t\t\ttempEvent.addEndTime(time);\r\n\t\t\t\ttempString=\"\";\r\n\t\t\t\twritingDate = false;\r\n\t\t\t\tdateWriter.reset();\r\n\r\n\t\t\t} catch (java.text.ParseException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t//Log.d(\"ERROR\", tempEvent.getEventName());\r\n\t\t\t\t//Log.d(\"ERROR\", tempString);\r\n\t\t\t\ttempString=\"\";\r\n\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tfinally{}\r\n\t\t}\r\n\t\t\r\n\t\tif(qName.equalsIgnoreCase(\"children\")){\r\n\t\t\ttempEvent =stackEvents.pop();\r\n\t\t}\r\n\t\tif(qName.equalsIgnoreCase(\"main\")){\r\n\t\t\ttempEvent.addPageTitle(\"About\");\r\n\t\t\ttempString = tempString.replace(\"$$##$$\", \"\\n\");\r\n\t\t\ttempString = tempString.replace(\"$$!!$$\", \" \");\r\n\t\t\ttempString = tempString.replace(\"$$%%$$\", \" \");\r\n\t\t\t//Log.d(\"MAIN\",tempString);\r\n\t\t\ttempEvent.addPageContent(tempString);\r\n\t\t\tstartPage=false;\r\n\t\t}\r\n\t\tif(qName.equalsIgnoreCase(\"pagename\")){\r\n\t\t\tif(startPage){\r\n\t\t\t\t////Log.d(\"FIXIT\",tempString.trim());\r\n\t\t\t\ttempEvent.addPageTitle(tempString.trim());\r\n\t\t\t\ttempString=\"\";\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(qName.equalsIgnoreCase(\"pgimg\")){\r\n\t\t\tif(startPage){\r\n\t\t\t\ttempEvent.setEventSecondaryImage(rootUrl+tempString);\r\n\t\t\t\ttempString=\"\";\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(qName.equalsIgnoreCase(\"content\")){\r\n\t\t\t//Log.d(\"ACTION\",\"hit contentend\"+String.valueOf(startPage)+\":\"+tempString);\r\n\t\t\tif(startPage){\r\n\t\t\t\ttempEvent.addPageContent(charWriter.toString());\r\n\t\t\t\t////Log.d(\"CONT\",charWriter.toString());\r\n\t\t\t\ttempString=\"\";\r\n\t\t\t\tcharWriter.reset();\r\n\t\t\t\tstartContent = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(qName.equalsIgnoreCase(\"page\")){\r\n\t\t\t////Log.d(\"FOXIT\",\"pageend:\"+String.valueOf(tempEvent.pageTitles.size()));\r\n\t\t\tstartPage=false;\r\n\t\t}\r\n\t\t\r\n\t}", "public io.emqx.exhook.RequestMeta getMeta() {\n if (metaBuilder_ == null) {\n return meta_ == null ? io.emqx.exhook.RequestMeta.getDefaultInstance() : meta_;\n } else {\n return metaBuilder_.getMessage();\n }\n }", "protected void logCustomEvent(JSONArray args, final CallbackContext callbackContext) {\n\t\tLog.d(TAG, \"LOGCUSTOMEVENT\");\n\t\ttry {\n\t\t String name = args.getString(0);\n\t\t\tJSONObject dataJSON = args.getJSONObject(1);\n\t\t\tNotificare.shared().getEventLogger().logCustomEvent(name, dataJSON);\n\t\t\tif (callbackContext == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcallbackContext.success();\n\t\t} catch (JSONException e) {\n\t\t\tif (callbackContext == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcallbackContext.error(\"JSON parse error\");\n\t\t}\n\t}", "private void sendEventToServer() throws UnknownHostException, IOException {\n \t\t\n \t\tSocket socket = null; \n \t\t\n \t\tsocket = new Socket(Constants.ServerIp, Constants.Port);\n \t\t\n \t\tObjectOutputStream serializer = null;\n \t\t\n \t\tserializer = new ObjectOutputStream(socket.getOutputStream());\n \t\t//TODO: Send a message to server for new Event\n \t\t\n \t\tMessageType t = MessageType.newPubEventMessage;\n \t\tserializer.writeObject(t);\n \t\tserializer.writeObject(event);\n \t\tserializer.flush();\n \t\t//TODO: Send the event\n \t\t//TODO: Send to Pending Screen\n \t}", "private ServerEntityMetadataPacket() {}", "@Subscribe\n public void onDeviceInfo(final DeviceInformation event) {\n\n apiService.onSendDeviceInfo(event, new Callback<DeviceInfoSuccess>() {\n\n @Override\n public void success(DeviceInfoSuccess retroResponse, Response response) {\n\n if(retroResponse != null) {\n bus.post(new DeviceInfoSuccess(retroResponse));\n //ealmObjectController.cachedResult(MainFragmentActivity.getContext(), (new Gson()).toJson(retroResponse));\n RealmObjectController.cachedResultWithType(MainFragmentActivity.getContext(), (new Gson()).toJson(retroResponse),\"SplashInfo\");\n\n }else{\n BaseFragment.setAlertNotification(MainFragmentActivity.getContext());\n }\n\n }\n\n @Override\n public void failure(RetrofitError error) {\n BaseFragment.setAlertNotification(MainFragmentActivity.getContext());\n }\n\n });\n }", "@Override\n public Object setMetadata(String key, Object value) {\n return null;\n }", "@FunctionalInterface\npublic interface MetadataHandler\n{\n /**\n * Called when the metadata has been read. The buffer with this data should not be assumed to exist outside of the\n * lifetime of this callback. You should copy the data inside the callback if you want to to use it afterwards.\n *\n * If the status of the callback is not OK the length will be 0 and the read has resulted in an error.\n *\n * @param sessionId the id of the session that this metadata has been written\n * @param status whether the read has been successful or resulted in an error.\n * @param buffer buffer with the metadata in.\n * @param offset offset within the buffer.\n * @param length length of the data within the buffer.\n */\n void onMetaData(\n long sessionId,\n MetaDataStatus status,\n DirectBuffer buffer,\n int offset,\n int length);\n}", "@Override\r\n\tpublic Long getEventId() {\n\t\treturn null;\r\n\t}", "public EventNotificationConverter(NotificationEvent sdkNotificationEvent) {\n this.sdkNotificationEvent = sdkNotificationEvent;\n }", "byte[] writeEvent(ProcessInstance processInstance, Object value) throws IOException;", "public final void event(final JSONObject builddata) {\n logger.fine(\"Sending event\");\n\n // Gather data\n JSONObject payload = new JSONObject();\n String hostname = nullSafeGetString(builddata, \"hostname\");\n String number = nullSafeGetString(builddata, \"number\");\n String buildurl = nullSafeGetString(builddata, \"buildurl\");\n String job = nullSafeGetString(builddata, \"job\");\n long timestamp = builddata.getLong(\"timestamp\");\n String message = \"\";\n\n // Setting source_type_name here, to allow modification based on type of event\n payload.put(\"source_type_name\", \"jenkins\");\n\n // Build title\n StringBuilder title = new StringBuilder();\n title.append(job).append(\" build #\").append(number);\n if ( \"SUCCESS\".equals( builddata.get(\"result\") ) ) {\n title.append(\" succeeded\");\n payload.put(\"alert_type\", \"success\");\n message = \"%%% \\n [See results for build #\" + number + \"](\" + buildurl + \") \";\n } else if ( builddata.get(\"result\") != null ) {\n title.append(\" failed\");\n payload.put(\"alert_type\", \"failure\");\n message = \"%%% \\n [See results for build #\" + number + \"](\" + buildurl + \") \";\n } else {\n title.append(\" started\");\n payload.put(\"alert_type\", \"info\");\n message = \"%%% \\n [Follow build #\" + number + \" progress](\" + buildurl + \") \";\n // Remove source_type_name to keep started events from being rolled up\n payload.remove(\"source_type_name\");\n }\n title.append(\" on \").append(hostname);\n\n // Add duration\n if ( builddata.get(\"duration\") != null ) {\n message = message + durationToString(builddata.getDouble(\"duration\"));\n }\n\n // Close markdown\n message = message + \" \\n %%%\";\n\n // Build payload\n payload.put(\"title\", title.toString());\n payload.put(\"text\", message);\n payload.put(\"date_happened\", timestamp);\n payload.put(\"event_type\", builddata.get(\"event_type\"));\n payload.put(\"host\", hostname);\n payload.put(\"result\", builddata.get(\"result\"));\n payload.put(\"tags\", assembleTags(builddata));\n payload.put(\"aggregation_key\", job); // Used for job name in event rollups\n\n post(payload, this.EVENT);\n }" ]
[ "0.52264535", "0.5062785", "0.4938376", "0.49103796", "0.47853476", "0.4773421", "0.47556144", "0.47485334", "0.47434682", "0.47410858", "0.47309276", "0.46732357", "0.4669621", "0.46687186", "0.46130997", "0.45965275", "0.45750713", "0.4571275", "0.45688945", "0.45504946", "0.45435494", "0.45416865", "0.4539233", "0.45318207", "0.45210874", "0.4510968", "0.4502009", "0.44833195", "0.44832203", "0.4478171", "0.44751343", "0.4465746", "0.44565678", "0.44297898", "0.44270432", "0.4422106", "0.44087833", "0.43755624", "0.43735495", "0.43686348", "0.43633497", "0.4360816", "0.43561453", "0.435549", "0.43485284", "0.43425894", "0.43360662", "0.43348205", "0.43240657", "0.43233034", "0.4320464", "0.43148202", "0.43113285", "0.43068725", "0.43044743", "0.42991388", "0.42960018", "0.42957243", "0.42916963", "0.42907044", "0.42900616", "0.42876828", "0.4277697", "0.426755", "0.42641744", "0.4261504", "0.42594138", "0.42579624", "0.42495394", "0.42463863", "0.42433685", "0.4239585", "0.42364243", "0.42312685", "0.422659", "0.42262623", "0.42197752", "0.42186084", "0.42180285", "0.42144674", "0.42095184", "0.42062598", "0.42013857", "0.4200998", "0.42004418", "0.4197382", "0.41905758", "0.4187316", "0.4187186", "0.41869524", "0.41839597", "0.41822392", "0.41821033", "0.41786203", "0.4176006", "0.4171123", "0.41650593", "0.41642565", "0.41617408", "0.41564617" ]
0.64941025
0
Schedule a request to be sent.
static synchronized void schedule(Event event) { if (ENABLED || QUEUE.size() <= MAX_QUEUE_SIZE) { QUEUE.add(event); } if (ENABLED) { if (QUEUE.size() >= MAX_QUEUE_SIZE) { sendAllScheduled(); } else { //The arrival of a new item interrupts the timer and resets the countdown. WikipediaApp.getInstance().getMainThreadHandler().removeCallbacks(SEND_RUNNABLE); WikipediaApp.getInstance().getMainThreadHandler().postDelayed(SEND_RUNNABLE, WAIT_MS); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void schedule() {\n service.scheduleDelayed(task, schedulingInterval);\n isScheduled = true;\n }", "@Override\n public void mySchedule(String date) {\n FastJsonRequest request = new FastJsonRequest(SystemUtils.mainUrl + MethodCode.CLASSSCHEDULE + MethodType.MYSCHEDULEV2, RequestMethod.POST);\n request.add(\"username\", application.getSystemUtils().getDefaultUsername());\n request.add(\"token\", application.getSystemUtils().getToken());\n request.add(\"date\", date);\n request.add(MethodCode.DEVICEID, application.getSystemUtils().getSn());\n request.add(MethodCode.DEVICETYPE, SystemUtils.deviceType);\n request.add(MethodCode.APPVERSION, SystemUtils.getVersionName(context));\n addQueue(MethodCode.EVENT_MYSCHEDULE, request);\n\n\n// startQueue();\n }", "public void requestSchedule(AsynchronousScheduleResponseHandler asrh) throws RemoteException {\n\n\t\tAsynchResponder ar = new AsynchResponder(asrh);\n\t\t(new Thread(ar)).start();\n\n\t}", "private void beginSchedule(){\n\t\tDivaApp.getInstance().submitScheduledTask(new RandomUpdater(this), RandomUpdater.DELAY, RandomUpdater.PERIOD);\n\t}", "public void schedule() {\n\t\tnew Timer().schedule(getTask(), TIME);\n\t}", "public static void scheduleJob() {\n Set<JobRequest> jobRequests = JobManager.instance().getAllJobRequestsForTag(MobssJob.TAG);\n if (!jobRequests.isEmpty()) {\n return;\n }\n\n new JobRequest.Builder(MobssJob.TAG)\n .setPeriodic(AlarmManager.INTERVAL_DAY)\n .setUpdateCurrent(true) // cancel any preexisting job with the same tag while being scheduled.\n// .setRequiredNetworkType(JobRequest.NetworkType.CONNECTED) // since the sync service needs network connection\n// .setRequirementsEnforced(true) // makes sure that all the requirements are met before starting the sync service, if at least one of the requirements is not met then the sync service will be rescheduled and not run\n .build()\n .schedule();\n }", "void schedule(ScheduledJob job);", "private void scheduleJob() {\n\n }", "public abstract void schedule();", "@Scheduled(every = \"1s\")\n void schedule() {\n if (message != null) {\n final String endpointUri = \"azure-eventhubs:?connectionString=RAW(\" + connectionString.get() + \")\";\n producerTemplate.sendBody(endpointUri, message + (counter++));\n }\n }", "public void schedule() {\n cancel();\n timer.schedule(new TimerTask() {\n @Override\n public void run() {\n runnable.run();\n }\n }, delay);\n }", "@Override\n protected Scheduler scheduler() {\n return Scheduler.newFixedRateSchedule(0, 1, TimeUnit.SECONDS);\n }", "@Override\n public void run() {\n schedule();\n }", "public void scheduleAlarm() {\n\n Calendar cal = Calendar.getInstance();\n Intent alarmIntent = new Intent(context, PeriodicTransactionService.class);\n alarmIntent.setAction(PeriodicTransactionService.ACTION);\n Bundle bundle = new Bundle();\n bundle.putInt(PeriodicTransactionService.USER_ID_PARAM, userId);\n alarmIntent.putExtras(bundle);\n PendingIntent pintent = PendingIntent.getService(context,\n MyAlarmManager.REQUEST_CODE,\n alarmIntent,\n PendingIntent.FLAG_UPDATE_CURRENT);\n AlarmManager alarm = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);\n alarm.setInexactRepeating(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), 4 * 1000, pintent);\n }", "public void scheduleJobs();", "void sendRequest(String invocationId, HttpRequest request);", "private synchronized void startRequest(long starttime){\n nextPollTime=starttime;\n prevPollTime=0;\n schedulePoll();\n }", "public void startScheduling() {\n new Thread(new Runnable() {\n public void run() {\n while(true) {\n try {\n Thread.sleep(30000);\n Calendar c = Calendar.getInstance();\n int min = c.get(Calendar.MINUTE);\n if (((min % 10) == 0) || (min == 0)) {\n boolean action = getLightOnWhenMovementDetectedSchedule().getCurrentSchedule();\n if (action) {\n configureSwitchOnWhenMovement(true);\n } else {\n configureSwitchOnWhenMovement(false);\n }\n action = getLightSchedule().getCurrentSchedule();\n if (action) {\n switchOn();\n } else {\n switchOff();\n }\n saveHistoryData();\n }\n Thread.sleep(30000);\n } catch (InterruptedException e) {\n return;\n } catch (RemoteHomeConnectionException e) {\n e.printStackTrace();\n } catch (RemoteHomeManagerException e) {\n e.printStackTrace();\n }\n }\n }\n }).start(); \n }", "public void sendRRequests() {\n\n }", "public void generateSchedule(){\n\t\t\n\t}", "public void scheduleRecurringContactsSync() {\n Driver driver = new GooglePlayDriver(mContext);\n FirebaseJobDispatcher dispatcher = new FirebaseJobDispatcher(driver);\n\n // Create the Job to periodically sync Sunshine\n Job syncContactsJob = dispatcher.newJobBuilder()\n /* The Service that will be used to sync contacts's data */\n .setService(FirebaseContanctsSyncJobService.class)\n .setTag(CONTACTS_SYNC_TAG)\n .setConstraints(Constraint.ON_ANY_NETWORK)\n .setLifetime(Lifetime.FOREVER)\n .setRecurring(true)\n .setTrigger(Trigger.executionWindow(\n SYNC_INTERVAL_SECONDS,\n SYNC_INTERVAL_SECONDS + SYNC_FLEXTIME_SECONDS))\n .setReplaceCurrent(true)\n .build();\n\n // Schedule the Job with the dispatcher\n dispatcher.schedule(syncContactsJob);\n Log.d(LOG_TAG, \"Contacts sync job scheduled\");\n }", "private void doRequest() {\n\n try {\n JsonObject request = new JsonObject()\n .put(\"action\", Math.random() < 0.5 ? \"w\" : \"r\")\n .put(\"timeOfRequest\", System.currentTimeMillis());\n\n if (request.getString(\"action\") == \"w\") {\n request.put(\"data\", new JsonObject()\n .put(\"key\", \"value\")\n );\n logger.debug(\"requesting write: \" + request.toString());\n eb.send(\"storage-write-address\", request, new DeliveryOptions().setSendTimeout(1000), this);\n } else {\n Random random = new Random();\n List<String> keys = new ArrayList<String>(map.keySet());\n String randomKey = keys.get(random.nextInt(keys.size()));\n request.put(\"id\", randomKey);\n logger.debug(\"waiting for read: \" + request.toString());\n eb.send(\"storage-read-address\", request, new DeliveryOptions().setSendTimeout(1000), this);\n }\n } catch (Exception e) {\n logger.warn(\"Error\");\n makeRequest();\n }\n\n }", "public void schedule(Context context, int requestCode)\n {\n AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);\n\n int alarmID = 0;\n Days[] days = getDays();\n int routineID = id;\n String routineName = name;\n\n Calendar routineTime = Calendar.getInstance();\n\n try\n {\n routineTime.setTime(Objects.requireNonNull(formatter.parse(time)));\n }\n catch (Exception e)\n {\n e.printStackTrace();\n }\n\n // Schedule for each selected days\n for (Days day : days)\n {\n Calendar scheduleTime = Calendar.getInstance();\n\n // Set current calendar to current system time\n scheduleTime.setTimeInMillis(System.currentTimeMillis());\n scheduleTime.set(Calendar.HOUR_OF_DAY, routineTime.get(Calendar.HOUR_OF_DAY));\n scheduleTime.set(Calendar.MINUTE, routineTime.get(Calendar.MINUTE));\n scheduleTime.set(Calendar.SECOND, 0);\n scheduleTime.set(Calendar.MILLISECOND, 0);\n scheduleTime.set(Calendar.DAY_OF_MONTH, Calendar.DAY_OF_MONTH);\n\n switch(day)\n {\n case Sunday:\n scheduleTime.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);\n break;\n\n case Monday:\n scheduleTime.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);\n break;\n\n case Tuesday:\n scheduleTime.set(Calendar.DAY_OF_WEEK, Calendar.TUESDAY);\n break;\n\n case Wednesday:\n scheduleTime.set(Calendar.DAY_OF_WEEK, Calendar.WEDNESDAY);\n break;\n\n case Thursday:\n scheduleTime.set(Calendar.DAY_OF_WEEK, Calendar.THURSDAY);\n break;\n\n case Friday:\n scheduleTime.set(Calendar.DAY_OF_WEEK, Calendar.FRIDAY);\n break;\n\n case Saturday:\n scheduleTime.set(Calendar.DAY_OF_WEEK, Calendar.SATURDAY);\n break;\n }\n\n Log.i(\"Routine\", \"----- Scheduling -----\");\n\n // Check if whether the day selected has passed, if yes then\n // add 7 days into the scheduler\n if (scheduleTime.getTimeInMillis() <= System.currentTimeMillis())\n {\n scheduleTime.add(Calendar.DAY_OF_MONTH, 7);\n Log.i(\"Routine\", \"ADD 7 DAYS\");\n }\n\n // DEBUG LOG\n Log.i(\"Routine\", \"Routine ID : \" + routineID);\n Log.i(\"Routine\", \"Day : \" + scheduleTime.get(Calendar.DAY_OF_WEEK));\n Log.i(\"Routine\", \"Hours : \" + scheduleTime.get(Calendar.HOUR_OF_DAY));\n Log.i(\"Routine\", \"Minutes : \" + scheduleTime.get(Calendar.MINUTE));\n Log.i(\"Routine\", \"DOM : \" + scheduleTime.get(Calendar.DAY_OF_MONTH));\n Log.i(\"Routine\", \"Month : \" + scheduleTime.get(Calendar.MONTH));\n\n // Intent to handle broadcast from alarm manager\n Intent intent = new Intent(context, AlarmBroadcastReceiver.class);\n intent.putExtra(\"Routine ID\", routineID);\n intent.putExtra(\"Routine Name\", routineName);\n\n PendingIntent alarmPendingIntent = PendingIntent.getBroadcast(context, (routineID * 10) + alarmID, intent, 0);\n\n // Routine will always repeating\n int RUN_WEEKLY = 24 * 7 * 60 * 60 * 1000;\n\n switch(requestCode)\n {\n case REQ_ADD_SCHEDULE:\n Log.i(\"Routine\", \"SCHEDULE ACTION ADD\");\n\n // Schedule to alarm manager\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n alarmManager.setExactAndAllowWhileIdle(\n AlarmManager.RTC_WAKEUP,\n scheduleTime.getTimeInMillis(),\n alarmPendingIntent\n );\n }\n else\n {\n alarmManager.setExact(\n AlarmManager.RTC_WAKEUP,\n scheduleTime.getTimeInMillis(),\n alarmPendingIntent\n );\n }\n\n alarmID++;\n break;\n\n case REQ_DELETE_SCHEDULE:\n Log.i(\"Routine\", \"SCHEDULE ACTION REMOVE\");\n alarmManager.cancel(alarmPendingIntent);\n alarmID++;\n break;\n }\n }\n }", "public void scheduleJob(JobInfo t) {\n Log.d(TAG, \"Scheduling job\");\n try {\n JobScheduler tm = (JobScheduler) appContext.getSystemService(appContext.JOB_SCHEDULER_SERVICE);\n tm.schedule(t);\n int i = 0;\n } catch (Exception e) {\n e.printStackTrace();\n int i = 0;\n }\n }", "private void sendRequest() {\n\t\tloading = ProgressDialog.show(this, \"Loading\", \"Please wait...\");\n\n\t\tUri.Builder uri = new Uri.Builder();\n\t\turi.authority(DatabaseContract.PROVIDER_NAME);\n\t\turi.path(Integer.toString(Constants.LOADREQUESTSCMD));\n\t\turi.scheme(\"content\");\n\n\t\tIntent intent = new Intent(this, MyService.class);\n\t\tintent.putExtra(\"ACTION\", \"QUERY\");\n\t\tintent.setData(uri.build());\n\n\t\trequestid = new Date().getTime();\n\t\tintent.putExtra(\"requestid\", requestid);\n\t\tstartService(intent);\n\t}", "public void\t\t\tgenerateNextRequest() throws Exception\n\t{\n\t\t// generate a random number of instructions for the request.\n\t\tlong noi =\n\t\t\t(long) this.rng.nextExponential(this.meanNumberOfInstructions) ;\n\t\tRequest r = new Request(this.rgURI + \"-\" + this.counter++, noi) ;\n\t\t// generate a random delay until the next request generation.\n\t\tlong interArrivalDelay =\n\t\t\t\t(long) this.rng.nextExponential(this.meanInterArrivalTime) ;\n\n\t\tif (RequestGenerator.DEBUG_LEVEL == 2) {\n\t\t\tthis.logMessage(\n\t\t\t\t\t\"Request generator \" + this.rgURI + \n\t\t\t\t\t\" submitting request \" + r.getRequestURI() + \" at \" +\n\t\t\t\t\tTimeProcessing.toString(System.currentTimeMillis() +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tinterArrivalDelay) +\n\t\t\t\" with number of instructions \" + noi) ;\n\t\t}\n\t\t\n\t\t// submit the current request.\n\t\tthis.rsop.sendRequestAndNotify(r) ;\n\t\t// schedule the next request generation.\n\t\tthis.nextRequestTaskFuture =\n\t\t\tthis.scheduleTask(\n\t\t\t\tnew AbstractComponent.AbstractTask() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t((RequestGenerator)this.getOwner()).\n\t\t\t\t\t\t\t\tgenerateNextRequest() ;\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\tthrow new RuntimeException(e) ;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tTimeManagement.acceleratedDelay(interArrivalDelay),\n\t\t\t\tTimeUnit.MILLISECONDS) ;\n\t\t\n\t}", "@Override\n public void autonomousPeriodic() {\n Scheduler.getInstance().run();\n }", "public void schedule(Runnable job, long delay, TimeUnit unit);", "public void scheduleAlarm() {\n Log.v(getClass().getSimpleName(), \"Scheduling alarm\");\n\n // Construct an intent that will execute the AlarmReceiver\n Intent intent = new Intent(getApplicationContext(), AlarmReceiver.class);\n\n // Create a PendingIntent to be triggered when the alarm goes off\n final PendingIntent pIntent = PendingIntent.getBroadcast(this, AlarmReceiver.REQUEST_CODE,\n intent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n // Setup periodic alarm every every half hour from this point onwards\n long firstMillis = System.currentTimeMillis(); // alarm is set right away\n AlarmManager alarm = (AlarmManager) this.getSystemService(Context.ALARM_SERVICE);\n\n // First parameter is the type: ELAPSED_REALTIME, ELAPSED_REALTIME_WAKEUP, RTC_WAKEUP\n // Interval can be INTERVAL_FIFTEEN_MINUTES, INTERVAL_HALF_HOUR, INTERVAL_HOUR, INTERVAL_DAY\n alarm.setInexactRepeating(AlarmManager.RTC_WAKEUP, firstMillis,\n AlarmManager.INTERVAL_FIFTEEN_MINUTES, pIntent);\n }", "Schedule createSchedule();", "private static void RequestBillboardScheduling() throws IOException, ClassNotFoundException {\n\n Socket client = ConnectionToServer();\n\n // connects to the server with information and attempts to get the auth token for the user after successful Login\n if (client.isConnected()) {\n OutputStream outputStream = client.getOutputStream();\n InputStream inputStream = client.getInputStream();\n\n ObjectOutputStream send = new ObjectOutputStream(outputStream);\n ObjectInputStream receiver = new ObjectInputStream(inputStream);\n\n send.writeUTF(\"RequestScheduleBillboards\");\n\n send.writeUTF(loggedInUser);\n send.writeUTF(token);\n send.flush();\n\n // Store the current schedule listings\n schedules = (ArrayList<String[]>) receiver.readObject();\n\n if (schedules != null) {\n int scheduleCounter = 1;\n for(String[] schedule : schedules){\n// System.out.println(\"\\nScheduled billboard \" + scheduleCounter + \":\");\n// System.out.println(\"Day: \" + schedule[1]);\n// System.out.println(\"Duration: \" + schedule[2]);\n// System.out.println(\"Start Time: \" + schedule[3]);\n\n scheduleCounter++;\n }\n } else {\n DialogWindow.ShowInformationPane(\"There is currently no scheduled billboards\", \"No billboard scheduled\");\n// System.out.println(\"There is currently no scheduled billboards\");\n }\n\n// End connections\n send.close();\n receiver.close();\n client.close();\n }\n }", "@Override\n public void autonomousPeriodic()\n {\n Scheduler.getInstance().run();\n }", "@Scheduled(fixedDelay = 15000)\n\tpublic void scheduleFixedDelayTask() {\n\t\t\n\t\tList<Tx> listaTx = txRepo.findAll();\n\t\t\n\t\tfor (Tx tx : listaTx) {\n\t\t\tif(tx.getStatus().equals(TxStatus.PENDING)) {\n\t\t\t\tSystem.out.println(\n\t\t\t\t\t \"Fixed delay task - \" + System.currentTimeMillis() / 20000);\n\t\t\t\t//to be implemented\n\t\t\t\t\n\t\t\t\tString auth = \"Bearer \" + tx.getSbi().getBitcoinAddress();\n\t\t\t\tHttpHeaders headers = new HttpHeaders();\n\t\t\t\theaders.add(\"Authorization\", auth);\n\t\t\t\t\n\t\t\t\tInteger orderId = tx.getorder_id();\n\t\t\t\t\n\t\t\t\tGetOrderResponseDTO getOrderDTO = new GetOrderResponseDTO();\n\t\t\t\t\n\t\t\t ResponseEntity<Object> responseEntity = new RestTemplate().exchange(\"https://api-sandbox.coingate.com/v2/orders/\" + orderId, HttpMethod.GET,\n\t\t\t\t\t\tnew HttpEntity<Object>(getOrderDTO, headers), Object.class);\n\t\t\t \n\t\t\t \n\t\t\t ObjectMapper mapper = new ObjectMapper();\n\t\t\t\tmapper.configure(Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);\n\t\t\t\tGetOrderResponseDTO gorResponse = new GetOrderResponseDTO();\n\t\t\n\t\t\t\tgorResponse = mapper.convertValue(responseEntity.getBody(), GetOrderResponseDTO.class);\n\t\t\n\t\t\t \n\t\t\t System.out.println(\"Order status: \" + gorResponse.getStatus());\n\t\t\t\t\n\t\t\t if(gorResponse.getStatus().equals(\"paid\") || \n\t\t\t \t\tgorResponse.getStatus().equals(\"invalid\") || \n\t\t\t \t\tgorResponse.getStatus().equals(\"expired\") || \n\t\t\t \t\tgorResponse.getStatus().equals(\"canceled\")) {\n\t\t\t \t\n\t\t\t \t//naredne tri linije mi nisu nista jasne zasto sam ovo radio pre mesec dana\n\t\t\t \tTx tx2 = new Tx();\n\t\t \t\ttx2 = txRepo.findByusername(gorResponse.getId());\n\t\t \t\tSystem.out.println(\"TX: \" + tx2.getorder_id());\n\t\t \t\t\n\t\t \t\tRestTemplate restTemplate = new RestTemplate();\n\t\t \t\t\n\t\t \t\tTxInfoDto txInfo;\n\t\t\t \t\n\t\t\t \tif(gorResponse.getStatus().equals(\"paid\")) {\n\t\t\t \t\t\n\t\t\t \t\ttx.setStatus(TxStatus.PAID);\n\t\t\t \t\ttxInfo = new TxInfoDto(tx.getorder_id(), TxStatusReqHandler.SUCCESS, \"https://localhost:8764/bitCoin\");\n\t\t\t \t\t\t\n\t\t\t \t} else if(gorResponse.getStatus().equals(\"invalid\")) {\n\t\t\t \t\ttx.setStatus(TxStatus.FAILED);\n\t\t\t \t\ttxInfo = new TxInfoDto(tx.getorder_id(), TxStatusReqHandler.FAILED, \"https://localhost:8764/bitCoin\");\n\t\t\t \t} else if(gorResponse.getStatus().equals(\"expired\")){\n\t\t\t \t\ttx.setStatus(TxStatus.EXPIRED);\n\t\t\t \t\ttxInfo = new TxInfoDto(tx.getorder_id(), TxStatusReqHandler.FAILED, \"https://localhost:8764/bitCoin\");\n\t\t\t \t} else {\n\t\t\t \t\ttx.setStatus(TxStatus.CANCELED);\n\t\t\t \t\ttxInfo = new TxInfoDto(tx.getorder_id(), TxStatusReqHandler.ERROR, \"https://localhost:8764/bitCoin\");\n\t\t\t \t}\n\t\t\t \t\n\t\t\t \ttxRepo.save(tx);\n\t\t \t\tResponseEntity<TxInfoDto> r = restTemplate.postForEntity(\"https://localhost:8111/request/updateTxAfterPaymentIsFinished\", txInfo, TxInfoDto.class);\n\t\t \t\n\t\t\t \t\n\t\t\t \t\n\t\t\t \t\n\t\t\t \t\n\t\t\t }\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Nikom nista\");\n\t\t\t\tlogger.info(\"Scheduled is working...\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Nema transakcija :(\");\n\t\t\n\t/*\tif(IS_CREATE) {\n\t\t\tSystem.out.println(\n\t\t\t\t \"Fixed delay task - \" + System.currentTimeMillis() / 20000);\n\t\t\t\t\t\t \t\n\t\t String authToken = STATIC_TOKEN;\n\t\t \n\t\t\tHttpHeaders headers = new HttpHeaders();\n\t\t\theaders.add(\"Authorization\", authToken);\n\t\t\t\n\t\t\tSystem.out.println(\"authtoken : \" + authToken);\n\t\t \n\t\t\tGetOrderResponseDTO getOrderDTO = new GetOrderResponseDTO();\n\t\t\t\n\t\t ResponseEntity<Object> responseEntity = new RestTemplate().exchange(\"https://api-sandbox.coingate.com/v2/orders/\" + STATIC_ID, HttpMethod.GET,\n\t\t\t\t\tnew HttpEntity<Object>(getOrderDTO, headers), Object.class);\n\t\t \n\t\t \n\t\t ObjectMapper mapper = new ObjectMapper();\n\t\t\tmapper.configure(Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);\n\t\t\tGetOrderResponseDTO gorResponse = new GetOrderResponseDTO();\n\t\n\t\t\tgorResponse = mapper.convertValue(responseEntity.getBody(), GetOrderResponseDTO.class);\n\t\n\t\t \n\t\t System.out.println(\"Order status: \" + gorResponse.getStatus());\n\t\t \n\t\t if(gorResponse.getStatus().equals(\"paid\") || gorResponse.getStatus().equals(\"invalid\") || gorResponse.getStatus().equals(\"expired\")) {\n\t\t \t\n\t\t \t/*Tx tx = new Tx();\n\t \t\ttx = txRepo.findByOrder_Id(gorResponse.getId());\n\t \t\tSystem.out.println(\"TX: \" + tx.getorder_id());\n\t\t \t\n\t\t \tif(gorResponse.getStatus().equals(\"paid\")) {\n\t\t \t\t//promenimo u bazi\n\t\t \t\t//txRepo.getOne((Integer)gorResponse.getId());\n\t\t \t\ttx.setStatus(TxStatus.PAID);\n\t\t \t\t\n\t\t \t} else if(gorResponse.getStatus().equals(\"invalid\")) {\n\t\t \t\ttx.setStatus(TxStatus.FAILED);\n\t\t \t} else {\n\t\t \t\ttx.setStatus(TxStatus.EXPIRED);\n\t\t \t}\n\t\t \t\n\t\t \ttxRepo.save(tx);*/\n\t\t /*\t\n\t\t \tIS_CREATE = false;\n\t\t }\n\t\t\t\t\t \n\t\t\t\t \n\t\t} else {\n\t\t\tSystem.out.println(\"Nikom nista\");\n\t\t\tlogger.info(\"Scheduled is working...\");\n\t\t}*/\n\t\t\n\t \n\t \n\t}", "@Scheduled(fixedRate = 2000)\n\tpublic void scheduleTaskWithFixedRate() {\n\t\tlog.info(\"Fixed Rate Task :: Execution Time - {}\", dateTimeFormatter.format(LocalDateTime.now()) );\n\t}", "public void scheduleJob() {\n JobInfo.Builder builder = null;\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {\n builder = new JobInfo.Builder(mJobId++, mServiceComponent);\n builder.setMinimumLatency(1000);\n builder.setRequiredNetworkType(JobInfo.NETWORK_TYPE_ANY);\n // Extras, work duration.\n PersistableBundle extras = new PersistableBundle();\n extras.putLong(WORK_DURATION_KEY, Long.valueOf(1) * 1000);\n extras.putString(\"gsonData\", gsonDataa);\n extras.putInt(\"servicetype\", 1);\n builder.setExtras(extras);\n // Schedule job\n Log.d(TAG, \"Scheduling job\");\n JobScheduler tm = (JobScheduler) getSystemService(Context.JOB_SCHEDULER_SERVICE);\n tm.schedule(builder.build());\n\n }\n\n\n\n }", "@Override\n public String getEndPoint() {\n return \"/v1/json/schedule\";\n }", "public static void scheduleJob(Context context) {\n ComponentName serviceComponent = new ComponentName(context, SimUtilService.class);\n JobInfo.Builder builder = new JobInfo.Builder(0, serviceComponent);\n builder.setMinimumLatency(1 * 1000); // wait at least\n builder.setOverrideDeadline(3 * 1000); // maximum delay\n JobScheduler jobScheduler = context.getSystemService(JobScheduler.class);\n jobScheduler.schedule(builder.build());\n }", "@Override\n protected Scheduler scheduler() {\n return Scheduler.newFixedRateSchedule(0, 1, TimeUnit.DAYS);\n }", "@Override\n public void autonomousPeriodic() {\n \n Scheduler.getInstance().run();\n \n }", "public void autonomousPeriodic() {\r\n Scheduler.getInstance().run();\r\n }", "public void scheduleNow(Runnable r) {\n ctx.requireStarted();\n ctx.getRunLoop().scheduleNow(r);\n }", "public void autonomousPeriodic() {\n Scheduler.getInstance().run();\n }", "public void autonomousPeriodic() {\n Scheduler.getInstance().run();\n }", "public void autonomousPeriodic() {\n Scheduler.getInstance().run();\n }", "public void autonomousPeriodic() {\n Scheduler.getInstance().run();\n }", "public void autonomousPeriodic() {\n Scheduler.getInstance().run();\n }", "public void autonomousPeriodic() {\n Scheduler.getInstance().run();\n }", "public void autonomousPeriodic() \n {\n Scheduler.getInstance().run();\n }", "public void run() {\n\t\t\t\tsendSR(ip, requestId);\n\t\t}", "public void scheduleAlarm() {\n Intent intent = new Intent(getApplicationContext(), MyAlarmReceiver.class);\n\n // Create a PendingIntent to be triggered when the alarm goes off\n final PendingIntent pendingIntent = PendingIntent.getBroadcast(this, MyAlarmReceiver.REQUEST_CODE, intent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n long firstMillis = System.currentTimeMillis(); // alarm is set right away\n\n AlarmManager alarm = (AlarmManager) this.getSystemService(Context.ALARM_SERVICE);\n\n // First parameter is the type: ELAPSED_REAL_TIME, ELAPSED_REAL_TIME_WAKEUP, RTC_WAKEUP\n // Interval can be INTERVAL_FIFTEEN_MINUTES, INTERVAL_HALF_HOUR, INTERVAL_HOUR, INTERVAL_DAY\n try {\n alarm.setInexactRepeating(AlarmManager.RTC_WAKEUP, firstMillis, 5000L, pendingIntent);\n } catch (NullPointerException e) {\n e.printStackTrace();\n }\n\n }", "public void schedule(String name, long initialDelay, long period, TimeUnit tunit, OpLevel severity) {\n\t\tif (future == null || future.isCancelled()) {\n\t\t\tactivityTask = newActivityTask(logger, name, severity);\n\t\t\tfuture = scheduler.scheduleAtFixedRate(activityTask, initialDelay, period, tunit);\n\t\t} else {\n\t\t\tthrow new IllegalStateException(\"Already scheduled\");\n\t\t}\n\t}", "void scheduleController(HttpServletRequest req, AppEngineJobContext context, int sliceNumber) {\n String taskName = (\"controller_\" + context.getJobID() + \"__\" + sliceNumber).replace('_', '-');\n try {\n context.getControllerQueue().add(\n TaskOptions.Builder.withMethod(TaskOptions.Method.POST)\n .url(getBase(req) + CONTROLLER_PATH)\n .param(AppEngineJobContext.JOB_ID_PARAMETER_NAME, context.getJobID().toString())\n .param(AppEngineJobContext.SLICE_NUMBER_PARAMETER_NAME, \"\" + sliceNumber)\n .countdownMillis(2000)\n .taskName(taskName));\n } catch (TaskAlreadyExistsException e) {\n log.warning(\"Controller task \" + taskName + \" already exists.\");\n }\n }", "public void doInitialSchedules() {\n ravenna.schedule();\n milan.schedule();\n venice.schedule();\n\n //Scheduling the public transportaton\n ravenna_milan.activate();\n milan_venice.activate();\n venice_ravenna.activate();\n }", "@Schedule(hour = \"2\")\n public void allocateCurrentDayReservation() {\n \n Calendar c = Calendar.getInstance();\n Date dateTime = c.getTime();\n \n reservationSessionBeanLocal.allocateCarsToReservations(dateTime);\n }", "@Override\r\n\tpublic void doInitialSchedules() {\n\t}", "@Override\n\tpublic void autonomousPeriodic() {\n\t\tScheduler.getInstance().run();\t\n\t}", "public void procRequest ()\r\n\t{\r\n\t\tthis.simTime = this.sim.getTimer();\r\n\t\tthis.request.setStartTime(simTime);\r\n\t\t//Debug/System.out.println(Fmt.time(simTime)\r\n\t\t//Debug/\t+ \": <procRequest> \" + request);\r\n\r\n\t\t//\tNeed to move from current cylinder to requested cylinder.\r\n\t\t//\tIf current == requested, no action.\r\n\t\tif (this.cylinder != this.request.getCylinder())\r\n\t\t\tthis.simTime += this.calcSeekTime(this.request.getCylinder());\r\n\t\tthis.sim.addEvent(new Event(Event.SEEK_SATISFIED, this.simTime));\r\n\t}", "private boolean sendRequest() {\n\t\tclSyncNTPMessage _mess = new clSyncNTPMessage();\n\t\t_mess.setOriginateDate(new Date().getTime());\n\t\t\n\t\treturn sendToServer(_mess);\n\t}", "void schedule(List<Queue<Integer>> requests, List<Elevator> elevators, int floors);", "private void submitRequest()\n\t{\n\t\ttry\n\t\t{\n\t\t\tchangeControlState(false);\n\t\t\tlblStatus.setText(\"Sending Request...\");\n\t\t\tnew Thread(new Runnable()\n\t\t\t{\n\t\t\t\t@Override\n\t\t\t\tpublic void run()\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tMPSWebRequest mpswr = new MPSWebRequest(mWSURL);\n\t\t\t\t\t\tmpswr.addParameter(\"tran\", taDSIXML.getText()); //Set WebServices 'tran' parameter to the XML transaction request\n\t\t\t\t\t\tmpswr.addParameter(\"pw\", \"XYZ\"); //Set merchant's WebServices password\n\t\t\t\t\t\tmpswr.setWebMethodName((String)cmbWebMethod.getSelectedItem()); //Set WebServices webmethod to selected type\n\t\t\t\t\t\tmpswr.setTimeout(10); //Set request timeout to 10 seconds\n\t\t\t\t\t\t\n\t\t\t\t\t\tString mpsResponse = mpswr.sendRequest();\n\t\t\t\t\t\tlblStatus.setText(\"\");\n\t\t\t\t\t\tshowPopup(\"Response XML String\",mpsResponse.replace(\">\\t\", \">\\n\\t\"));\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception e)\n\t\t\t\t\t{\n\t\t\t\t\t\tshowPopup(\"Exception\", e.toString());\n\t\t\t\t\t}\n\t\t\t\t\tfinally\n\t\t\t\t\t{\n\t\t\t\t\t\tlblStatus.setText(\"\");\n\t\t\t\t\t\tchangeControlState(true);\n\t\t\t\t\t\t@SuppressWarnings(\"unused\") // Properly disposing of current thread\n\t\t\t\t\t\tThread curthread = Thread.currentThread();\n\t\t\t\t\t\tcurthread = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}).start();\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tshowPopup(\"Exception\", e.toString());\n\t\t}\n\t}", "private void scheduleTasks() {\n\t\ttimer.scheduleAtFixedRate(new TimerTask() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\t// Prepare JSON Ping Message\n\t\t\t\ttry {\n\t\t\t\t\tObjectMapper mapper = new ObjectMapper();\n\t\t\t\t\tObjectNode objectNode = mapper.createObjectNode();\n\t\t\t\t\tobjectNode.put(\"type\", \"PING\");\n\n\t\t\t\t\twebSocket.sendText(mapper.writerWithDefaultPrettyPrinter().writeValueAsString(objectNode));\n\n\t\t\t\t\tlog.debug(\"Send Ping to Twitch PubSub. (Keep-Connection-Alive)\");\n\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\tlog.error(\"Failed to Ping Twitch PubSub. ({})\", ex.getMessage());\n\t\t\t\t\treconnect();\n\t\t\t\t}\n\n\t\t\t}\n\t\t}, 7000, 282000);\n\t}", "public void request() {\n }", "@Scheduled(fixedRate = 1000)\n private void send(){\n jmsTemplate.send(\"test.messages\", session -> {\n TextMessage message = session.createTextMessage(Instant.now().toString());\n return message;\n });\n }", "public void autonomousPeriodic() {\r\n\t\tScheduler.getInstance().run();\r\n\t}", "@Override\n\tpublic void autonomousPeriodic() {\n\t\tScheduler.getInstance().run();\n\t}", "@Override\n\tpublic void autonomousPeriodic() {\n\t\tScheduler.getInstance().run();\n\t}", "@Override\n\tpublic void autonomousPeriodic() {\n\t\tScheduler.getInstance().run();\n\t}", "@Override\n\tpublic void autonomousPeriodic() {\n\t\tScheduler.getInstance().run();\n\t}", "private void schedule( TaskKey aWorkPackage, boolean aCollectionReqBool ) throws Exception {\n ScheduleInternalTO lTO = new ScheduleInternalTO();\n lTO.setSchedDates( new Date(), new Date() );\n lTO.setWorkOrderNo( WORK_ORDER_NO, \"\" );\n lTO.setCollectionRequired( aCollectionReqBool );\n\n STaskBean staskBean = new STaskBean();\n staskBean.setSessionContext( new SessionContextFake() );\n staskBean.schedule( aWorkPackage, lTO, AUTHORIZING_HR );\n\n }", "public static void dispatchScheduledSync(Context context) {\n FirebaseJobDispatcher dispatcher = new FirebaseJobDispatcher(new GooglePlayDriver(context));\n Job syncJob = dispatcher.newJobBuilder()\n .setTag(SYNC_TAG_SCHEDULED)\n .setService(FirebaseSyncJobService.class)\n .setTrigger(Trigger.NOW)\n .setRecurring(false)\n .setReplaceCurrent(true)\n .setLifetime(Lifetime.UNTIL_NEXT_BOOT)\n .addConstraint(Constraint.ON_ANY_NETWORK)\n .build();\n dispatcher.mustSchedule(syncJob);\n Log.d(LOG_TAG, \"Recurring sync job dispatched\");\n }", "public void schedule(long period) {\n\t\tschedule(\"ActivityTask\", period, period, TimeUnit.MILLISECONDS);\n\t}", "@Override\n public void teleopPeriodic()\n {\n Scheduler.getInstance().run();\n }", "@Override\n public String execute(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {\n log.debug(START_COMMAND);\n MeetingService meetingService = new MeetingServiceImpl(new MeetingDaoImpl());\n //inserts meeting with new time and deletes previous\n if (Constant.POST_METHOD.equalsIgnoreCase(request.getMethod())) {\n log.debug(START_CASE_POST);\n long previousMeetingId = Long.parseLong(request.getParameter(MEETING_ID));\n log.debug(MEETING_ID + Constant.POINTER + previousMeetingId);\n Meeting previousMeeting = meetingService.getById(previousMeetingId);\n LocalDateTime dateTime = LocalDateTime.parse(request.getParameter(Constant.SLOT));\n log.debug(SLOT_DATETIME + Constant.POINTER + dateTime);\n //create meeting with new parameters\n Meeting newMeeting = new Meeting();\n newMeeting.setCondition(Condition.ACTIVE);\n newMeeting.setCatalog(previousMeeting.getCatalog());\n newMeeting.setClient(previousMeeting.getClient());\n newMeeting.setDateTime(dateTime);\n log.debug(String.format(NEW_MEETING_PARAMETERS,\n newMeeting.getCondition(),\n newMeeting.getCatalog(),\n newMeeting.getClient().getName(),\n newMeeting.getDateTime()));\n //delete old meeting\n if (meetingService.insert(newMeeting) != null) {\n meetingService.deleteById(previousMeetingId);\n }\n log.debug(END_CASE_POST);\n return Path.COMMAND_ADMIN_CABINET;\n\n } else {\n //create schedule\n log.debug(START_CASE_GET);\n long meetingId = Long.parseLong(request.getParameter(SLOT_ID));\n Meeting meeting = meetingService.getById(meetingId);\n List<Meeting> meetingList = meetingService.getAll();\n Master master = meeting.getCatalog().getMaster();\n long masterId = master.getId();\n meetingList.removeIf(nextMeeting -> nextMeeting.getCatalog().getMaster().getId() != masterId);\n List<LocalDateTime> emptySchedule = createEmptyFutureSchedule(Constant.MAX_DAYS_FOR_REGISTER);\n Iterator<LocalDateTime> timeIterator = emptySchedule.iterator();\n while (timeIterator.hasNext()) {\n LocalDateTime time = timeIterator.next();\n for (Meeting m : meetingList) {\n if (time.equals(m.getDateTime())) {\n log.debug(DELETED_TIME_SLOT + Constant.POINTER + time);\n timeIterator.remove();\n }\n }\n }\n\n request.setAttribute(Constant.SCHEDULE, emptySchedule);\n request.setAttribute(Constant.MEETING, meeting);\n log.debug(END_CASE_GET);\n log.debug(END_COMMAND);\n return Path.CHANGE_TS_PATH;\n }\n }", "void sendRequest(IRequest request)\n throws ConnectionFailedException;", "@LambdaFunction\n Boolean PutScheduledCall(LambdaRequest request);", "private void sendRequest(Action action) {\n ACLMessage request = new ACLMessage(ACLMessage.REQUEST);\n request.setLanguage(new SLCodec().getName());\n request.setOntology(MobilityOntology.getInstance().getName());\n try {\n getContentManager().fillContent(request, action);\n request.addReceiver(action.getActor());\n send(request);\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }", "public void scheduleTransaction(Transaction recurringTransaction) {\n long recurrencePeriodMillis = recurringTransaction.getRecurrencePeriod();\n long firstRunMillis = System.currentTimeMillis() + recurrencePeriodMillis;\n long recurringTransactionId = addTransaction(recurringTransaction);\n\n PendingIntent recurringPendingIntent = PendingIntent.getBroadcast(mContext,\n (int)recurringTransactionId, Transaction.createIntent(recurringTransaction), PendingIntent.FLAG_UPDATE_CURRENT);\n AlarmManager alarmManager = (AlarmManager) mContext.getSystemService(Context.ALARM_SERVICE);\n alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, firstRunMillis,\n recurrencePeriodMillis, recurringPendingIntent);\n }", "public void autonomousPeriodic()\n\t{\n\t\tScheduler.getInstance().run();\n\t}", "ScheduledFuture<?> scheduleAtFixedRate(Runnable publisher, long period, TimeUnit timeUnit, ProbeLevel probeLevel);", "private void scheduledTask() {\n connectToNewViews();\n removeDisconnectedViews();\n try {\n Thread.sleep(SCHEDULED_TASK_PERIOD);\n // Scheduling future execution\n\n synchronized (threadPool) {\n if (!threadPool.isShutdown()) {\n threadPool.execute(this::scheduledTask);\n }\n }\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n }\n }", "public void run() {\n\t\t\t\tIMSScheduleManager.super.startCron();\r\n\t\t\t\t\r\n\t\t\t}", "public String createTask(JSONRequest request, long delay, boolean interval, boolean sequential);", "public static void schedule(Context context, Intent intent, long triggerAtMillis) {\n /**\n * PendingIntent.getBroadcast\n *\n * PendingIntent.FLAG_UPDATE_CURRENT\n *\n * */\n PendingIntent p = PendingIntent.getBroadcast(context, 1, intent, PendingIntent.FLAG_UPDATE_CURRENT);\n AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);\n alarmManager.set(AlarmManager.RTC_WAKEUP, triggerAtMillis, p);\n //Log.i(TAG, \"ALARME com data/hora definido\");\n }", "public void teleopPeriodic() {\r\n\t\tScheduler.getInstance().run();\r\n\t}", "public void run() {\n long creationInterval = MILLISEC_PER_SEC / this.generationRate;\n\n int curIndex = 0;\n long startTime, endTime, diff, sleepTime, dur = this.test_duration;\n\n do {\n // startTime = System.nanoTime();\n startTime = System.currentTimeMillis();\n\n Request r = new DataKeeperRequest((HttpClient) this.clients[curIndex], this.appserverID, this.url);\n curIndex = (curIndex + 1) % clientsPerNode;\n this.requests.add(r);\n\n try {\n r.setEnterQueueTime();\n this.requestQueue.put(r);\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n\n // endTime = System.nanoTime();\n endTime = System.currentTimeMillis();\n diff = endTime - startTime;\n dur -= diff;\n sleepTime = creationInterval - diff;\n if (sleepTime < 0) {\n continue;\n }\n\n try {\n // Thread.sleep(NANO_PER_MILLISEC / sleepTime, (int) (NANO_PER_MILLISEC % sleepTime));\n Thread.sleep(sleepTime);\n } catch (InterruptedException e) {\n throw new RuntimeException(e);\n }\n\n dur -= sleepTime;\n } while (dur > 0);\n\n try {\n this.requestQueue.put(new ExitRequest());\n this.requestQueueHandler.join();\n } catch (InterruptedException e) {\n throw new RuntimeException(e);\n }\n }", "@Override\n\tpublic void startRequest(int taskId) {\n\n\t}", "public void teleopPeriodic() {\n Scheduler.getInstance().run();\n }", "public void teleopPeriodic() {\n Scheduler.getInstance().run();\n }", "public void teleopPeriodic() {\n Scheduler.getInstance().run();\n }", "public void teleopPeriodic() {\n Scheduler.getInstance().run();\n }", "@Override\n public void autonomousPeriodic() {\n \tbeginPeriodic();\n Scheduler.getInstance().run();\n endPeriodic();\n }", "protected synchronized void scheduleTasks() {\n Collection<HugeServerInfo> scheduleInfos = this.serverManager()\n .allServerInfos();\n String page = this.supportsPaging() ? PageInfo.PAGE_NONE : null;\n do {\n Iterator<HugeTask<Object>> tasks = this.tasks(TaskStatus.SCHEDULING,\n PAGE_SIZE, page);\n while (tasks.hasNext()) {\n HugeTask<?> task = tasks.next();\n if (task.server() != null) {\n // Skip if already scheduled\n continue;\n }\n\n HugeServerInfo server = this.serverManager().pickWorkerNode(\n scheduleInfos, task);\n if (server == null) {\n LOG.info(\"The master can't find suitable servers to \" +\n \"execute task '{}', wait for next schedule\",\n task.id());\n continue;\n }\n\n // Found suitable server, update task status\n assert server.id() != null;\n task.server(server.id());\n task.status(TaskStatus.SCHEDULED);\n this.save(task);\n\n // Update server load in memory, it will be saved at the ending\n server.increaseLoad(task.load());\n\n LOG.info(\"Scheduled task '{}' to server '{}'\",\n task.id(), server.id());\n }\n if (page != null) {\n page = PageInfo.pageInfo(tasks);\n }\n } while (page != null);\n\n this.serverManager().updateServerInfos(scheduleInfos);\n }", "private void sendMsg()\n {\n try {\n spauldingApp.println(\"AckRequest.sendMsg() - sending request to nodeID= \" + node.getNodeID() + \" ...\");\n this.nbrTransmits++;\n //spauldingApp.eventLogger.writeMsgSentPing(fetchReqMsg);\n spauldingApp.getMoteIF().send(node.getNodeID(), requestMsg);\n } catch (Exception e) {\n spauldingApp.println(\"ERROR: Can't send message: \" + e);\n e.printStackTrace();\n }\n }", "public void teleopPeriodic()\n\t{\n\t\tScheduler.getInstance().run();\n\t}", "@Subscribe\n public void onExecutionRequest(ExecutionRequestEvent event) {\n executionService.scheduleExecution(event.getOrder());\n }", "@SuppressWarnings(\"unchecked\")\n\t\tpublic void run() {\n long throughputMeasurementStartTime = System.currentTimeMillis();\n\n byte[] reply;\n int reqId;\n int req = 0;\n\n Storage st = new Storage(nTXs);\n\n System.out.println(\"Executing experiment for \" + nTXs + \" ops\");\n\n for (int i = 0; i < nTXs; i++, req++) {\n long last_send_instant = System.nanoTime();\n if (dos) {\n reqId = proxy.generateRequestId((readOnly) ? TOMMessageType.UNORDERED_REQUEST : TOMMessageType.ORDERED_REQUEST); \n proxy.TOMulticast(request, reqId, (readOnly) ? TOMMessageType.UNORDERED_REQUEST : TOMMessageType.ORDERED_REQUEST); \n\n } else {\n \tif(readOnly) {\n \t\treply = proxy.invokeUnordered(request);\n \t} else {\n \t\treply = proxy.invokeOrdered(request);\n \t}\n }\n st.store(System.nanoTime() - last_send_instant);\n\n if (timeout > 0) {\n //sleeps timeout ms before sending next request\n try {\n\t\t\t\t\t\tThread.sleep(timeout);\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n } \n\n } \n writeReportJSON(throughputMeasurementStartTime, st); \n }", "void sendScheduledNotifications(JobProgress progress);", "public void doInitialSchedules() {\r\n\r\n\t\t// create the servicer, here make a vancarrier\r\n\t\tfor (int i = 0; i < vcNumber; i++) {\r\n\t\t\tVC vancarrier = new VC(this, \"Van Carrier\", true);\r\n\r\n\t\t\t// put the vancarrier on duty with placing it on the event-list\r\n\t\t\t// first\r\n\t\t\t// it will deactivate itself into waiting status\r\n\t\t\t// for the first truck right after activation\r\n\t\t\tvancarrier.activate();\r\n\t\t}\r\n\r\n\t\t// create a truck spring\r\n\t\tTruckGenerator firstarrival = new TruckGenerator(this, \"TruckArrival\", false);\r\n\r\n\t\t// place the truck generator on the event-list, in order to\r\n\t\t// start producing truck arrivals when the first truck comes\r\n\t\t// therefore we must use \"schedule\" instead of \"activate\"\r\n\t\tfirstarrival.schedule(new TimeSpan(getTruckArrivalTime()));\r\n\r\n\t}", "@Override\n\tpublic void teleopPeriodic() {\n\t\tScheduler.getInstance().run();\n\t}", "@Override\n\tpublic void teleopPeriodic() {\n\t\tScheduler.getInstance().run();\n\t}" ]
[ "0.65820706", "0.65254927", "0.6394178", "0.618411", "0.61272085", "0.6109445", "0.5970027", "0.5929531", "0.58185923", "0.5797784", "0.5777061", "0.5723928", "0.56709975", "0.5656845", "0.5629954", "0.5527104", "0.54956245", "0.54951274", "0.54882604", "0.5484812", "0.5461328", "0.54568624", "0.5432216", "0.5424953", "0.53893656", "0.53823125", "0.53430635", "0.53293836", "0.53286356", "0.53228784", "0.53194094", "0.5318469", "0.53035575", "0.53031975", "0.530171", "0.53012204", "0.5289813", "0.52893597", "0.5288857", "0.5286485", "0.52762127", "0.52738976", "0.52738976", "0.52738976", "0.52738976", "0.52738976", "0.52738976", "0.52723396", "0.5243198", "0.5235872", "0.5226972", "0.5224821", "0.52228975", "0.5212987", "0.5209576", "0.51962274", "0.5193734", "0.5189001", "0.5187613", "0.51820695", "0.51765746", "0.5171834", "0.5166083", "0.5160234", "0.5157022", "0.5157022", "0.5157022", "0.5157022", "0.515677", "0.515502", "0.51536566", "0.5147381", "0.51448226", "0.51441365", "0.5141631", "0.51361847", "0.51180744", "0.51020104", "0.50993997", "0.50932926", "0.5089294", "0.5079282", "0.50774866", "0.5073704", "0.5069807", "0.50689054", "0.5065049", "0.5065049", "0.5065049", "0.5065049", "0.50639176", "0.50623333", "0.5061832", "0.50587696", "0.5057711", "0.50538844", "0.50519365", "0.50508606", "0.50454843", "0.50454843" ]
0.51686513
62
If sending is enabled, attempt to send the provided events. Also batch the events ordered by their streams, as the QUEUE can contain events of different streams
private static void send() { Map<String, ArrayList<Event>> eventsByStream = new HashMap<>(); for (Event event : QUEUE) { String stream = event.getStream(); if (!eventsByStream.containsKey(stream) || eventsByStream.get(stream) == null) { eventsByStream.put(stream, new ArrayList<>()); } eventsByStream.get(stream).add(event); } for (String stream : eventsByStream.keySet()) { if (Prefs.INSTANCE.isEventLoggingEnabled()) { sendEventsForStream(STREAM_CONFIGS.get(stream), eventsByStream.get(stream)); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n void sendEvents() {\n // Arrange\n final String messageId = UUID.randomUUID().toString();\n final SendOptions options = new SendOptions().setPartitionId(PARTITION_ID);\n final EventHubProducerAsyncClient producer = toClose(builder.buildAsyncProducerClient());\n final List<EventData> events = TestUtils.getEvents(NUMBER_OF_EVENTS, messageId);\n final PartitionProperties information = producer.getPartitionProperties(PARTITION_ID).block();\n\n assertNotNull(information, \"Should receive partition information.\");\n\n final EventPosition position = EventPosition.fromSequenceNumber(information.getLastEnqueuedSequenceNumber());\n final EventHubConsumerAsyncClient consumer = toClose(builder\n .consumerGroup(EventHubClientBuilder.DEFAULT_CONSUMER_GROUP_NAME)\n .buildAsyncConsumerClient());\n\n // Act\n StepVerifier.create(producer.send(events, options))\n .expectComplete()\n .verify(TIMEOUT);\n\n // Assert\n logger.info(\"Waiting to receive events.\");\n StepVerifier.create(consumer.receiveFromPartition(PARTITION_ID, position)\n .filter(x -> TestUtils.isMatchingEvent(x, messageId)).take(NUMBER_OF_EVENTS))\n .expectNextCount(NUMBER_OF_EVENTS)\n .expectComplete()\n .verify(TIMEOUT);\n }", "public void transmitEvents(){\n Log.info(\"Transmitting Events\", EventShare.class);\n for(Entry<Class, List<EventTrigger>> eventGroup: HandlerRegistry.getHandlers().entrySet()){\n String annotation = eventGroup.getKey().getName();\n for(EventTrigger trigger : eventGroup.getValue()){\n if(trigger.getServer()!=this) { // do not send own events...\n if(trigger.getMethod()!=null){ // its a local event\n if(trigger.getMethod().isAnnotationPresent(ES.class)){\n try {\n eventBusServer.write(new ESSharedEvent(annotation, trigger.getTrigger()));\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }else {\n try {\n eventBusServer.write(new ESSharedEvent(annotation, trigger.getTrigger()));\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }\n }\n }\n }", "public void send(SseEventBuilder builder)\n/* */ throws IOException\n/* */ {\n/* 123 */ Set<ResponseBodyEmitter.DataWithMediaType> dataToSend = builder.build();\n/* 124 */ synchronized (this) {\n/* 125 */ for (ResponseBodyEmitter.DataWithMediaType entry : dataToSend) {\n/* 126 */ super.send(entry.getData(), entry.getMediaType());\n/* */ }\n/* */ }\n/* */ }", "public void handle(QueueItem<T>[] events, SyncProducer producer, Encoder<T> encoder) throws Exception;", "@Override\n public void publish(List<EthLog.LogResult> logs) {\n if (logs.isEmpty()) {\n log.warn(\"[KAFKA] logs is empty, ignore sending!\");\n return;\n }\n final long start = System.currentTimeMillis();\n log.info(\"[KAFKA] sending {} events\", logs.size());\n logs.stream()\n .map(logResult -> (EthLog.LogObject) logResult)\n .map(EventMessage::new)\n .filter(logMessage -> !logMessage.getTopics().isEmpty())\n .peek(logMessage -> log.debug(\"[KAFKA] sending event topic {}\", logMessage.getTopics().get(0)))\n .forEach(this::sendEvent);\n\n long tookMs = System.currentTimeMillis() - start;\n log.info(\"[KAFKA] sent {} messages in {} ms.\", logs.size(), tookMs);\n }", "private synchronized boolean sendBatch() {\n if (fPending.isEmpty()) {\n return true;\n }\n\n final long nowMs = Clock.now();\n\n if (this.fHostSelector != null) {\n host = this.fHostSelector.selectBaseHost();\n }\n\n final String httpurl = MRConstants.makeUrl(host, fTopic, props.getProperty(DmaapClientConst.PROTOCOL),\n props.getProperty(DmaapClientConst.PARTITION));\n\n try {\n\n final ByteArrayOutputStream baseStream = new ByteArrayOutputStream();\n OutputStream os = baseStream;\n final String contentType = props.getProperty(DmaapClientConst.CONTENT_TYPE);\n if (contentType.equalsIgnoreCase(MRFormat.JSON.toString())) {\n JSONArray jsonArray = parseJSON();\n os.write(jsonArray.toString().getBytes());\n os.close();\n\n } else if (contentType.equalsIgnoreCase(CONTENT_TYPE_TEXT)) {\n for (TimestampedMessage m : fPending) {\n os.write(m.fMsg.getBytes());\n os.write('\\n');\n }\n os.close();\n } else if (contentType.equalsIgnoreCase(MRFormat.CAMBRIA.toString())\n || (contentType.equalsIgnoreCase(MRFormat.CAMBRIA_ZIP.toString()))) {\n if (contentType.equalsIgnoreCase(MRFormat.CAMBRIA_ZIP.toString())) {\n os = new GZIPOutputStream(baseStream);\n }\n for (TimestampedMessage m : fPending) {\n\n os.write((\"\" + m.fPartition.length()).getBytes());\n os.write('.');\n os.write((\"\" + m.fMsg.length()).getBytes());\n os.write('.');\n os.write(m.fPartition.getBytes());\n os.write(m.fMsg.getBytes());\n os.write('\\n');\n }\n os.close();\n } else {\n for (TimestampedMessage m : fPending) {\n os.write(m.fMsg.getBytes());\n\n }\n os.close();\n }\n\n final long startMs = Clock.now();\n if (ProtocolType.DME2.getValue().equalsIgnoreCase(protocolFlag)) {\n\n configureDME2();\n\n this.wait(5);\n if (fPending.peek() != null) {\n logSendMessage(fPending.size(), url + subContextPath, nowMs - fPending.peek().timestamp);\n }\n sender.setPayload(os.toString());\n String dmeResponse = sender.sendAndWait(5000L);\n\n logTime(startMs, dmeResponse);\n fPending.clear();\n return true;\n }\n\n if (ProtocolType.AUTH_KEY.getValue().equalsIgnoreCase(protocolFlag)) {\n if (fPending.peek() != null) {\n logSendMessage(fPending.size(), httpurl, nowMs - fPending.peek().timestamp);\n }\n final JSONObject result =\n postAuth(new PostAuthDataObject().setPath(httpurl).setData(baseStream.toByteArray())\n .setContentType(contentType).setAuthKey(authKey).setAuthDate(authDate)\n .setUsername(username).setPassword(password).setProtocolFlag(protocolFlag));\n // Here we are checking for error response. If HTTP status\n // code is not within the http success response code\n // then we consider this as error and return false\n if (result.getInt(JSON_STATUS) < 200 || result.getInt(JSON_STATUS) > 299) {\n return false;\n }\n logTime(startMs, result.toString());\n fPending.clear();\n return true;\n }\n\n if (ProtocolType.AAF_AUTH.getValue().equalsIgnoreCase(protocolFlag)) {\n if (fPending.peek() != null) {\n logSendMessage(fPending.size(), httpurl, nowMs - fPending.peek().timestamp);\n }\n final JSONObject result = post(httpurl, baseStream.toByteArray(), contentType, username, password,\n protocolFlag);\n\n // Here we are checking for error response. If HTTP status\n // code is not within the http success response code\n // then we consider this as error and return false\n if (result.getInt(JSON_STATUS) < 200 || result.getInt(JSON_STATUS) > 299) {\n return false;\n }\n logTime(startMs, result.toString());\n fPending.clear();\n return true;\n }\n\n if (ProtocolType.HTTPNOAUTH.getValue().equalsIgnoreCase(protocolFlag)) {\n if (fPending.peek() != null) {\n logSendMessage(fPending.size(), httpurl, nowMs - fPending.peek().timestamp);\n }\n final JSONObject result = postNoAuth(httpurl, baseStream.toByteArray(), contentType);\n\n // Here we are checking for error response. If HTTP status\n // code is not within the http success response code\n // then we consider this as error and return false\n if (result.getInt(JSON_STATUS) < 200 || result.getInt(JSON_STATUS) > 299) {\n return false;\n }\n logTime(startMs, result.toString());\n fPending.clear();\n return true;\n }\n } catch (InterruptedException e) {\n getLog().warn(\"Interrupted!\", e);\n // Restore interrupted state...\n Thread.currentThread().interrupt();\n } catch (Exception x) {\n getLog().warn(x.getMessage(), x);\n }\n return false;\n }", "@NotNull Publisher<Void> send(Publisher<VesEvent> messages);", "@Test\n public void largeMessageVolumeTest_buffered() {\n int batches = 15;\n int batchSize = 5_000;\n List<Long> sendReceiveTimings = new ArrayList<>();\n List<Long> sendTimings = new ArrayList<>();\n for(int i = 0; i< batches; i++) {\n List<String> messages = messages(batchSize, 100);\n long startTime = System.currentTimeMillis();\n for (String message : messages) {\n publisher.publishBuffered(topic, message.getBytes());\n }\n publisher.flushBatchers();\n sendTimings.add(System.currentTimeMillis()-startTime);\n List<NSQMessage> nsqMessages = handler1.drainMessagesOrTimeOut(batchSize);\n sendReceiveTimings.add(System.currentTimeMillis()-startTime);\n\n validateReceivedAllMessages(messages,nsqMessages,true);\n LOGGER.info(\"published batch {} of {}\",i,batches);\n }\n\n double sendAverageMillis = sendTimings.stream().mapToLong(e -> e).average().getAsDouble();\n double throughput = batchSize/sendAverageMillis*1000;\n LOGGER.info(\"Average send time for {} messages: {} millis, {} op/s\", batchSize, sendAverageMillis, throughput);\n\n double totalAverageMillis = sendReceiveTimings.stream().mapToLong(e -> e).average().getAsDouble();\n throughput = batchSize/totalAverageMillis*1000;\n LOGGER.info(\"Average send time for {} messages: {} millis, {} op/s\", batchSize, totalAverageMillis, throughput);\n }", "@Scheduled(fixedDelay = 1000, initialDelay = 1000)\n public void processLocalEvents() {\n List<StockLocalEventStore> list = repository.findBySent(false);\n for (int i = 0; i < list.size(); i++) {\n publishAndUpdateLocalEvents(list.get(i));\n }\n }", "private void sendQueuedNotifications() {\n Notification n;\n while ((n = pendingNotifs.poll()) != null) {\n broadcaster.sendNotification(n);\n }\n }", "private void sendMessages(Queue<Message<M>> sendQueue) {\n while (!sendQueue.isEmpty()) {\n context.sendMessage(sendQueue.poll());\n numMessageSent++;\n }\n }", "private void send(Iterable<T> aMessages) {\n for (Listener<T> myL : _listeners)\n myL.arrived(aMessages);\n }", "private void flushOutbound0() {\n/* 454 */ runPendingTasks();\n/* */ \n/* 456 */ flush();\n/* */ }", "private void sendNewPackets() {\n\t\twhile(alive && (sendQueue.size() != 0)) {\n\t\t\tNetPacket send = sendQueue.peek();\n\t\t\ttry {\n\t\t\t\tSystem.out.println(\"(NetAPI) Sending a \" + send.getClass().getName() + \" packet\");\n\t\t\t\toos.writeObject(send);\n\t\t\t\toos.flush();\n\t\t\t\tsendQueue.poll();\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.err.println(\"(NetAPI) Could not send packet: \" + e.getMessage());\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void executeEvent(Meeting meeting) {\n\t\tServerLogger logger = new ServerLogger(\"Audio Event\");\n\t\tSet<Entry<MeetingClient,ThreadedBufferedMessageWriter>> writers = meeting.getClientMessageWriters();\n\t\tfor(Entry<MeetingClient,ThreadedBufferedMessageWriter> writer : writers)\n\t\t{\n\t\t\tif(writer.getKey() != getClientWhoCreatedEvent())\n\t\t\t{\n\t\t\t\twriter.getValue().enqueueMessage(audioMessage);\n\t\t\t}\n\t\t}\n\t}", "public void startSendingStockReadings(final long noOfStockEvents) {\n\n ExecutorService xrayExecutor = Executors.newSingleThreadExecutor();\n\n xrayExecutor.submit(new Runnable() {\n public void run() {\n LOG.debug(getStartingMessage());\n int count = 0;\n while (count < noOfStockEvents) {\n StockEvent se = new StockEvent(\"AMZN\", \"Amazon\", \"stock\",\n new Date(), new Random().nextInt(30) + 20);\n eventHandler.handle(se);\n count++;\n try {\n Thread.sleep(200);\n } catch (InterruptedException e) {\n LOG.error(\"Thread Interrupted\", e);\n }\n }\n }\n });\n\n xrayExecutor.shutdown();\n }", "public void startSending() {\n if (shouldSend) {\n return;\n }\n shouldSend = true;\n\n DiscordApiImpl api = (DiscordApiImpl) connection.getChannel().getApi();\n api.getThreadPool().getSingleThreadExecutorService(threadName).submit(() -> {\n try {\n long nextFrameTimestamp = System.nanoTime();\n boolean dontSleep = true;\n boolean speaking = false;\n long framesOfSilenceToPlay = 5;\n while (shouldSend) {\n // Get the current audio source. If none is available, it will block the thread\n AudioSource source = connection.getCurrentAudioSourceBlocking();\n if (source == null) {\n logger.error(\"Got null audio source without being interrupted ({})\", connection);\n return;\n }\n\n if (source.hasFinished()) {\n connection.removeAudioSource();\n dontSleep = true;\n\n // Dispatch AudioSourceFinishedEvent AFTER removing the source.\n // Otherwise, AudioSourceFinishedEvent#getNextSource() won't work\n api.getEventDispatcher().dispatchAudioSourceFinishedEvent(\n (ServerImpl) connection.getServer(),\n connection,\n ((AudioSourceBase) source).getDelegate(),\n new AudioSourceFinishedEventImpl(source, connection));\n continue;\n }\n\n AudioPacket packet = null;\n byte[] frame = source.hasNextFrame() ? source.getNextFrame() : null;\n\n // If the source is muted, replace the frame with a muted frame\n if (source.isMuted()) {\n frame = null;\n }\n\n if (frame != null || framesOfSilenceToPlay > 0) {\n if (!speaking && frame != null) {\n speaking = true;\n connection.setSpeaking(true);\n }\n packet = new AudioPacket(frame, ssrc, sequence, ((int) sequence) * 960);\n // We can stop sending frames of silence after 5 frames\n if (frame == null) {\n framesOfSilenceToPlay--;\n if (framesOfSilenceToPlay == 0) {\n speaking = false;\n connection.setSpeaking(false);\n }\n } else {\n framesOfSilenceToPlay = 5;\n }\n }\n\n nextFrameTimestamp = nextFrameTimestamp + 20_000_000;\n\n sequence++;\n\n if (packet != null) {\n packet.encrypt(secretKey);\n }\n try {\n if (dontSleep) {\n nextFrameTimestamp = System.nanoTime() + 20_000_000;\n dontSleep = false;\n } else {\n Thread.sleep(Math.max(0, nextFrameTimestamp - System.nanoTime()) / 1_000_000);\n }\n if (packet != null) {\n socket.send(packet.asUdpPacket(address));\n }\n } catch (IOException e) {\n logger.error(\"Failed to send audio packet for {}\", connection);\n }\n }\n } catch (InterruptedException e) {\n if (shouldSend) {\n logger.debug(\"Got interrupted unexpectedly while waiting for next audio source packet\");\n }\n }\n });\n }", "public void sendAsync() {\n\t\tstartTime = System.currentTimeMillis();\n\t\t\n\t\tif(logMINOR) Logger.minor(this, \"Starting async send on \"+this);\n\t\tincRunningBlockTransmits();\n\t\t\n\t\ttry {\n\t\t\tsynchronized(_prb) {\n\t\t\t\t_unsent = _prb.addListener(myListener = new PartiallyReceivedBlock.PacketReceivedListener() {;\n\n\t\t\t\t\tpublic void packetReceived(int packetNo) {\n\t\t\t\t\t\tsynchronized(_senderThread) {\n\t\t\t\t\t\t\tif(_unsent.contains(packetNo)) {\n\t\t\t\t\t\t\t\tLogger.error(this, \"Already in unsent: \"+packetNo+\" for \"+this+\" unsent is \"+_unsent, new Exception(\"error\"));\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(_sentPackets.bitAt(packetNo)) {\n\t\t\t\t\t\t\t\tLogger.error(this, \"Already sent packet in packetReceived: \"+packetNo+\" for \"+this+\" unsent is \"+_unsent+\" sent is \"+_sentPackets, new Exception(\"error\"));\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t_unsent.addLast(packetNo);\n\t\t\t\t\t\t\ttimeAllSent = -1;\n\t\t\t\t\t\t\t_senderThread.schedule();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tpublic void receiveAborted(int reason, String description) {\n\t\t\t\t\t\tonAborted(reason, description);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\t_senderThread.schedule();\n\t\t\t\n\t\t\tmfAllReceived = MessageFilter.create().setType(DMT.allReceived).setField(DMT.UID, _uid).setSource(_destination).setNoTimeout();\n\t\t\tmfSendAborted = MessageFilter.create().setType(DMT.sendAborted).setField(DMT.UID, _uid).setSource(_destination).setNoTimeout();\n\t\t\t\n\t\t\ttry {\n\t\t\t\t_usm.addAsyncFilter(mfAllReceived, cbAllReceived, _ctr);\n\t\t\t\t_usm.addAsyncFilter(mfSendAborted, cbSendAborted, _ctr);\n\t\t\t} catch (DisconnectedException e) {\n\t\t\t\tonDisconnect();\n\t\t\t}\n\t\t\t\n\t\t} catch (AbortedException e) {\n\t\t\tonAborted(_prb._abortReason, _prb._abortDescription);\n\t\t}\n\t}", "@Override\n\tpublic synchronized <T> Future<T> sendEvent(Event<T> e) {\n\n\t\tif (typesQueue != null && !typesQueue.isEmpty())\n\t\t{\n\t\t\tFuture future=new Future();\n\t\t\tif(subscribersMessages!=null)\n\t\t\t{\n\t\t\t\tSubscriber temp = typesQueue.get(e.getClass()).peek();\n\t\t\t\tif(temp!=null)\n\t\t\t\t{\n\t\t\t\t\tsubscribersMessages.get(temp).add(e);\n\t\t\t\t\troundRubbin(typesQueue.get(e.getClass()));\n\t\t\t\t\tresults.put(e,future);\n\t\t\t\t\tnotifyAll();\n\t\t\t\t\treturn future;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\treturn null;\n\n\t\t\t}\n\t\t}\n\n\t\t\treturn null;\n\t}", "@Override\n public void send(final EventData data) {\n LOGGER.debug(\"async event {} sent via LocalAsyncProcessor\", data.getData().ret$PQON());\n LOGGER.debug(\"(currently events are discarded in localtests)\");\n }", "protected void emitBatch(){\n synchronized(this){\n\n revokeSendBatch();\n\n int viewn = getCurrentViewNumber();\n long seqn = getStateLog().getNextPrePrepareSEQ();\n\n PBFTRequestInfo rinfo = getRequestInfo();\n if(!rinfo.hasSomeWaiting()){\n return;\n }\n /* creates a new pre-prepare message */\n PBFTPrePrepare pp = null;\n\n int size = 0;\n\n /* while has not achieved the batch size and there is digests in queue */\n String digest = null;\n while(size < getBatchSize() && (digest = rinfo.getFirtRequestDigestWaiting())!= null){\n if(pp == null){\n pp = new PBFTPrePrepare(viewn, seqn, getLocalServerID());\n }\n pp.getDigests().add(digest);\n rinfo.assign(digest, RequestState.PREPREPARED);\n size += 1;//rinfo.getRequestSize(digest);\n }\n\n if(pp == null){\n return;\n }\n \n /* emits pre-prepare */\n emitPrePrepare(pp);\n //emit(pp, getLocalGroup().minus(getLocalProcess()));\n\n /* update log current pre-prepare */\n handle(pp);\n\n /* if there is digest then it will schedule a send batch */\n if(rinfo.hasSomeWaiting()){\n batch();\n }//end if digest queue is no empty\n\n }//end synchronized(this)\n }", "@Test\n public void dispatchToMultipleObjects() {\n BaseEventBus eventBus = new SynchronousEventBus(LOG);\n\n final List<String> object1Received = new ArrayList<>();\n Object object1 = new Object() {\n @Subscriber\n public void onStringEvent(String event) {\n object1Received.add(event);\n }\n };\n\n final List<String> object2Received = new ArrayList<>();\n Object object2 = new Object() {\n @Subscriber\n public void onStringEvent(String event) {\n object2Received.add(event);\n }\n };\n\n eventBus.register(object1);\n eventBus.register(object2);\n\n eventBus.post(\"event 1\");\n eventBus.post(\"event 2\");\n\n // both subscribers should receive all items\n assertThat(object1Received, is(asList(\"event 1\", \"event 2\")));\n assertThat(object2Received, is(asList(\"event 1\", \"event 2\")));\n }", "public static synchronized void submit(Event event) {\n StreamConfig streamConfig = STREAM_CONFIGS.get(event.getStream());\n if (streamConfig == null) {\n return;\n }\n if (!SamplingController.isInSample(event)) {\n return;\n }\n addEventMetadata(event);\n //\n // Temporarily send events immediately in order to investigate discrepancies in\n // the numbers of events submitted in this system vs. legacy eventlogging.\n //\n // https://phabricator.wikimedia.org/T281001\n //\n // OutputBuffer.schedule(event);\n OutputBuffer.sendEventsForStream(streamConfig, Collections.singletonList(event));\n }", "private void AsyncPush(String topic){\n\t\t\t\t \t\n\t \t/**\n\t \t * output a map, delete existed items\n\t \t */\n\t \t//Map<Key, Integer> deduplicatedBuff = mergeDuplicatedItemsAndDelte(buff);\n\t \t\n\t \t//not in, create, delay\n\t \tif(!producerMap.containsKey(topic)){\n\t \t\ttry {\n\t\t\t\t\t\t\tCreateProducer(topic,LogicController.batchMessagesMaxMessagesPerBatch);\n\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t} catch (ExecutionException 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}\t \t\t \n\t \t}\n\t \tlog.info(\"#publish\"+topic+\", \"+buffMap.size());\n\t \tProducer<byte[]> producer = producerMap.get(topic);\n\t \t/**\n\t \t * init set, copy to hash set\n\t \t */\n\t \t//Set<Key> Keys = Sets.newConcurrentHashSet(buffMap.keySet());\n\t \t\n\t \t \n\t \tfor (Key key : buffMap.keySet()){\n\t \t\t \n\t \t\t //if(buffMap.containsKey(key)){\n\t \t\t \n\t \t\t \n\t \t\t if(buffMap.containsKey(key)){\n\t \t\t\t Integer val = buffMap.get(key);\n\t \t\t\t //clear,skip\n\t \t\t\t if(val<=0){buffMap.remove(key);continue;}\n\t \t\t\t //concenate\n\t \t\t\t byte[] out = createKVByte(key,val);\n\t \t\t\t \n\t \t\t\t//get producer\n\t\t\t \t\t\t \n\t\t\t \t\t\t //byte[] tempTable = new byte[](buffMap);\n\t\t producer.sendAsync(out).thenRun(() -> {\n\t\t\t messagesSent.increment();\n\t\t\t bytesSent.add(out.length);\n\t\t\t //update\n\t\t\t TopicMap.replace(topic, TopicMap.get(topic)+out.length);\t\n\t\t\t \n\t\t\t //delete\n\t\t\t rescaleBufferMap(buffMap,key,val);\n\t\t\t \n\t\t\t //CheckNumberPacketsEnoughEndMessageAndSend(topic);\n\t\t\t //buffMap.remove(key);\n\t\t\t //remove from the set\n\t\t\t //ier.remove();\n\t\t\t \t\t \t\t \n\t\t\t }).exceptionally(ex -> {\n\t\t\t log.warn(\"Write error on message\", ex);\n\t\t\t //System.exit(-1);\n\t\t\t return null;\n\t\t\t });\n\t \t\t }\n\t \t\t }\n\t \t\t \n\t \t }", "protected void deliverMessages()\n {\n Set<Envelope> envelopes = messengerDao.getEnvelopes();\n\n Map<String, Set<Envelope>> peerEnvelopesMap = Maps.newHashMap();\n int maxTimeToLive = 0;\n //distribute envelops to peers\n for ( Envelope envelope : envelopes )\n {\n if ( envelope.getTimeToLive() > maxTimeToLive )\n {\n maxTimeToLive = envelope.getTimeToLive();\n }\n Set<Envelope> peerEnvelopes = peerEnvelopesMap.get( envelope.getTargetPeerId() );\n if ( peerEnvelopes == null )\n {\n //sort by createDate asc once more\n peerEnvelopes = new TreeSet<>( new Comparator<Envelope>()\n {\n @Override\n public int compare( final Envelope o1, final Envelope o2 )\n {\n return o1.getCreateDate().compareTo( o2.getCreateDate() );\n }\n } );\n peerEnvelopesMap.put( envelope.getTargetPeerId(), peerEnvelopes );\n }\n\n peerEnvelopes.add( envelope );\n }\n\n\n //try to send messages in parallel - one thread per peer\n try\n {\n for ( Map.Entry<String, Set<Envelope>> envelopsPerPeer : peerEnvelopesMap.entrySet() )\n {\n Peer targetPeer = messenger.getPeerManager().getPeer( envelopsPerPeer.getKey() );\n if ( targetPeer.isLocal() )\n {\n completer.submit(\n new LocalPeerMessageSender( messenger, messengerDao, envelopsPerPeer.getValue() ) );\n }\n else\n {\n completer.submit(\n new RemotePeerMessageSender( messengerDao, targetPeer, envelopsPerPeer.getValue() ) );\n }\n }\n\n //wait for completion\n try\n {\n for ( int i = 0; i < peerEnvelopesMap.size(); i++ )\n {\n Future<Boolean> future = completer.take();\n future.get();\n }\n }\n catch ( InterruptedException | ExecutionException e )\n {\n LOG.warn( \"ignore\", e );\n }\n }\n catch ( PeerException e )\n {\n LOG.error( e.getMessage(), e );\n }\n }", "public synchronized MRPublisherResponse sendBatchWithResponse() {\n if (fPending.isEmpty()) {\n pubResponse.setResponseCode(String.valueOf(HttpStatus.SC_BAD_REQUEST));\n pubResponse.setResponseMessage(\"No Messages to send\");\n return pubResponse;\n }\n\n final long nowMs = Clock.now();\n\n host = this.fHostSelector.selectBaseHost();\n\n final String httpUrl = MRConstants.makeUrl(host, fTopic, props.getProperty(DmaapClientConst.PROTOCOL),\n props.getProperty(DmaapClientConst.PARTITION));\n OutputStream os = null;\n try (ByteArrayOutputStream baseStream = new ByteArrayOutputStream()) {\n os = baseStream;\n final String propsContentType = props.getProperty(DmaapClientConst.CONTENT_TYPE);\n if (propsContentType.equalsIgnoreCase(MRFormat.JSON.toString())) {\n JSONArray jsonArray = parseJSON();\n os.write(jsonArray.toString().getBytes());\n } else if (propsContentType.equalsIgnoreCase(CONTENT_TYPE_TEXT)) {\n for (TimestampedMessage m : fPending) {\n os.write(m.fMsg.getBytes());\n os.write('\\n');\n }\n } else if (propsContentType.equalsIgnoreCase(MRFormat.CAMBRIA.toString())\n || (propsContentType.equalsIgnoreCase(MRFormat.CAMBRIA_ZIP.toString()))) {\n if (propsContentType.equalsIgnoreCase(MRFormat.CAMBRIA_ZIP.toString())) {\n os = new GZIPOutputStream(baseStream);\n }\n for (TimestampedMessage m : fPending) {\n os.write((\"\" + m.fPartition.length()).getBytes());\n os.write('.');\n os.write((\"\" + m.fMsg.length()).getBytes());\n os.write('.');\n os.write(m.fPartition.getBytes());\n os.write(m.fMsg.getBytes());\n os.write('\\n');\n }\n os.close();\n } else {\n for (TimestampedMessage m : fPending) {\n os.write(m.fMsg.getBytes());\n\n }\n }\n\n final long startMs = Clock.now();\n if (ProtocolType.DME2.getValue().equalsIgnoreCase(protocolFlag)) {\n\n try {\n configureDME2();\n\n this.wait(5);\n\n if (fPending.peek() != null) {\n logSendMessage(fPending.size(), url + subContextPath, nowMs - fPending.peek().timestamp);\n }\n sender.setPayload(os.toString());\n\n String dmeResponse = sender.sendAndWait(5000L);\n\n pubResponse = createMRPublisherResponse(dmeResponse, pubResponse);\n\n if (Integer.parseInt(pubResponse.getResponseCode()) < 200\n || Integer.parseInt(pubResponse.getResponseCode()) > 299) {\n\n return pubResponse;\n }\n final String logLine = String.valueOf((Clock.now() - startMs)) + dmeResponse.toString();\n getLog().info(logLine);\n fPending.clear();\n\n } catch (DME2Exception x) {\n getLog().warn(x.getMessage(), x);\n pubResponse.setResponseCode(x.getErrorCode());\n pubResponse.setResponseMessage(x.getErrorMessage());\n } catch (URISyntaxException x) {\n\n getLog().warn(x.getMessage(), x);\n pubResponse.setResponseCode(String.valueOf(HttpStatus.SC_BAD_REQUEST));\n pubResponse.setResponseMessage(x.getMessage());\n } catch (InterruptedException e) {\n throw e;\n } catch (Exception x) {\n\n pubResponse.setResponseCode(String.valueOf(HttpStatus.SC_INTERNAL_SERVER_ERROR));\n pubResponse.setResponseMessage(x.getMessage());\n logger.error(\"exception: \", x);\n\n }\n\n return pubResponse;\n }\n\n if (ProtocolType.AUTH_KEY.getValue().equalsIgnoreCase(protocolFlag)) {\n if (fPending.peek() != null) {\n logSendMessage(fPending.size(), httpUrl, nowMs - fPending.peek().timestamp);\n }\n final String result = postAuthwithResponse(httpUrl, baseStream.toByteArray(), contentType, authKey,\n authDate, username, password, protocolFlag);\n // Here we are checking for error response. If HTTP status\n // code is not within the http success response code\n // then we consider this as error and return false\n\n pubResponse = createMRPublisherResponse(result, pubResponse);\n\n if (Integer.parseInt(pubResponse.getResponseCode()) < 200\n || Integer.parseInt(pubResponse.getResponseCode()) > 299) {\n\n return pubResponse;\n }\n\n logTime(startMs, result);\n fPending.clear();\n return pubResponse;\n }\n\n if (ProtocolType.AAF_AUTH.getValue().equalsIgnoreCase(protocolFlag)) {\n if (fPending.peek() != null) {\n logSendMessage(fPending.size(), httpUrl, nowMs - fPending.peek().timestamp);\n }\n final String result = postWithResponse(httpUrl, baseStream.toByteArray(), contentType, username,\n password, protocolFlag);\n\n // Here we are checking for error response. If HTTP status\n // code is not within the http success response code\n // then we consider this as error and return false\n pubResponse = createMRPublisherResponse(result, pubResponse);\n\n if (Integer.parseInt(pubResponse.getResponseCode()) < 200\n || Integer.parseInt(pubResponse.getResponseCode()) > 299) {\n\n return pubResponse;\n }\n\n final String logLine = String.valueOf((Clock.now() - startMs));\n getLog().info(logLine);\n fPending.clear();\n return pubResponse;\n }\n\n if (ProtocolType.HTTPNOAUTH.getValue().equalsIgnoreCase(protocolFlag)) {\n if (fPending.peek() != null) {\n logSendMessage(fPending.size(), httpUrl, nowMs - fPending.peek().timestamp);\n }\n final String result = postNoAuthWithResponse(httpUrl, baseStream.toByteArray(), contentType);\n\n // Here we are checking for error response. If HTTP status\n // code is not within the http success response code\n // then we consider this as error and return false\n pubResponse = createMRPublisherResponse(result, pubResponse);\n\n if (Integer.parseInt(pubResponse.getResponseCode()) < 200\n || Integer.parseInt(pubResponse.getResponseCode()) > 299) {\n\n return pubResponse;\n }\n\n final String logLine = String.valueOf((Clock.now() - startMs));\n getLog().info(logLine);\n fPending.clear();\n return pubResponse;\n }\n } catch (IllegalArgumentException | HttpException x) {\n getLog().warn(x.getMessage(), x);\n pubResponse.setResponseCode(String.valueOf(HttpStatus.SC_BAD_REQUEST));\n pubResponse.setResponseMessage(x.getMessage());\n\n } catch (IOException x) {\n getLog().warn(x.getMessage(), x);\n pubResponse.setResponseCode(String.valueOf(HttpStatus.SC_INTERNAL_SERVER_ERROR));\n pubResponse.setResponseMessage(x.getMessage());\n } catch (InterruptedException e) {\n getLog().warn(\"Interrupted!\", e);\n // Restore interrupted state...\n Thread.currentThread().interrupt();\n } catch (Exception x) {\n getLog().warn(x.getMessage(), x);\n\n pubResponse.setResponseCode(String.valueOf(HttpStatus.SC_INTERNAL_SERVER_ERROR));\n pubResponse.setResponseMessage(x.getMessage());\n\n } finally {\n if (!fPending.isEmpty()) {\n getLog().warn(\"Send failed, \" + fPending.size() + \" message to send.\");\n pubResponse.setPendingMsgs(fPending.size());\n }\n if (os != null) {\n try {\n os.close();\n } catch (Exception x) {\n getLog().warn(x.getMessage(), x);\n pubResponse.setResponseCode(String.valueOf(HttpStatus.SC_INTERNAL_SERVER_ERROR));\n pubResponse.setResponseMessage(\"Error in closing Output Stream\");\n }\n }\n }\n\n return pubResponse;\n }", "@Override\n public void send(final EventData data) {\n LOGGER.debug(\"async event {} sent via vert.x EventBus\", data.getData().ret$PQON());\n if (bus != null) {\n final EventParameters attribs = data.getData();\n if (attribs instanceof GenericEvent genericEvent) {\n bus.send(toBusAddress(genericEvent.getEventID()), data, ASYNC_EVENTBUS_DELIVERY_OPTIONS);\n } else {\n bus.send(toBusAddress(attribs.ret$PQON()), data, ASYNC_EVENTBUS_DELIVERY_OPTIONS);\n }\n } else {\n LOGGER.error(\"event bus is null - discarding event {}\", data.getData().ret$PQON());\n }\n }", "public void processOffers(List<OfferPublishedEvent> events) {\n }", "private boolean publishAndUpdateLocalEvents(StockLocalEventStore localEventStore) {\n try {\n CompletableFuture<Boolean> publishedEventOnTopic = publishEvents(marketTopic, localEventStore.getEvent());\n CompletableFuture<Boolean> publishedEventOnStockAggregateTopic = publishEvents(aggregateUpdateTopic, localEventStore.getEvent());\n if (Boolean.TRUE.equals(publishedEventOnTopic.get()) && Boolean.TRUE.equals(publishedEventOnStockAggregateTopic.get())) {\n localEventStore.setSent(Boolean.TRUE);\n repository.save(localEventStore);\n return true;\n }\n } catch (InterruptedException exception) {\n logger.error().log(\"Exception while publishing and updating local events for localEvent:{}\", localEventStore, exception);\n Thread.currentThread().interrupt();\n } catch (Exception e) {\n logger.error().log(\"Exception while publishing and updating local events for localEvent:{}\", localEventStore, e);\n }\n return false;\n }", "private void fireEvents() {\n\n if (clockTickCount % clockTicksTillWorkloadChange == 0) {\n clockEventPublisher.fireTriggerWorkloadHandlerEvent(clockTickCount, intervalDurationInMilliSeconds);\n }\n\n // if (clockTickCount % clockTicksTillScalingDecision == 0) {\n // clockEventPublisher.fireTriggerAutoScalerEvent(clockTickCount,\n // intervalDurationInMilliSeconds);\n // }\n\n clockEventPublisher.fireClockEvent(clockTickCount, intervalDurationInMilliSeconds);\n\n // INfrastruktur\n if (clockTickCount % clockTicksTillPublishInfrastructureState == 0) {\n clockEventPublisher.fireTriggerPublishInfrastructureStateEvent(clockTickCount,\n intervalDurationInMilliSeconds);\n\n }\n\n // Queue\n if (clockTickCount % clockTicksTillPublishQueueState == 0) {\n\n clockEventPublisher.fireTriggerPublishQueueStateEvent(clockTickCount, intervalDurationInMilliSeconds);\n }\n\n }", "@Override\n public void publish(Object event) {\n System.out.println(\"Sending Event\");\n\n List<Hub> hubList = hubFacade.findAll();\n Iterator<Hub> it = hubList.iterator();\n while (it.hasNext()) {\n Hub hub = it.next();\n restEventPublisher.publish(hub, event);\n\n\n //Thread.currentThread().sleep(1000);\n }\n System.out.println(\"Sending Event After\");\n }", "private void routeQueuedEvent() {\n \t\t\n \t\tfinal SleeTransactionManager txMgr = this.container.getTransactionManager();\n \t\t\t\t\n \t\tboolean rollbackTx = true;\n \t\t\n \t\ttry {\n \n \t\t\tEventContextImpl eventContextImpl = de.getEventRouterActivity().getCurrentEventContext();\n \t\t\tif (eventContextImpl == null) {\t\t\t\t\n \t\t\t\tif (logger.isDebugEnabled())\n \t\t\t\t\tlogger.debug(\"\\n\\n\\nDelivering event : [[[ eventId \"\n \t\t\t\t\t\t\t+ de.getEventTypeId() + \" on ac \"+de.getActivityContextId()+\"\\n\");\n \t\t\t\t\n \t\t\t\t// event context not set, create it \n \t\t\t\teventContextImpl = new EventContextImpl(de,container);\n \t\t\t\tde.getEventRouterActivity().setCurrentEventContext(eventContextImpl);\n \t\t\t\t// do initial event processing\n \t\t\t\tEventTypeComponent eventTypeComponent = container.getComponentRepositoryImpl().getComponentByID(de.getEventTypeId());\n \t\t\t\tif (logger.isDebugEnabled()) {\n \t\t\t\t\tlogger.debug(\"Active services for event \"+de.getEventTypeId()+\": \"+eventTypeComponent.getActiveServicesWhichDefineEventAsInitial());\n \t\t\t\t}\n \t\t\t\tfor (ServiceComponent serviceComponent : eventTypeComponent.getActiveServicesWhichDefineEventAsInitial()) {\n \t\t\t\t\tif (de.getService() == null || de.getService().equals(serviceComponent.getServiceID())) {\n \t\t\t\t\t\tinitialEventProcessor.processInitialEvents(serviceComponent, de, txMgr, this.container.getActivityContextFactory());\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t\telse {\n \t\t\t\tif (eventContextImpl.isSuspendedNotTransacted()) {\n \t\t\t\t\tif (logger.isDebugEnabled())\n \t\t\t\t\t\tlogger.debug(\"\\n\\n\\nFreezing (due to suspended context) event delivery : [[[ eventId \"\n \t\t\t\t\t\t\t\t+ de.getEventTypeId() + \" on ac \"+de.getActivityContextId()+\"\\n\");\n \t\t\t\t\teventContextImpl.barrierEvent(de);\n \t\t\t\t\treturn;\n \t\t\t\t}\n \t\t\t\telse {\n \t\t\t\t\tif (logger.isDebugEnabled())\n \t\t\t\t\t\tlogger.debug(\"\\n\\n\\nResuming event delivery : [[[ eventId \"\n \t\t\t\t\t\t\t+ de.getEventTypeId() + \" on ac \"+de.getActivityContextId()+\"\\n\");\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\t// For each SBB that is attached to this activity context.\n \t\t\tboolean gotSbb = false;\n \t\t\tdo {\n \t\t\t\t\n \t\t\t\tString rootSbbEntityId = null;\n \t\t\t\tClassLoader invokerClassLoader = null;\n \t\t\t\tSbbEntity sbbEntity = null;\n \t\t\t\tSbbObject sbbObject = null;\n \n \t\t\t\ttry {\n \n \t\t\t\t\t/*\n \t\t\t\t\t * Start of SLEE Originated Invocation Sequence\n \t\t\t\t\t * ============================================== This\n \t\t\t\t\t * sequence consists of either: 1) One \"Op Only\" SLEE\n \t\t\t\t\t * Originated Invocation - in the case that it's a\n \t\t\t\t\t * straightforward event routing for the sbb entity. 2) One\n \t\t\t\t\t * \"Op and Remove\" SLEE Originated Invocation - in the case\n \t\t\t\t\t * it's an event routing to a root sbb entity that ends up\n \t\t\t\t\t * in a remove to the same entity since the attachment count\n \t\t\t\t\t * goes to zero after the event invocation 3) One \"Op Only\"\n \t\t\t\t\t * followed by one \"Remove Only\" SLEE Originated Invocation -\n \t\t\t\t\t * in the case it's an event routing to a non-root sbb\n \t\t\t\t\t * entity that ends up in a remove to the corresponding root\n \t\t\t\t\t * entity since the root attachment count goes to zero after\n \t\t\t\t\t * the event invocation Each Invocation Sequence is handled\n \t\t\t\t\t * in it's own transaction. All exception handling for each\n \t\t\t\t\t * invocation sequence is handled here. Any exceptions that\n \t\t\t\t\t * propagate up aren't necessary to be caught. -Tim\n \t\t\t\t\t */\n \n \t\t\t\t\t// If this fails then we propagate up since there's nothing to roll-back anyway\n \t\t\t\t\t\n \t\t\t\t\ttxMgr.begin();\n \t\t\t\t\t\n \t\t\t\t\tActivityContext ac = null;\n \t\t\t\t\tException caught = null;\n \t\t\t\t\tSbbEntity highestPrioritySbbEntity = null;\n \t\t\t\t\tClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();\n \t\t\t\t\t\n \t\t\t\t\tSet<String> sbbEntitiesThatHandledCurrentEvent = eventContextImpl.getSbbEntitiesThatHandledEvent();\n \t\t\t\t\t\n \t\t\t\t\ttry {\n \t\t\t\t\t\n \t\t\t\t\t\tac = container.getActivityContextFactory().getActivityContext(de.getActivityContextId(),true);\n \n \t\t\t\t\t\ttry {\n \t\t\t\t\t\t\thighestPrioritySbbEntity = nextSbbEntityFinder.next(ac, de.getEventTypeId(), de.getService(), sbbEntitiesThatHandledCurrentEvent);\n \t\t\t\t\t\t} catch (Exception e) {\n \t\t\t\t\t\t\tlogger.warn(\"Failed to find next sbb entity to deliver the event \"+de+\" in \"+ac.getActivityContextId(), e);\n \t\t\t\t\t\t\thighestPrioritySbbEntity = null;\n \t\t\t\t\t\t}\n \n \t\t\t\t\t\tif (highestPrioritySbbEntity == null) {\n \t\t\t\t\t\t\tgotSbb = false;\n \t\t\t\t\t\t\tsbbEntitiesThatHandledCurrentEvent.clear();\t\t\t\t\t\t\n \t\t\t\t\t\t} else {\n \t\t\t\t\t\t\tgotSbb = true;\n \t\t\t\t\t\t\tsbbEntitiesThatHandledCurrentEvent.add(highestPrioritySbbEntity.getSbbEntityId());\t\n \t\t\t\t\t\t}\n \n \t\t\t\t\t\tif (gotSbb) {\n \n \t\t\t\t\t\t\tif (logger.isDebugEnabled()) {\n \t\t\t\t\t\t\t\tlogger\n \t\t\t\t\t\t\t\t\t\t.debug(\"Highest priority SBB entity, which is attached to the ac \"+de.getActivityContextId()+\" , to deliver the event: \"\n \t\t\t\t\t\t\t\t\t\t\t\t+ highestPrioritySbbEntity.getSbbEntityId());\n \t\t\t\t\t\t\t}\n \n \t\t\t\t\t\t\t// CHANGE CLASS LOADER\n \t\t\t\t\t\t\tinvokerClassLoader = highestPrioritySbbEntity.getSbbComponent().getClassLoader();\n \t\t\t\t\t\t\tThread.currentThread().setContextClassLoader(invokerClassLoader);\n \n \t\t\t\t\t\t\tsbbEntity = highestPrioritySbbEntity;\n \t\t\t\t\t\t\trootSbbEntityId = sbbEntity.getRootSbbId();\n \n \t\t\t\t\t\t\tEventRouterThreadLocals.setInvokingService(sbbEntity.getServiceId());\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t\t// Assign an sbb from the pool\n \t\t\t\t\t\t\tsbbEntity.assignAndActivateSbbObject();\n \t\t\t\t\t\t\tsbbObject = sbbEntity.getSbbObject();\n \t\t\t\t\t\t\tsbbObject.sbbLoad();\n \n \t\t\t\t\t\t\t// GET AND CHECK EVENT MASK FOR THIS SBB ENTITY\n \t\t\t\t\t\t\tSet eventMask = sbbEntity.getMaskedEventTypes(de.getActivityContextId());\n \t\t\t\t\t\t\tif (!eventMask.contains(de.getEventTypeId())) {\n \n \t\t\t\t\t\t\t\t// TIME TO INVOKE THE EVENT HANDLER METHOD\n \t\t\t\t\t\t\t\tsbbObject.setSbbInvocationState(SbbInvocationState.INVOKING_EVENT_HANDLER);\n \t\t\t\t\t\t\t\t\n \t\t\t\t\t\t\t\tif (logger.isDebugEnabled()) {\n \t\t\t\t\t\t\t\t\tlogger\n \t\t\t\t\t\t\t\t\t\t\t.debug(\"---> Invoking event handler: ac=\"+de.getActivityContextId()+\" , sbbEntity=\"+sbbEntity.getSbbEntityId()+\" , sbbObject=\"+sbbObject);\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\tsbbEntity.invokeEventHandler(de,ac,eventContextImpl);\n \n \t\t\t\t\t\t\t\tif (logger.isDebugEnabled()) {\n \t\t\t\t\t\t\t\t\tlogger\n \t\t\t\t\t\t\t\t\t\t\t.debug(\"<--- Invoked event handler: ac=\"+de.getActivityContextId()+\" , sbbEntity=\"+sbbEntity.getSbbEntityId()+\" , sbbObject=\"+sbbObject);\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// check to see if the transaction is marked for\n \t\t\t\t\t\t\t\t// rollback if it is then we need to get out of\n \t\t\t\t\t\t\t\t// here soon as we can.\n \t\t\t\t\t\t\t\tif (txMgr.getRollbackOnly()) {\n \t\t\t\t\t\t\t\t\tthrow new Exception(\"The transaction is marked for rollback\");\n \t\t\t\t\t\t\t\t}\n \n \t\t\t\t\t\t\t\tsbbObject.setSbbInvocationState(SbbInvocationState.NOT_INVOKING);\n \t\t\t\t\t\t\t\t\n \t\t\t\t\t\t\t} else {\n \t\t\t\t\t\t\t\tif (logger.isDebugEnabled()) {\n \t\t\t\t\t\t\t\t\tlogger\n \t\t\t\t\t\t\t\t\t\t\t.debug(\"Not invoking event handler since event is masked\");\n \t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t}\n \n \t\t\t\t\t\t\t// IF IT'S AN ACTIVITY END EVENT DETACH SBB ENTITY HERE\n \t\t\t\t\t\t\tif (de.getEventTypeId().equals(ActivityEndEventImpl.EVENT_TYPE_ID)) {\n \t\t\t\t\t\t\t\tif (logger.isDebugEnabled()) {\n \t\t\t\t\t\t\t\t\tlogger\n \t\t\t\t\t\t\t\t\t\t\t.debug(\"The event is an activity end event, detaching ac=\"+de.getActivityContextId()+\" , sbbEntity=\"+sbbEntity.getSbbEntityId());\n \t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\thighestPrioritySbbEntity.afterACDetach(de.getActivityContextId());\n \t\t\t\t\t\t\t}\n \n \t\t\t\t\t\t\t// CHECK IF WE CAN CLAIM THE ROOT SBB ENTITY\n \t\t\t\t\t\t\tif (rootSbbEntityId != null) {\n \t\t\t\t\t\t\t\tif (SbbEntityFactory.getSbbEntity(rootSbbEntityId).getAttachmentCount() != 0) {\n \t\t\t\t\t\t\t\t\tif (logger.isDebugEnabled()) {\n \t\t\t\t\t\t\t\t\t\tlogger\n \t\t\t\t\t\t\t\t\t\t\t\t.debug(\"Not removing sbb entity \"+sbbEntity.getSbbEntityId()+\" , the attachment count is not 0\");\n \t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t\t// the root sbb entity is not be claimed\n \t\t\t\t\t\t\t\t\trootSbbEntityId = null;\n \t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t} else {\n \t\t\t\t\t\t\t\t// it's a root sbb\n \t\t\t\t\t\t\t\tif (!sbbEntity.isRemoved()\t&& sbbEntity.getAttachmentCount() == 0) {\n \t\t\t\t\t\t\t\t\tif (logger.isDebugEnabled()) {\n \t\t\t\t\t\t\t\t\t\tlogger\n \t\t\t\t\t\t\t\t\t\t\t\t.debug(\"Removing sbb entity \"+sbbEntity.getSbbEntityId()+\" , the attachment count is not 0\");\n \t\t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\t\t// If it's the same entity then this is an\n \t\t\t\t\t\t\t\t\t// \"Op and\n \t\t\t\t\t\t\t\t\t// Remove Invocation Sequence\"\n \t\t\t\t\t\t\t\t\t// so we do the remove in the same\n \t\t\t\t\t\t\t\t\t// invocation\n \t\t\t\t\t\t\t\t\t// sequence as the Op\n \t\t\t\t\t\t\t\t\tSbbEntityFactory.removeSbbEntityWithCurrentClassLoader(sbbEntity,true);\n \t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t}\n \t\t\t\t\t} catch (Exception e) {\n \t\t\t\t\t\tlogger.error(\"Failure while routing event; second phase. DeferredEvent [\"+ de.getEventTypeId() + \"]\", e);\n \t\t\t\t\t\tif (highestPrioritySbbEntity != null) {\n \t\t\t\t\t\t\tsbbObject = highestPrioritySbbEntity.getSbbObject();\n \t\t\t\t\t\t}\n \t\t\t\t\t\tcaught = e;\n \t\t\t\t\t} \n \t\t\t\t\t\t\t\t\t\t\n \t\t\t\t\t// do a final check to see if there is another SBB to\n \t\t\t\t\t// deliver.\n \t\t\t\t\t// We don't want to waste another loop. Note that\n \t\t\t\t\t// rollback\n \t\t\t\t\t// will not has any impact on this because the\n \t\t\t\t\t// ac.DeliveredSet\n \t\t\t\t\t// is not in the cache.\n \t\t\t\t\tif (gotSbb) {\n \t\t\t\t\t\ttry {\n \t\t\t\t\t\t\tif (nextSbbEntityFinder.next(ac, de.getEventTypeId(),de.getService(),sbbEntitiesThatHandledCurrentEvent) == null) {\n \t\t\t\t\t\t\t\tgotSbb = false;\n \t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (Throwable e) {\n \t\t\t\t\t\t\tgotSbb = false;\n \t\t\t\t\t\t} \n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif (!gotSbb) {\n\t\t\t\t\t\tde.eventProcessingSucceed();\n\t\t\t\t\t\tif (logger.isDebugEnabled()) {\n\t\t\t\t\t\t\tlogger.debug(\"Delaying commit for 100ms, needed by wrongly designed tck transaction isolation tests. This only happens with DEBUG log level\");\n\t\t\t\t\t\t\tThread.sleep(100);\n\t\t\t\t\t\t}\t\t\t\t\t\t\n \t\t\t\t\t}\n\t\t\t\t\t\n \t\t\t\t\tThread.currentThread().setContextClassLoader(\n \t\t\t\t\t\t\toldClassLoader);\n \n \t\t\t\t\tboolean invokeSbbRolledBack = handleRollback.handleRollback(sbbObject, caught, invokerClassLoader,txMgr);\n \n \t\t\t\t\tboolean invokeSbbRolledBackRemove = false;\n \t\t\t\t\tClassLoader rootInvokerClassLoader = null;\n \t\t\t\t\tSbbEntity rootSbbEntity = null;\n \n \t\t\t\t\tif (!invokeSbbRolledBack && rootSbbEntityId != null) {\n \t\t\t\t\t\t/*\n \t\t\t\t\t\t * If we get here this means that we need to do a\n \t\t\t\t\t\t * cascading remove of the root sbb entity - since the\n \t\t\t\t\t\t * original invocation was done on a non-root sbb entity\n \t\t\t\t\t\t * then this is done in a different SLEE originated\n \t\t\t\t\t\t * invocation, but inside the same SLEE originated\n \t\t\t\t\t\t * invocation sequence. Confused yet? This is case 3) in\n \t\t\t\t\t\t * my previous comment - the SLEE originated invocation\n \t\t\t\t\t\t * sequence contains two SLEE originated invocations:\n \t\t\t\t\t\t * One \"Op Only\" and One \"Remove Only\" This is the\n \t\t\t\t\t\t * \"Remove Only\" part. We don't bother doing this if we\n \t\t\t\t\t\t * already need to rollback\n \t\t\t\t\t\t */\n \n \t\t\t\t\t\tcaught = null;\n \n \t\t\t\t\t\toldClassLoader = Thread.currentThread().getContextClassLoader();\n \n \t\t\t\t\t\ttry {\n \t\t\t\t\t\t\trootSbbEntity = SbbEntityFactory.getSbbEntity(rootSbbEntityId);\n \n \t\t\t\t\t\t\trootInvokerClassLoader = rootSbbEntity.getSbbComponent().getClassLoader();\n \t\t\t\t\t\t\tThread.currentThread().setContextClassLoader(rootInvokerClassLoader);\n \n \t\t\t\t\t\t\tSbbEntityFactory.removeSbbEntity(rootSbbEntity,true);\n \n \t\t\t\t\t\t} catch (Exception e) {\n \t\t\t\t\t\t\tlogger.error(\"Failure while routing event; third phase. Event Posting [\"+ de + \"]\", e);\n \t\t\t\t\t\t\tcaught = e;\n \t\t\t\t\t\t} finally {\n \n \t\t\t\t\t\t\tThread.currentThread().setContextClassLoader(oldClassLoader);\n \t\t\t\t\t\t}\n \n \t\t\t\t\t\t// We have no target sbb object in a Remove Only SLEE\n \t\t\t\t\t\t// originated invocation\n \t\t\t\t\t\t// FIXME emmartins review\n \t\t\t\t\t\tinvokeSbbRolledBackRemove = handleRollback.handleRollback(null, caught, rootInvokerClassLoader,txMgr);\n \t\t\t\t\t}\n \n \t\t\t\t\t/*\n \t\t\t\t\t * We are now coming to the end of the SLEE originated\n \t\t\t\t\t * invocation sequence We may need to run sbbRolledBack This\n \t\t\t\t\t * is done in the same tx if there is no target sbb entity\n \t\t\t\t\t * in any of the SLEE originated invocations making up this\n \t\t\t\t\t * SLEE originated invocation sequence Otherwise we do it in\n \t\t\t\t\t * a separate tx for each SLEE originated invocation that\n \t\t\t\t\t * has a target sbb entity. In other words we might have a\n \t\t\t\t\t * maximum of 2 sbbrolledback callbacks invoked in separate\n \t\t\t\t\t * tx in the case this SLEE Originated Invocation Sequence\n \t\t\t\t\t * contained an Op Only and a Remove Only (since these have\n \t\t\t\t\t * different target sbb entities) Pretty obvious really! ;)\n \t\t\t\t\t */\n \t\t\t\t\tif (invokeSbbRolledBack && sbbEntity == null) {\n \t\t\t\t\t\t// We do it in this tx\n \t\t\t\t\t\thandleSbbRollback.handleSbbRolledBack(null, sbbObject, null, null, invokerClassLoader, false, txMgr);\n \t\t\t\t\t} else if (sbbEntity != null && !txMgr.getRollbackOnly()\n \t\t\t\t\t\t\t&& sbbEntity.getSbbObject() != null) {\n \n \t\t\t\t\t\tsbbObject.sbbStore();\n \t\t\t\t\t\tsbbEntity.passivateAndReleaseSbbObject();\n \n \t\t\t\t\t}\n \n \t\t\t\t\tif (txMgr.getRollbackOnly()) {\n \t\t\t\t\t\tif (logger.isDebugEnabled()) {\n \t\t\t\t\t\t\tlogger\n \t\t\t\t\t\t\t\t\t.debug(\"Rolling back SLEE Originated Invocation Sequence\");\n \t\t\t\t\t\t}\n \t\t\t\t\t\ttxMgr.rollback();\n \t\t\t\t\t} else {\n \t\t\t\t\t\tif (logger.isDebugEnabled()) {\n \t\t\t\t\t\t\tlogger\n \t\t\t\t\t\t\t\t\t.debug(\"Committing SLEE Originated Invocation Sequence\");\n \t\t\t\t\t\t}\n \t\t\t\t\t\ttxMgr.commit();\n \t\t\t\t\t}\n \n \t\t\t\t\t/*\n \t\t\t\t\t * Now we invoke sbbRolledBack for each SLEE originated\n \t\t\t\t\t * invocation that had a target sbb entity in a new tx - the\n \t\t\t\t\t * new tx creating is handled inside the handleSbbRolledBack\n \t\t\t\t\t * method\n \t\t\t\t\t */\n \t\t\t\t\tif (invokeSbbRolledBack && sbbEntity != null) {\n \t\t\t\t\t\t// Firstly for the \"Op only\" or \"Op and Remove\" part\n \t\t\t\t\t\tsbbEntity.getSbbEntityId();\n \t\t\t\t\t\tif (logger.isDebugEnabled()) {\n \t\t\t\t\t\t\tlogger\n \t\t\t\t\t\t\t\t\t.debug(\"Invoking sbbRolledBack for Op Only or Op and Remove\");\n \n \t\t\t\t\t\t}\n \t\t\t\t\t\t//FIXME: baranowb: de is passed for test: tests/sbb/abstractclass/SbbRolledBackNewTransaction.xml\n \t\t\t\t\t\thandleSbbRollback.handleSbbRolledBack(sbbEntity, null, de, new ActivityContextInterfaceImpl(ac), invokerClassLoader, false, txMgr);\n \t\t\t\t\t}\n \t\t\t\t\tif (invokeSbbRolledBackRemove) {\n \t\t\t\t\t\t// Now for the \"Remove Only\" if appropriate\n \t\t\t\t\t\thandleSbbRollback.handleSbbRolledBack(rootSbbEntity, null, null, null, rootInvokerClassLoader, true, txMgr);\t\t\t\t\t\t\n \t\t\t\t\t}\n \n \t\t\t\t\t/*\n \t\t\t\t\t * A note on exception handling here- Any exceptions thrown\n \t\t\t\t\t * further further up that need to be caught in order to\n \t\t\t\t\t * handle rollback or otherwise maintain consistency of the\n \t\t\t\t\t * SLEE state are all handled further up I.e. We *do not*\n \t\t\t\t\t * need to call rollback here. So any exceptions that get\n \t\t\t\t\t * here do not result in the SLEE being in an inconsistent\n \t\t\t\t\t * state, therefore we just log them and carry on.\n \t\t\t\t\t */\n \n \t\t\t\t\trollbackTx = false;\n \t\t\t\t} catch (RuntimeException e) {\n \t\t\t\t\tlogger.error(\n \t\t\t\t\t\t\t\"Unhandled RuntimeException in event router: \", e);\n \t\t\t\t} catch (Exception e) {\n \t\t\t\t\tlogger.error(\"Unhandled Exception in event router: \", e);\n \t\t\t\t} catch (Error e) {\n \t\t\t\t\tlogger.error(\"Unhandled Error in event router: \", e);\n \t\t\t\t\tthrow e; // Always rethrow errors\n \t\t\t\t} catch (Throwable t) {\n \t\t\t\t\tlogger.error(\"Unhandled Throwable in event router: \", t);\n \t\t\t\t} finally {\n \t\t\t\t\ttry {\n \t\t\t\t\t\tif (txMgr.getTransaction() != null) {\n \t\t\t\t\t\t\tif (rollbackTx) {\n \t\t\t\t\t\t\t\tlogger\n \t\t\t\t\t\t\t\t\t\t.error(\"Rolling back tx in routeTheEvent.\");\n \t\t\t\t\t\t\t\ttxMgr.rollback();\n \t\t\t\t\t\t\t} else {\n \t\t\t\t\t\t\t\tlogger\n \t\t\t\t\t\t\t\t\t\t.error(\"Transaction left open in routeTheEvent! It has to be pinned down and fixed! Debug information follows.\");\n \t\t\t\t\t\t\t\tlogger.error(txMgr\n \t\t\t\t\t\t\t\t\t\t.displayOngoingSleeTransactions());\n \t\t\t\t\t\t\t\ttxMgr.commit();\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t}\n \t\t\t\t\t} catch (SystemException se) {\n \n \t\t\t\t\t\tlogger.error(\"Failure in TX operation\", se);\n \t\t\t\t\t}\n \t\t\t\t\tif (sbbEntity != null) {\n \t\t\t\t\t\tif (logger.isDebugEnabled()) {\n \t\t\t\t\t\t\tlogger\n \t\t\t\t\t\t\t\t\t.debug(\"Finished delivering the event \"\n \t\t\t\t\t\t\t\t\t\t\t+ de.getEventTypeId()\n \t\t\t\t\t\t\t\t\t\t\t+ \" to the sbbEntity = \"\n \t\t\t\t\t\t\t\t\t\t\t+ sbbEntity.getSbbEntityId()\n \t\t\t\t\t\t\t\t\t\t\t+ \"]]] \\n\\n\\n\");\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tEventRouterThreadLocals.setInvokingService(null);\n \t\t\t\t\n \t\t\t\tif (eventContextImpl.isSuspendedNotTransacted()) {\n \t\t\t\t\tif (logger.isDebugEnabled())\n \t\t\t\t\t\tlogger.debug(\"\\n\\n\\nSuspended event delivery : [[[ eventId \"\n \t\t\t\t\t\t\t+ de.getEventTypeId() + \" on ac \"+de.getActivityContextId()+\"\\n\");\n \t\t\t\t\treturn;\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// need to ensure gotSbb = false if and only if iter.hasNext()\n \t\t\t\t// == false\n \t\t\t} while (gotSbb);\n \n \t\t\t\n \t\t\t/*\n \t\t\t * End of SLEE Originated Invocation Sequence\n \t\t\t * ==========================================\n \t\t\t * \n \t\t\t */\n \n \t\t\tif (de.getEventTypeId().equals(ActivityEndEventImpl.EVENT_TYPE_ID)) {\n \t\t\t\tactivityEndEventPostProcessor.process(de.getActivityContextId(), txMgr, this.container.getActivityContextFactory());\n \t\t\t} else if (de.getEventTypeId().equals(TimerEventImpl.EVENT_TYPE_ID)) {\n \t\t\t\ttimerEventPostProcessor.process(de,this.container.getTimerFacility());\n\t\t\t}\t\t\t\n \n \t\t\t// we got to the end of the event routing, remove the event context\n \t\t\tde.getEventRouterActivity().setCurrentEventContext(null);\n \t\t\t// manage event references\n \t\t\tDeferredEventReferencesManagement eventReferencesManagement = container.getEventRouter().getDeferredEventReferencesManagement();\n \t\t\teventReferencesManagement.eventUnreferencedByActivity(de.getEvent(), de.getActivityContextId());\n \t\t\t\n \t\t} catch (Exception e) {\n \t\t\tlogger.error(\"Unhandled Exception in event router top try\", e);\n \t\t}\n \t}", "private void eventSimulation() {\n Long minTimestamp;\n EventGenerator generator;\n int eventsRemaining = simulationProperties.getNoOfEventsRequired();\n try {\n while (!isStopped) {\n// if the simulator is paused, wait till it is resumed\n synchronized (this) {\n while (isPaused) {\n wait();\n }\n }\n /**\n * if there is no limit to the number of events to be sent or is the number of event remaining to be\n * sent is > 0, send an event, else stop event simulation\n * */\n if (eventsRemaining == -1 || eventsRemaining > 0) {\n minTimestamp = -1L;\n generator = null;\n /**\n * 1. for each event generator peek the next event (i.e. the next event with least timestamp)\n * 2. take the first event generator will a not null nextEvent as the first refferal value for\n * generator with minimum timestamp event, and take the events timestamp as the minimum timestamp\n * refferal value\n * 3. then compare the timestamp of the remaining not null nextEvents with the minimum timestamp and\n * update the minimum timestamp refferal value accordingly.\n * 4. once all generators are iterated and the event with minimum timestamp if obtained, send event.\n * 5. if all generators has nextEvent == null, then stop event simulation\n * */\n for (EventGenerator eventGenerator : generators) {\n if (eventGenerator.peek() != null) {\n if (minTimestamp == -1L) {\n minTimestamp = eventGenerator.peek().getTimestamp();\n generator = eventGenerator;\n } else if (eventGenerator.peek().getTimestamp() < minTimestamp) {\n minTimestamp = eventGenerator.peek().getTimestamp();\n generator = eventGenerator;\n }\n }\n }\n if (minTimestamp >= 0L && generator != null) {\n log.info(\"Input Event (\" + uuid + \") : \"\n + Arrays.deepToString(generator.peek().getData()));\n EventSimulatorDataHolder.getInstance().getEventStreamService()\n .pushEvent(generator.getExecutionPlanName(), generator.getStreamName(),\n generator.poll());\n } else {\n break;\n }\n if (eventsRemaining > 0) {\n eventsRemaining--;\n }\n Thread.sleep(simulationProperties.getTimeInterval());\n } else {\n break;\n }\n }\n stop();\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n } catch (EventGenerationException e) {\n /**\n * catch exception so that any resources opened could be closed and rethrow an exception indicating which\n * simulation failed\n * */\n stop();\n throw new EventGenerationException(\"Error occurred when generating an event for simulation '\" +\n simulationProperties.getSimulationName() + \"'. \", e);\n }\n }", "@Test\n\tpublic final void testMessageQueueFlushTest() {\n\t\tfinal int count = 10000;\n\t\tIMessageSourceProvider source = new MessageSourceProvider();\n\t\tIMessengerPacket[] batch = new IMessengerPacket[count];\n\t\tfor (int i = 0; i < count; i++) {\n\t\t\tbatch[i] =Log.makeLogPacket(LogMessageSeverity.VERBOSE, \"GibraltarTest\",\n\t\t\t\t\t\"Test.Core.LogMessage.Performance.Flush\", source, null, null, null, null, null, \"Batch message #%s of %s\", i, count);\n\t\t}\n\n\t\tLog.write(LogMessageSeverity.INFORMATION, LogWriteMode.WAIT_FOR_COMMIT, null, \"Unit Tests\",\n\t\t\t\t\"Clearing message queue\", null);\n\n\t\tOffsetDateTime startWrite = OffsetDateTime.now();\n\n\t\tLog.write(batch, LogWriteMode.QUEUED);\n\n\t\tOffsetDateTime startFlush = OffsetDateTime.now();\n\n\t\tLog.write(LogMessageSeverity.INFORMATION, LogWriteMode.WAIT_FOR_COMMIT, null, \"Unit Tests\",\n\t\t\t\t\"Message batch flushed\", \"All %s messages have been flushed.\", count);\n\n\t\tOffsetDateTime endFlush = OffsetDateTime.now();\n\n\t\tDuration writeDuration = Duration.between(startWrite, startFlush);\n\t\tDuration flushDuration = Duration.between(startFlush, endFlush);\n\n\t\tLog.write(LogMessageSeverity.VERBOSE, \"\", \"Unit test messageQueueFlushTest()\",\n\t\t\t\t\"Write of {0:N0} messages to queue took {1:F3} ms and flush took {2:F3} ms.\", count,\n\t\t\t\twriteDuration.toMillis(), flushDuration.toMillis());\n\n\t\tfor (int i = 0; i < count; i++) {\n\t\t\tbatch[i] = Log.makeLogPacket(LogMessageSeverity.VERBOSE, \"GibraltarTest\",\n\t\t\t\t\t\"Test.Core.LogMessage.Performance.Flush\", source, null, null, null, null, null,\n\t\t\t\t\t\"Batch message #%s of %s\", i, count);\n\t\t}\n\n\t\tOffsetDateTime startWriteThrough = OffsetDateTime.now();\n\n\t\tLog.write(batch, LogWriteMode.WAIT_FOR_COMMIT);\n\n\t\tOffsetDateTime endWriteThrough = OffsetDateTime.now();\n\n\t\tDuration writeThroughDuration = Duration.between(startWriteThrough, endWriteThrough);\n\n\t\tLog.write(LogMessageSeverity.VERBOSE, \"\", \"Unit test messageQueueFlushTest()\",\n\t\t\t\t\"Write of {0:N0} messages as WaitForCommit took {1:F3} ms.\", count, writeThroughDuration.toMillis());\n\n\t}", "@Test\n public void dispatchToSingleObjectAndSubscriberMethods() {\n BaseEventBus eventBus = new SynchronousEventBus(LOG);\n\n final List<String> object1Received = new ArrayList<>();\n Object object1 = new Object() {\n @Subscriber\n public void onStringEvent(String event) {\n object1Received.add(event);\n }\n };\n\n final List<Integer> object2Received = new ArrayList<>();\n Object object2 = new Object() {\n @Subscriber\n public void onIntEvent(Integer event) {\n object2Received.add(event);\n }\n };\n\n eventBus.register(object1);\n eventBus.register(object2);\n\n eventBus.post(\"event 1\");\n eventBus.post(\"event 2\");\n\n // only object1 should receive all items\n assertThat(object1Received, is(asList(\"event 1\", \"event 2\")));\n assertThat(object2Received, is(emptyList()));\n\n eventBus.post(1);\n\n assertThat(object1Received, is(asList(\"event 1\", \"event 2\")));\n assertThat(object2Received, is(asList(1)));\n\n }", "private void startAggTradesEventStreaming(String symbol) {\r\n\t\tBinanceApiClientFactory factory = BinanceApiClientFactory.newInstance();\r\n\t\tBinanceApiWebSocketClient client = factory.newWebSocketClient();\r\n\r\n\t\t/*\r\n\t\t * static void startAggTradeEventListener(BinanceApiClientFactory factory,\r\n\t\t * String symbol, ExchangeApiCallback<AggTradeEvent> callback) {\r\n\t\t * BinanceApiWebSocketClient client = factory.newWebSocketClient();\r\n\t\t * client.onAggTradeEvent(symbol, (AggTradeEvent event) -> { if (event == null)\r\n\t\t * { startAggTradeEventListener(factory, symbol, callback); } else {\r\n\t\t * callback.onResponse(event); } }); }\r\n\t\t */\r\n\r\n\t\tclient.onAggTradeEvent(symbol.toLowerCase(), response -> {\r\n\r\n\t\t\tif (response == null) {\r\n\t\t\t\tstartAggTradesEventStreaming(symbol);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tLong aggregatedTradeId = response.getAggregatedTradeId();\r\n\t\t\tAggTrade updateAggTrade = aggTradesCache.get(aggregatedTradeId);\r\n\t\t\tif (updateAggTrade == null) {\r\n\t\t\t\t// new agg trade\r\n\t\t\t\tupdateAggTrade = new AggTrade();\r\n\t\t\t}\r\n\r\n\t\t\t/*\r\n\t\t\t * Duration tickDuration = Duration.ofSeconds(1); Long tickIndex = new\r\n\t\t\t * Long(this.aggTradeTicksCashe.size()); List<AggTrade> listAggTrade = null;\r\n\t\t\t * \r\n\t\t\t * if (aggTradeTicksCashe.isEmpty()) { listAggTrade = new\r\n\t\t\t * CopyOnWriteArrayList<AggTrade>(); aggTradeTicksCashe.put( tickIndex,\r\n\t\t\t * listAggTrade ); } else { listAggTrade =\r\n\t\t\t * this.aggTradeTicksCashe.get(tickIndex); }\r\n\t\t\t * \r\n\t\t\t * ZonedDateTime tradeTimestamp =\r\n\t\t\t * ZonedDateTime.ofInstant(Instant.ofEpochMilli(updateAggTrade.getTradeTime()),\r\n\t\t\t * ZoneId.systemDefault()); ZonedDateTime tickEndTime =\r\n\t\t\t * tradeTimestamp.plus(tickDuration);\r\n\t\t\t * \r\n\t\t\t * if (!tradeTimestamp.isBefore(tickEndTime)) { // new tick ++tickIndex;\r\n\t\t\t * listAggTrade = new CopyOnWriteArrayList<AggTrade>(); aggTradeTicksCashe.put(\r\n\t\t\t * tickIndex, listAggTrade ); } // Store the updated agg trade in the current\r\n\t\t\t * tick cache listAggTrade.add(updateAggTrade);\r\n\t\t\t */\r\n\r\n\t\t\t/*\r\n\t\t\t * List<Tick> ticks = null; Long tickIndex = 0L; List<AggTrade> listAggTrade =\r\n\t\t\t * new CopyOnWriteArrayList<AggTrade>(); this.aggTradeTicksCashe = new\r\n\t\t\t * HashMap<Long, List<AggTrade>>();\r\n\t\t\t */\r\n\r\n\t\t\tupdateAggTrade.setTradeTime(response.getEventTime());\r\n\t\t\tupdateAggTrade.setAggregatedTradeId(aggregatedTradeId);\r\n\t\t\tupdateAggTrade.setPrice(response.getPrice());\r\n\t\t\tupdateAggTrade.setQuantity(response.getQuantity());\r\n\t\t\tupdateAggTrade.setFirstBreakdownTradeId(response.getFirstBreakdownTradeId());\r\n\t\t\tupdateAggTrade.setLastBreakdownTradeId(response.getLastBreakdownTradeId());\r\n\t\t\tupdateAggTrade.setBuyerMaker(response.isBuyerMaker());\r\n\r\n\t\t\t// Store the updated agg trade in the cache\r\n\t\t\taggTradesCache.put(aggregatedTradeId, updateAggTrade);\r\n\r\n\t\t\t/*\r\n\t\t\t * Build ticks and Series\r\n\t\t\t */\r\n\r\n\t\t\tLong trendAnalysisTimeFrame = 5L; // perform a trend analysis using last 5 seconds time frame\r\n\r\n\t\t\tZonedDateTime tickEndTime = ZonedDateTime.ofInstant(Instant.ofEpochMilli(response.getEventTime()), // lastTradeEventTime\r\n\t\t\t\t\tZoneId.systemDefault());\r\n\t\t\tZonedDateTime tickStartTime = tickEndTime.minusSeconds(trendAnalysisTimeFrame);\r\n\t\t\t/*\r\n\t\t\t * ZonedDateTime tickStartTime = ZonedDateTime.now(ZoneId.systemDefault());\r\n\t\t\t * ZonedDateTime tickEndTime = tickStartTime; Iterator<Long>\r\n\t\t\t * aggTradesCacheIterator = aggTradesCache.keySet().iterator(); while\r\n\t\t\t * (aggTradesCacheIterator.hasNext()) { AggTrade aggTrade =\r\n\t\t\t * aggTradesCache.get(aggTradesCacheIterator.next()); ZonedDateTime\r\n\t\t\t * tradeTimestamp =\r\n\t\t\t * ZonedDateTime.ofInstant(Instant.ofEpochMilli(aggTrade.getTradeTime()),ZoneId.\r\n\t\t\t * systemDefault()); if ( tradeTimestamp.isBefore(tickStartTime)) tickStartTime\r\n\t\t\t * = tradeTimestamp; if ( tradeTimestamp.isAfter(tickEndTime)) tickEndTime =\r\n\t\t\t * tradeTimestamp; }\r\n\t\t\t */\r\n\r\n\t\t\t/*\r\n\t\t\t * // Building the empty ticks List<Tick> ticks = buildEmptyTicks(tickStartTime,\r\n\t\t\t * tickEndTime);\r\n\t\t\t * \r\n\t\t\t * Iterator<Long> aggTradesCacheIterator = aggTradesCache.keySet().iterator();\r\n\t\t\t * while (aggTradesCacheIterator.hasNext()) { AggTrade aggTrade =\r\n\t\t\t * aggTradesCache.get(aggTradesCacheIterator.next()); ZonedDateTime tradeTime =\r\n\t\t\t * ZonedDateTime.ofInstant(Instant.ofEpochMilli(aggTrade.getTradeTime()),\r\n\t\t\t * ZoneId.systemDefault());\r\n\t\t\t * \r\n\t\t\t * if ( tradeTime.isAfter(tickStartTime) && tradeTime.isBefore(tickEndTime)) {\r\n\t\t\t * // Filling the ticks with trades for (Tick tick : ticks) { if\r\n\t\t\t * (tick.inPeriod(tradeTime)) { Double price = new Double(aggTrade.getPrice());\r\n\t\t\t * Double quantity = new Double(aggTrade.getQuantity()); Double amount = price *\r\n\t\t\t * quantity; tick.addTrade( amount, price); } } } } // Removing still empty\r\n\t\t\t * ticks removeEmptyTicks(ticks);\r\n\t\t\t * \r\n\t\t\t * // Build time series TimeSeries series = new BaseTimeSeries(symbol, ticks);\r\n\t\t\t */\r\n\r\n\t\t\t/*\r\n\t\t\t * if( realTimeChart != null ) { List<Integer> xData = new\r\n\t\t\t * CopyOnWriteArrayList<Integer>(); List<Double> yData = new\r\n\t\t\t * CopyOnWriteArrayList<Double>(); List<Double> errorBars = new\r\n\t\t\t * CopyOnWriteArrayList<Double>();\r\n\t\t\t * \r\n\t\t\t * for( int x: realTimeChart.getxData() ) { xData.add(x); } for( double y:\r\n\t\t\t * realTimeChart.getyData() ) { yData.add(y); } for( double e:\r\n\t\t\t * realTimeChart.getErrorBars() ) { errorBars.add(e); }\r\n\t\t\t * //xData.add(xData.size()+1); xData.add(50); xData.remove(0); yData.add(new\r\n\t\t\t * Double(response.getPrice())); yData.remove(0); //errorBars.add(0.0);\r\n\t\t\t * //errorBars.remove(0);\r\n\t\t\t * \r\n\t\t\t * realTimeChart.updateData(xData, yData, errorBars); }\r\n\t\t\t */\r\n\r\n\t\t\t/*\r\n\t\t\t * Log AggTrade into database\r\n\t\t\t */\r\n\t\t\tstoreAggTradeCache(symbol, updateAggTrade);\r\n\t\t\t// System.out.println(updateAggTrade);\r\n\t\t});\r\n\t}", "private Mono<IndexBatchResponse> sendBatch(\n List<com.azure.search.documents.implementation.models.IndexAction> actions,\n List<TryTrackingIndexAction<T>> batchActions,\n Context context) {\n LOGGER.verbose(\"Sending a batch of size {}.\", batchActions.size());\n\n if (onActionSentConsumer != null) {\n batchActions.forEach(action -> onActionSentConsumer.accept(new OnActionSentOptions<>(action.getAction())));\n }\n\n Mono<Response<IndexDocumentsResult>> batchCall = Utility.indexDocumentsWithResponseAsync(restClient, actions, true,\n context, LOGGER);\n\n if (!currentRetryDelay.isZero() && !currentRetryDelay.isNegative()) {\n batchCall = batchCall.delaySubscription(currentRetryDelay);\n }\n\n return batchCall.map(response -> new IndexBatchResponse(response.getStatusCode(),\n response.getValue().getResults(), actions.size(), false))\n .doOnCancel(() -> {\n LOGGER.warning(\"Request was cancelled before response, adding all in-flight documents back to queue.\");\n inFlightActions.addAll(batchActions);\n })\n // Handles mixed success responses.\n .onErrorResume(IndexBatchException.class, exception -> Mono.just(\n new IndexBatchResponse(207, exception.getIndexingResults(), actions.size(), true)))\n .onErrorResume(HttpResponseException.class, exception -> {\n /*\n * If we received an error response where the payload was too large split it into two smaller payloads\n * and attempt to index again. If the number of index actions was one raise the error as we cannot split\n * that any further.\n */\n int statusCode = exception.getResponse().getStatusCode();\n if (statusCode == HttpURLConnection.HTTP_ENTITY_TOO_LARGE) {\n /*\n * Pass both the sent batch size and the configured batch size. This covers that case where the\n * sent batch size was smaller than the configured batch size and a 413 was trigger.\n *\n * For example, by default the configured batch size defaults to 512 but a batch of 200 may be sent\n * and trigger 413, if we only halved 512 we'd send the same batch again and 413 a second time.\n * Instead in this scenario we should halve 200 to 100.\n */\n int previousBatchSize = Math.min(batchActionCount, actions.size());\n this.batchActionCount = Math.max(1, scaleDownFunction.apply(previousBatchSize));\n\n LOGGER.verbose(BATCH_SIZE_SCALED_DOWN, System.lineSeparator(), previousBatchSize, batchActionCount);\n\n int actionCount = actions.size();\n if (actionCount == 1) {\n return Mono.just(new IndexBatchResponse(statusCode, null, actionCount, true));\n }\n\n int splitOffset = Math.min(actions.size(), batchActionCount);\n List<TryTrackingIndexAction<T>> batchActionsToRemove = batchActions.subList(splitOffset,\n batchActions.size());\n reinsertFailedActions(batchActionsToRemove);\n batchActionsToRemove.clear();\n\n return sendBatch(actions.subList(0, splitOffset), batchActions, context);\n }\n\n return Mono.just(new IndexBatchResponse(statusCode, null, actions.size(), true));\n })\n // General catch all to allow operation to continue.\n .onErrorResume(Exception.class, ignored ->\n Mono.just(new IndexBatchResponse(0, null, actions.size(), true)));\n }", "private void sendPackets(String _nh)\n\t{\n\t\tsynchronized(outQueue)\n\t\t{\n\t\t\tint sentNumber = 0;\n\t\t\t// fill outQueue\n\t\t\tif(outQueue.size() < Constants.RTP_CREDIT_MAX)\n\t\t\t{\n\t\t\t\t/***\n\t\t\t\t * This line can return any number of packets...\n\t\t\t\t * \t - 50 or less if\n\t\t\t\t * \t - more than 50 when there are all packets from the same frame\n\t\t\t\t */\n\t\t\t\tint pleft = Constants.RTP_CREDIT_MAX-outQueue.size();\n//\t\t\t\tint qSizeb = outQueue.size();\n//\t\t\t\tlong begin = System.currentTimeMillis();\n\t\t\t\toutQueue.addAll(streamStore.schedulePackets(pleft, Constants.RTP_ORDERING_MODE));\n//\t\t\t\tlong end = System.currentTimeMillis();\n//\t\t\t\tint qSizee = outQueue.size();\n//\t\t\t\tDebugger.dumpMsg(this, \"Schedule \"+pleft+\"/\"+(qSizee-qSizeb)+\" packets time: \"+(end-begin), Debugger.RTP);\n\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\tIterator<Long> iterator = outQueue.iterator();\n\t\t\twhile(iterator.hasNext() && sentNumber < Constants.RTP_CREDIT_MAX)\n\t\t\t{\n\t\t\t\tLong p = (Long) iterator.next();\n\t\t\t\tif(send(_nh, p)) // successfully sent\n\t\t\t\t{\n\t\t\t\t\tsentNumber++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t// select packets from the stream\n\t\t\t\t// for those not already sent\n\t\t\n\t\t\tDebugger.dumpMsg(this, \"Sent \"+sentNumber+\"/\"+outQueue.size()+\"/\"+streamStore.getNumberOfPacketsStored()+\"/\"+streamStore.getNumberOfPacketsToSchedule()+\" packets to \"+_nh, Debugger.RTP);\n\t\t\t\n\t\t\tif(sentNumber > 0)\n\t\t\t{\n\t\t\t\t// send SR\n\t\t\t\tsendSR(_nh, currentRequestId++);\n\t\t\t}\n\t\t}\n\t}", "public synchronized void pushEvents(Event[] events) {\r\n\r\n\t\tif (null == events) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tfor (Event event : events) {\r\n\t\t\tif (!this.events.containsKey(event.getTime())) {\r\n\t\t\t\tthis.events.put(new Long(event.getTime()), new ArrayList<Event>());\r\n\t\t\t}\r\n\t\t\tthis.events.get(event.getTime()).add(event);\r\n\t\t}\r\n\t}", "public void processEvents(Events events) {\n\n log.info(\"events processed: [{}]\", events.toString());\n }", "private void push() {\n ImmutableSortedSet<T> myAvailable = _outstanding.apply(\n new Syncd.Transformer<ImmutableSortedSet<T>, ImmutableSortedSet<T>>() {\n public Tuple<ImmutableSortedSet<T>, ImmutableSortedSet<T>> apply(ImmutableSortedSet<T> aBefore) {\n final SortedSet<T> myRemaining = new TreeSet<>(new MessageComparator<T>());\n\n // Identify those messages that are sequentially contiguous from _floor and can be passed on\n //\n ImmutableSortedSet<T> myAccessible =\n new ImmutableSortedSet.Builder<>(new MessageComparator<T>()).addAll(\n Iterables.filter(aBefore, new Predicate<T>() {\n public boolean apply(T aMessage) {\n Long myCurrent = _floor.get();\n\n if (aMessage.getSeq() == myCurrent) {\n // This message can be sent out to listeners so long as we're first to try\n //\n if (_floor.testAndSet(myCurrent, myCurrent + 1))\n return true;\n } else\n // This message must remain\n //\n myRemaining.add(aMessage);\n\n // Couldn't send message out or it must remain\n //\n return false;\n }\n })\n ).build();\n\n return new Tuple<>(new ImmutableSortedSet.Builder<>(\n new MessageComparator<T>()).addAll(myRemaining).build(),\n myAccessible);\n }\n }\n );\n\n send(myAvailable);\n archive(myAvailable);\n }", "protected final void send(Event event) {\n logger.debug(\"new event: {}\", event);\n Stats.received.incrementAndGet();\n if(! outQueue.offer(event)) {\n Stats.dropped.incrementAndGet();\n logger.error(\"send failed for {}, destination blocked\", event);\n }\n }", "private void sendPayloads(int numPayloads) {\n\t\tfor (int i = 0; i < numPayloads; i++) {\n\t\t\tint destination = rand.nextInt(allNodes.length);\n\t\t\twhile (allNodes[destination] == myAssignedID) {\n\t\t\t\tdestination = rand.nextInt(allNodes.length);\n\t\t\t}\n\t\t\tint payload = rand.nextInt();\n\t\t\tthis.sendSummation += payload;\n\t\t\tint[] traceField = { myAssignedID };\n\t\t\tOverlayNodeSendsData dataPacket = new OverlayNodeSendsData(\n\t\t\t\t\tallNodes[destination], myAssignedID, payload, 1, traceField);\n\t\t\ttry {\n\t\t\t\tnodesToSendTo.getConnections()\n\t\t\t\t\t\t.get(relayPayloadDestination(dataPacket)).getSender()\n\t\t\t\t\t\t.sendData(dataPacket.getBytes());\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.out.println(e.getMessage()\n\t\t\t\t\t\t+ \" trouble sending packet to first hop\");\n\t\t\t}\n\t\t\tthis.sendTracker++;\n\t\t}\n\t\ttry {\n\t\t\tregistry.getSender().sendData(\n\t\t\t\t\tnew OverlayNodeReportsTaskFinished(myIPAddress,\n\t\t\t\t\t\t\tincomingMsgNodes.getPort(), myAssignedID)\n\t\t\t\t\t\t\t.getBytes());\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(e.getMessage()\n\t\t\t\t\t+ \" trouble reporting task finished.\");\n\t\t}\n\t}", "private synchronized void send(boolean force) {\n if ((force || shouldSendNow()) && !sendBatch()) {\n getLog().warn(\"Send failed, {} message to send.\", fPending.size());\n // note the time for back-off\n fDontSendUntilMs = SF_WAIT_AFTER_ERROR + Clock.now();\n }\n }", "private void startQueuedItemsSender() {\n if (ctrlSenderTimerRunning)\n return;\n\n ctrlSenderTimer = new Timer(true);\n ctrlSenderTimer.schedule(new TimerTask() {\n @Override\n public void run() {\n JSONObject item = dataSource.getNextTxClient2Server();\n Log.i(TAG, \"Client2Server sender executed, assembling JSON and sending to Server...\");\n\n try {\n // no more? stop timer\n if (!item.has(\"moreInQueue\") || !item.getBoolean(\"moreInQueue\")) {\n stopQueuedItemsSender();\n }\n\n if (!item.getBoolean(\"fetched\")) {\n Log.w(TAG, \" ...warning, nothing fetched from BD!\");\n stopQueuedItemsSender();\n return;\n }\n\n CtrlMessage msg = new CtrlMessage(item.getString(\"jsonPackage\"));\n msg.setTXsender(item.getInt(\"TXclient\"));\n\n sendSocket(msg.buildMessage());\n }\n catch (JSONException e) {\n e.printStackTrace();\n }\n }\n }, 15, 85);\n ctrlSenderTimerRunning = true;\n }", "@Test\n public void startedSenderReceivingEventsWhileStartingShouldDrainQueues()\n throws Exception {\n Integer lnPort = vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(2));\n Integer nyPort = vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(1, lnPort));\n\n createCacheInVMs(lnPort, vm2, vm4);\n createReceiverInVMs(vm2, vm4);\n createCacheInVMs(nyPort, vm3, vm5);\n createReceiverInVMs(vm3, vm5);\n\n vm2.invoke(() -> WANTestBase.createSender(\"ny\", 1, true, 100, 10, false, false, null, true));\n vm4.invoke(() -> WANTestBase.createSender(\"ny\", 1, true, 100, 10, false, false, null, true));\n\n vm3.invoke(() -> WANTestBase.createSender(\"ln\", 2, true, 100, 10, false, false, null, true));\n vm5.invoke(() -> WANTestBase.createSender(\"ln\", 2, true, 100, 10, false, false, null, true));\n\n vm2.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ny\", 1, 100,\n isOffHeap()));\n vm4.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ny\", 1, 100,\n isOffHeap()));\n\n vm3.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ln\", 1, 100,\n isOffHeap()));\n vm5.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ln\", 1, 100,\n isOffHeap()));\n\n AsyncInvocation<Void> inv =\n vm2.invokeAsync(() -> WANTestBase.doPuts(getTestMethodName() + \"_PR\", 1000));\n startSenderInVMsAsync(\"ny\", vm2, vm4);\n inv.await();\n\n vm2.invoke(() -> WANTestBase.verifyTmpDroppedEventSize(\"ny\", 0));\n vm4.invoke(() -> WANTestBase.verifyTmpDroppedEventSize(\"ny\", 0));\n\n vm2.invoke(() -> WANTestBase.validateParallelSenderQueueAllBucketsDrained(\"ny\"));\n vm4.invoke(() -> WANTestBase.validateParallelSenderQueueAllBucketsDrained(\"ny\"));\n }", "@Override\n\tpublic void publishMessage(QPEvent event) {\n\t\tfor(final String endpoint : webhookRegistry.all()) {\n\t\t\tlog.debug(\"POSTing event to {}\", endpoint);\n\t\t\t\n\t\t\ttry {\n\t\t\t\tCloseableHttpAsyncClient httpClient = HttpAsyncClients.createDefault();\n\t\t\t\thttpClient.start();\n\t\t\t\t\n\t\t\t\tHttpPost post = new HttpPost(endpoint);\n\t\t\t\tpost.setHeader(\"Content-Type\", \"application/json\");\n\t\t\t\tpost.setEntity(new StringEntity(objectMapper.writeValueAsString(event), \"UTF-8\"));\n\t\t\t\t\n\t\t\t\thttpClient.execute(post, new FutureCallback<HttpResponse>() {\n\t\t\t\t\t\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void failed(Exception ex) {\n\t\t\t\t\t\tlog.warn(\"Request for endpoint {} failed, removing endpoint\", endpoint);\n\t\t\t\t\t\twebhookRegistry.remove(endpoint);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void completed(HttpResponse result) {\n\t\t\t\t\t\tlog.debug(\"Request for endpoint {} completed\", endpoint);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void cancelled() {\n\t\t\t\t\t\tlog.debug(\"Request for endpoint {} cancelled\", endpoint);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} catch(Exception x) {\n\t\t\t\tlog.error(\"Error handling event.\", x);\n\t\t\t}\n\t\t}\n\t}", "private Event send(final Event event2send, final boolean watchLimitOnUnit) {\n Customer customer = event2send.getCustomer();\n Unit unit = customer.getUnit();\n // workaround for a strange behavior of ODB v1.7.9\n // ^^ sometimes the unit is null\n // ^^ after that, procedure of last sent event is stored with unit==null !!\n if (null == unit) {\n LOG.warning(\"BUG23, unit on customer is NULL, reload of customer with id=\" + customer.getId());\n customer = customerDao.getById(customer.getId());\n unit = unitDao.getById(customer.getUnit().getId());\n //customer.setUnit(unit);\n }\n // end of workaround\n assertLimitedUnit(unit);\n\n final String text2send = format(event2send);\n\n // SMS\n boolean smsOk = false;\n if ((customer.getSendingChannel() & Event.CHANNEL_SMS) > 0) {\n smsOk = sendSms(event2send);\n }\n\n // EMAIL\n boolean emailOk = false;\n if ((customer.getSendingChannel() & Event.CHANNEL_EMAIL) > 0) {\n emailOk = sendEmail(event2send);\n }\n\n LOG.info(\"event to be sent, id=\" + event2send.getId() + \", smsOk=\" + smsOk + \", emailOk=\" + emailOk\n + \", text=\" + text2send);\n if (smsOk || emailOk) {\n event2send.setSent(new Date());\n if (watchLimitOnUnit) {\n decreaseLimitedMessages(unit);\n }\n }\n event2send.setSendAttemptCount(event2send.getSendAttemptCount() + 1);\n\n return eventDao.persist(event2send);\n }", "public void flush() {\n // all getAndSet will not be synchronous but it's ok since metrics will\n // be spread out among processor worker and we flush every 5s by\n // default\n\n processor.send(new TelemetryMessage(this.metricsSentMetric, this.metricsSent.getAndSet(0), tags));\n processor.send(new TelemetryMessage(this.eventsSentMetric, this.eventsSent.getAndSet(0), tags));\n processor.send(new TelemetryMessage(this.serviceChecksSentMetric, this.serviceChecksSent.getAndSet(0), tags));\n processor.send(new TelemetryMessage(this.bytesSentMetric, this.bytesSent.getAndSet(0), tags));\n processor.send(new TelemetryMessage(this.bytesDroppedMetric, this.bytesDropped.getAndSet(0), tags));\n processor.send(new TelemetryMessage(this.packetsSentMetric, this.packetsSent.getAndSet(0), tags));\n processor.send(new TelemetryMessage(this.packetsDroppedMetric, this.packetsDropped.getAndSet(0), tags));\n processor.send(new TelemetryMessage(this.packetsDroppedQueueMetric, this.packetsDroppedQueue.getAndSet(0), tags));\n processor.send(new TelemetryMessage(this.aggregatedContextsMetric, this.aggregatedContexts.getAndSet(0), tags));\n }", "void check_and_send(){\r\n\t\twhile(not_ack_yet <= WINDOW_SIZE){\r\n\t\t\tif(covered_datagrams >= total_datagrams)\r\n\t\t\t\treturn;\r\n\t\t\t//send one data more\r\n\t\t\tcovered_datagrams++;\r\n\t\t\tbyte[] data_to_send = Helper.get_bytes(data_send,(covered_datagrams-1)*BLOCK_SIZE,BLOCK_SIZE);\r\n\t\t\tDataDatagram send = new DataDatagram((short)the_connection.session_num,\r\n\t\t\t\t\t(short)(covered_datagrams),data_to_send,the_connection);\r\n\t\t\tsend.send_datagram();\r\n\t\t\tput_and_set_timer(send);\r\n\t\t}\r\n\t}", "private void execute(List<Pair<Integer, Stream<byte[], GenericRecord>>> streams) throws Exception {\n Runtime.getRuntime().addShutdownHook(new Thread(() -> {\n isDone.set(true);\n printAggregatedStats(cumulativeRecorder);\n }));\n\n ExecutorService executor = Executors.newFixedThreadPool(flags.numThreads);\n try {\n final long numRecordsForThisThread = flags.numEvents / flags.numThreads;\n final long numBytesForThisThread = flags.numBytes / flags.numThreads;\n final double writeRateForThisThread = flags.writeRate / flags.numThreads;\n for (int i = 0; i < flags.numThreads; i++) {\n final int idx = i;\n final List<Stream<byte[], GenericRecord>> logsThisThread = streams\n .stream()\n .filter(pair -> pair.getLeft() % flags.numThreads == idx)\n .map(pair -> pair.getRight())\n .collect(Collectors.toList());\n executor.submit(() -> {\n try {\n if (flags.prometheusEnable) {\n writeWithPrometheusMonitor(\n logsThisThread,\n writeRateForThisThread,\n numRecordsForThisThread,\n numBytesForThisThread);\n } else {\n write(\n logsThisThread,\n writeRateForThisThread,\n numRecordsForThisThread,\n numBytesForThisThread);\n }\n } catch (Exception e) {\n log.error(\"Encountered error at writing records\", e);\n isDone.set(true);\n System.exit(-1);\n }\n });\n }\n log.info(\"Started {} write threads\", flags.numThreads);\n startTime = System.currentTimeMillis();\n reportStats();\n } finally {\n executor.shutdown();\n if (!executor.awaitTermination(5, TimeUnit.SECONDS)) {\n executor.shutdownNow();\n }\n streams.forEach(streamPair -> streamPair.getRight().closeAsync());\n }\n }", "public void callSendEvent(PacketEvent event) {\n\t\tfor(PacketListener l : PACKET_OUT_LISTENER) \n\t\t\tl.onEvent(event);\n\t}", "private void updateEvents(boolean isFirst) {\r\n\t\tSystem.out.println(\"[DEBUG LOG/Game.java] Updating events\");\r\n\t\tEmbedBuilder embed = new EmbedBuilder();\r\n\t\tString eventMsg = \"\";\r\n\t\tfor (int i = 0; i < events.size(); i++) {\r\n\t\t\teventMsg += events.get(i) + \"\\n\";\r\n\t\t}\r\n\t\tembed.setColor(Color.GRAY);\r\n\t\tif (isFirst) {\r\n\t\t\tembed.setTitle(\"Events\");\r\n\t\t\tgameChannel.sendMessage(embed.build()).queueAfter(100, TimeUnit.MILLISECONDS);\r\n\t\t} else {\r\n\t\t\tembed.setTitle(null);\r\n\t\t\t// Game breaks if eventMsg and title is \"\"\r\n\t\t\tif (eventMsg.contentEquals(\"\")) {\r\n\t\t\t\tembed.setDescription(\"Empty\");\r\n\t\t\t} else {\r\n\t\t\t\tembed.setDescription(eventMsg);\r\n\t\t\t}\r\n\t\t\tgameChannel.editMessageById(eventsID, embed.build()).queue();\r\n\t\t}\r\n\t}", "public void run() {\n int eventseen = 0;\n int looptry = 0;\n int wait = 100;\n while(! isInterrupted()) {\n Iterable<byte[]> stream = new Iterable<byte[]>() {\n @Override\n public Iterator<byte[]> iterator() {\n Iterator<byte[]> i = Receiver.this.getIterator();\n if(i == null) {\n return new Iterator<byte[]>() {\n\n @Override\n public boolean hasNext() {\n return false;\n }\n\n @Override\n public byte[] next() {\n return null;\n }\n\n };\n } else {\n return i;\n }\n }\n };\n try {\n for(byte[] e: stream) {\n logger.trace(\"new message received: {}\", e);\n if(e != null) {\n eventseen++;\n //Wrap, but not a problem, just count as 1\n if(eventseen < 0) {\n eventseen = 1;\n }\n Event event = new Event();\n decode(event, e);\n send(event);\n }\n }\n } catch (Exception e) {\n eventseen = 0;\n logger.error(e.getMessage());\n logger.catching(e);\n }\n // The previous loop didn't catch anything\n // So try some recovery\n if(eventseen == 0) {\n looptry++;\n logger.debug(\"event seen = 0, try = {}\", looptry);\n // A little magic, give the CPU to other threads\n Thread.yield();\n if(looptry > 3) {\n try {\n Thread.sleep(wait);\n wait = wait * 2;\n looptry = 0;\n } catch (InterruptedException ex) {\n break;\n }\n }\n } else {\n looptry = 0;\n wait = 0;\n }\n }\n }", "private void sendMsgBurst(long stopTime)\n {\n for (ClientChannelInfo clientChannelInfo : _channelHandler.activeChannelList())\n {\n ProviderSession providerSession = (ProviderSession)clientChannelInfo.userSpec;\n\n // The application corrects for ticks that don't finish before the time \n // that the next update burst should start. But don't do this correction \n // for new channels.\n if(providerSession.timeActivated() == 0)\n {\n continue;\n }\n \n int ret = TransportReturnCodes.SUCCESS;\n\n // Send burst of updates\n if(ProviderPerfConfig.updatesPerSec() != 0 && providerSession.updateItemList().count() != 0)\n {\n ret = sendUpdateBurst(providerSession, _error);\n if (ret > TransportReturnCodes.SUCCESS)\n {\n \t // Need to flush\n if (!ProviderPerfConfig.useReactor()) // use UPA Channel\n {\n _channelHandler.requestFlush(clientChannelInfo);\n }\n }\n }\n \n // Send burst of generic messages\n if(ProviderPerfConfig.genMsgsPerSec() != 0 && providerSession.genMsgItemList().count() != 0)\n {\n ret = sendGenMsgBurst(providerSession, _error);\n if (ret > TransportReturnCodes.SUCCESS)\n {\n \t // Need to flush\n if (!ProviderPerfConfig.useReactor()) // use UPA Channel\n {\n _channelHandler.requestFlush(clientChannelInfo);\n }\n }\n }\n\n // Use remaining time in the tick to send refreshes.\n while(ret >= TransportReturnCodes.SUCCESS && providerSession.refreshItemList().count() != 0 && currentTime() < stopTime)\n ret = sendRefreshBurst(providerSession, _error);\n \n if(ret < TransportReturnCodes.SUCCESS)\n {\n switch(ret)\n {\n case TransportReturnCodes.NO_BUFFERS:\n if (!ProviderPerfConfig.useReactor()) // use UPA Channel\n {\n _channelHandler.requestFlush(clientChannelInfo);\n }\n break;\n default:\n \t if (!Thread.interrupted())\n \t {\n \t\t System.out.printf(\"Failure while writing message bursts: %s (%d)\\n\", _error.text(), ret);\n \t\t if (!ProviderPerfConfig.useReactor()) // use UPA Channel\n {\n \t\t _channelHandler.closeChannel(clientChannelInfo, _error); //Failed to send an update. Remove this client\n }\n else // use UPA VA Reactor\n {\n System.out.println(\"Channel Closed.\");\n \n long inactiveTime = System.nanoTime();\n getProvThreadInfo().stats().inactiveTime(inactiveTime);\n \n --_connectionCount;\n \n // unregister selectableChannel from Selector\n try\n {\n SelectionKey key = clientChannelInfo.reactorChannel.selectableChannel().keyFor(_selector);\n key.cancel();\n }\n catch (Exception e) { } // channel may be null so ignore\n \n if (providerSession.clientChannelInfo().parentQueue.size() > 0)\n {\n providerSession.clientChannelInfo().parentQueue.remove(providerSession.clientChannelInfo());\n }\n\n clientChannelInfo.reactorChannel.close(_errorInfo); //Failed to send an update. Remove this client\n }\n \t }\n break;\n }\n }\n else if (ret > TransportReturnCodes.SUCCESS)\n {\n // need to flush\n if (!ProviderPerfConfig.useReactor()) // use UPA Channel\n {\n _channelHandler.requestFlush(clientChannelInfo);\n }\n }\n }\n }", "@SmallTest\n @Test\n public void testSendMessages() {\n ArraySet<Communicator.Message> messages = new ArraySet<>();\n messages.add(mParams.commMessage);\n\n mRtpTransport.sendMessages(messages);\n verify(mRtpAdapter).sendRtpHeaderExtensions(mHeaderExtensionCaptor.capture());\n Set<RtpHeaderExtension> extensions = mHeaderExtensionCaptor.getValue();\n assertEquals(1, extensions.size());\n assertTrue(extensions.contains(mParams.extension));\n }", "boolean sendBatch() throws IOException;", "void startPumpingEvents();", "public void forceSend() {\n if(!isAsync()) {\n NoXray.log(Level.WARNING, \"Attempted to force send a sync packet, unnecesaary\");\n Thread.dumpStack();\n return;\n }\n\n while(_event.getAsyncMarker().getProcessingDelay() > 0) {\n decrementAsyncProcessingCountAndSendIfZero();\n }\n }", "@Test\n public final void testAfterSend() throws Exception {\n ChannelController.getInstance().getLocalChannelId(channelId);\n\n final TestChannel channel = new TestChannel();\n\n channel.setChannelId(channelId);\n channel.setServerId(serverId);\n channel.setEnabled(true);\n\n channel.setPreProcessor(new TestPreProcessor());\n channel.setPostProcessor(new TestPostProcessor());\n\n final TestSourceConnector sourceConnector = (TestSourceConnector) TestUtils.createDefaultSourceConnector();\n sourceConnector.setChannel(channel);\n channel.setSourceConnector(sourceConnector);\n channel.setSourceFilterTransformer(TestUtils.createDefaultFilterTransformerExecutor());\n\n final ConnectorProperties connectorProperties = new TestDispatcherProperties();\n ((TestDispatcherProperties) connectorProperties).getQueueConnectorProperties().setQueueEnabled(true);\n ((TestDispatcherProperties) connectorProperties).getQueueConnectorProperties().setSendFirst(true);\n ((TestDispatcherProperties) connectorProperties).getQueueConnectorProperties().setRegenerateTemplate(true);\n\n final DestinationConnector destinationConnector = new TestDispatcher();\n TestUtils.initDefaultDestinationConnector(destinationConnector, connectorProperties);\n destinationConnector.setChannelId(channelId);\n ((TestDispatcher) destinationConnector).setReturnStatus(Status.SENT);\n\n class BlockingTestResponseTransformer extends TestResponseTransformer {\n public volatile boolean waiting = true;\n\n @Override\n public String doTransform(Response response, ConnectorMessage connectorMessage) throws DonkeyException, InterruptedException {\n while (waiting) {\n try {\n Thread.sleep(100);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n return super.doTransform(response, connectorMessage);\n }\n }\n final BlockingTestResponseTransformer responseTransformer = new BlockingTestResponseTransformer();\n \n destinationConnector.setResponseTransformerExecutor(TestUtils.createDefaultResponseTransformerExecutor());\n destinationConnector.getResponseTransformerExecutor().setResponseTransformer(responseTransformer);\n\n DestinationChain chain = new DestinationChain();\n chain.setChannelId(channelId);\n chain.setMetaDataReplacer(sourceConnector.getMetaDataReplacer());\n chain.setMetaDataColumns(channel.getMetaDataColumns());\n chain.addDestination(1, TestUtils.createDefaultFilterTransformerExecutor(), destinationConnector);\n channel.addDestinationChain(chain);\n\n if (ChannelController.getInstance().channelExists(channelId)) {\n ChannelController.getInstance().deleteAllMessages(channelId);\n }\n \n channel.deploy();\n channel.start();\n\n class TempClass {\n public long messageId;\n }\n final TempClass tempClass = new TempClass();\n\n for (int i = 1; i <= TEST_SIZE; i++) {\n responseTransformer.waiting = true;\n\n Thread thread = new Thread() {\n @Override\n public void run() {\n ConnectorMessage sourceMessage = TestUtils.createAndStoreNewMessage(new RawMessage(testMessage), channel.getChannelId(), channel.getServerId()).getConnectorMessages().get(0);\n tempClass.messageId = sourceMessage.getMessageId();\n\n try {\n channel.process(sourceMessage, false);\n } catch (InterruptedException e) {\n throw new AssertionError(e);\n }\n }\n };\n thread.start();\n\n Thread.sleep(100);\n // Assert that the response content was stored\n Connection connection = null;\n PreparedStatement statement = null;\n ResultSet result = null;\n \n try {\n connection = TestUtils.getConnection();\n long localChannelId = ChannelController.getInstance().getLocalChannelId(channelId);\n statement = connection.prepareStatement(\"SELECT * FROM d_mc\" + localChannelId + \" WHERE message_id = ? AND metadata_id = ? AND content_type = ?\");\n statement.setLong(1, tempClass.messageId);\n statement.setInt(2, 1);\n statement.setInt(3, ContentType.SENT.getContentTypeCode());\n result = statement.executeQuery();\n assertTrue(result.next());\n result.close();\n statement.close();\n \n // Assert that the message status was updated to PENDING\n statement = connection.prepareStatement(\"SELECT * FROM d_mm\" + localChannelId + \" WHERE message_id = ? AND id = ? AND status = ?\");\n statement.setLong(1, tempClass.messageId);\n statement.setInt(2, 1);\n statement.setString(3, String.valueOf(Status.PENDING.getStatusCode()));\n result = statement.executeQuery();\n assertTrue(result.next());\n result.close();\n statement.close();\n \n responseTransformer.waiting = false;\n thread.join();\n \n // Assert that the response transformer was run\n assertTrue(responseTransformer.isTransformed());\n \n // Assert that the message status was updated to SENT\n statement = connection.prepareStatement(\"SELECT * FROM d_mm\" + localChannelId + \" WHERE message_id = ? AND id = ? AND status = ?\");\n statement.setLong(1, tempClass.messageId);\n statement.setInt(2, 1);\n statement.setString(3, String.valueOf(Status.SENT.getStatusCode()));\n result = statement.executeQuery();\n assertTrue(result.next());\n result.close();\n statement.close();\n } finally {\n TestUtils.close(result);\n TestUtils.close(statement);\n TestUtils.close(connection);\n }\n }\n\n channel.stop();\n channel.undeploy();\n //ChannelController.getInstance().removeChannel(channel.getChannelId());\n }", "private void pushAllEvents() {\n boolean location = !config.ignoreLocation();\n double lat = location? LocationUtil.getInstance().getLatitude() : 0;\n double lon = location? LocationUtil.getInstance().getLongitude() : 0;\n PluriLockPackageBuilder eventPackage = new PluriLockPackageBuilder()\n .ip(PluriLockNetworkUtil.getIPAddress(context))\n .countryCode(PhoneDataManager.getCountry())\n .model(PhoneDataManager.getHardwareModel())\n .manufacturer(PhoneDataManager.getManufacturer())\n .userID(this.userID)\n .domain(this.config.getDomain())\n .language(PhoneDataManager.getDisplayLanguage())\n .timeZone(PhoneDataManager.getTimeZone())\n .appVersion(this.config.getAppVersion())\n .latitude(lat)\n .longitude(lon)\n .screenWidth(PhoneDataManager.getScreenWidth(context))\n .screenHeight(PhoneDataManager.getScreenHeight(context))\n .cpuCores(PhoneDataManager.getNumberOfCPUCores())\n .appName(PhoneDataManager.getAppName(context))\n .dateTime(PhoneDataManager.getDateTime())\n .sdkVersion(PhoneDataManager.getSDKVersion())\n .setEvents(pluriLockEvents.toArray(new PluriLockEvent[pluriLockEvents.size()]));\n networkUtil.sendEvent(eventPackage.buildPackage());\n pluriLockEvents.clear();\n }", "@Override\n\t\t\tpublic IAMQPPublishAction messages(Collection<byte[]> messages) {\n\t\t\t\treturn null;\n\t\t\t}", "@Override\n\t\t\tpublic IAMQPPublishAction messages(Collection<byte[]> messages) {\n\t\t\t\treturn null;\n\t\t\t}", "public boolean maybeAllSent() {\n\t\tif(blockSendsPending == 0 && _unsent.size() == 0 && getNumSent() == _prb._packets) {\n\t\t\ttimeAllSent = System.currentTimeMillis();\n\t\t\tif(logMINOR)\n\t\t\t\tLogger.minor(this, \"Sent all blocks, none unsent on \"+this);\n\t\t\t_senderThread.notifyAll();\n\t\t\treturn true;\n\t\t}\n\t\tif(blockSendsPending == 0 && _failed) {\n\t\t\ttimeAllSent = System.currentTimeMillis();\n\t\t\tif(logMINOR)\n\t\t\t\tLogger.minor(this, \"Sent blocks and failed on \"+this);\n\t\t\treturn true;\n\t\t}\n\t\tif(logMINOR) Logger.minor(this, \"maybeAllSent: block sends pending = \"+blockSendsPending+\" unsent = \"+_unsent.size()+\" sent = \"+getNumSent()+\" on \"+this);\n\t\treturn false;\n\t}", "public boolean writeInbound(Object... msgs) {\n/* 318 */ ensureOpen();\n/* 319 */ if (msgs.length == 0) {\n/* 320 */ return isNotEmpty(this.inboundMessages);\n/* */ }\n/* */ \n/* 323 */ ChannelPipeline p = pipeline();\n/* 324 */ for (Object m : msgs) {\n/* 325 */ p.fireChannelRead(m);\n/* */ }\n/* */ \n/* 328 */ flushInbound(false, voidPromise());\n/* 329 */ return isNotEmpty(this.inboundMessages);\n/* */ }", "public void sendDataToCrQueue() {\n List<Shares> sharesList = new ArrayList<>();\n amqpTemplate.convertAndSend(\"queueTestKey\", sharesList);\n }", "private boolean processNewEvents(List<Event> eventList, LVTSync.Builder syncBuilder) {\n\t\tMap<Integer, Long> timeSync = new HashMap<Integer, Long>();\n\t\tMap<Integer, List<Event>> eventsForSlaves = new HashMap<Integer, List<Event>>();\n\n\t\t// Divide one event to slaves\n\t\tif (eventList != null) {\n\t\t\tfor (Event event : eventList) {\n\t\t\t\tMap<Integer, Event.Builder> eventForSlaves = dispatchEvent(event);\n\t\t\t\tfor (Entry<Integer, Event.Builder> entry : eventForSlaves.entrySet()) {\n\t\t\t\t\tInteger slaveId = entry.getKey();\n\t\t\t\t\tEvent.Builder eventBuilder = entry.getValue();\n\t\t\t\t\tLong virtualTime = timeSync.get(slaveId);\n\t\t\t\t\tif (virtualTime == null || timeSync.get(slaveId) < eventBuilder.getStartTime()) {\n\t\t\t\t\t\ttimeSync.put(slaveId, eventBuilder.getStartTime());\n\t\t\t\t\t}\n\t\t\t\t\tList<Event> events = eventsForSlaves.get(slaveId);\n\t\t\t\t\tif (events == null) {\n\t\t\t\t\t\tList<Event> tempList = new ArrayList<Event>();\n\t\t\t\t\t\ttempList.add(eventBuilder.build());\n\t\t\t\t\t\teventsForSlaves.put(slaveId, tempList);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tevents.add(eventBuilder.build());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tInteger ownSlaveId = SlaveSimConfig.getInstance().getSlaveId();\n\n\t\t// Put events to local queue or remote queue\n\t\ttimeSync.remove(ownSlaveId);\n\t\tList<Event> eventsForLocal = eventsForSlaves.remove(ownSlaveId);\n\t\tif (eventsForLocal != null) {\n\t\t\teventQueue.addAll(eventsForLocal);\n\t\t}\n\n\t\t// Send events to remote queue\n\t\tif (!sendEvents(eventsForSlaves)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Build LVTSync\n\t\tsyncBuilder.setSlaveId(ownSlaveId);\n\t\tEvent event = eventQueue.peek();\n\t\tif (event == null) {\n\t\t\tsyncBuilder.setLocalTime(Long.MAX_VALUE);\n\t\t} else {\n\t\t\tsyncBuilder.setLocalTime(event.getStartTime());\n\t\t}\n\t\tfor (Entry<Integer, Long> sync : timeSync.entrySet()) {\n\t\t\tUpdate.Builder builder = Update.newBuilder();\n\t\t\tbuilder.setSlaveId(sync.getKey());\n\t\t\tbuilder.setLocalTime(sync.getValue());\n\t\t\tsyncBuilder.addUpdate(builder.build());\n\t\t}\n\t\treturn true;\n\t}", "@Test\n public void dispatchToBaseTypes() {\n BaseEventBus eventBus = new SynchronousEventBus(LOG);\n\n final List<Object> objectHandlerReceived = new ArrayList<>();\n Object objectHandler = new Object() {\n @Subscriber\n public void onEvent(Object event) {\n objectHandlerReceived.add(event);\n }\n };\n\n final List<Comparable<?>> comparableHandlerReceived = new ArrayList<>();\n Object comparableHandler = new Object() {\n @Subscriber\n public void onEvent(Comparable<?> event) {\n comparableHandlerReceived.add(event);\n }\n };\n\n final List<CharSequence> charSequenceHandlerReceived = new ArrayList<>();\n Object charSequenceHandler = new Object() {\n @Subscriber\n public void onEvent(CharSequence event) {\n charSequenceHandlerReceived.add(event);\n }\n };\n\n final List<CharSequence> stringHandlerReceived = new ArrayList<>();\n Object stringHandler = new Object() {\n @Subscriber\n public void onEvent(String event) {\n stringHandlerReceived.add(event);\n }\n };\n eventBus.register(objectHandler);\n eventBus.register(charSequenceHandler);\n eventBus.register(stringHandler);\n eventBus.register(comparableHandler);\n\n eventBus.post(\"event 1\");\n assertThat(objectHandlerReceived, is(asList(\"event 1\")));\n assertThat(comparableHandlerReceived, is(asList(\"event 1\")));\n assertThat(charSequenceHandlerReceived, is(asList(\"event 1\")));\n assertThat(stringHandlerReceived, is(asList(\"event 1\")));\n\n eventBus.post(Integer.MAX_VALUE);\n assertThat(objectHandlerReceived, is(asList(\"event 1\", Integer.MAX_VALUE)));\n assertThat(comparableHandlerReceived, is(asList(\"event 1\", Integer.MAX_VALUE)));\n assertThat(charSequenceHandlerReceived, is(asList(\"event 1\")));\n assertThat(stringHandlerReceived, is(asList(\"event 1\")));\n }", "static synchronized void schedule(Event event) {\n if (ENABLED || QUEUE.size() <= MAX_QUEUE_SIZE) {\n QUEUE.add(event);\n }\n\n if (ENABLED) {\n if (QUEUE.size() >= MAX_QUEUE_SIZE) {\n sendAllScheduled();\n } else {\n //The arrival of a new item interrupts the timer and resets the countdown.\n WikipediaApp.getInstance().getMainThreadHandler().removeCallbacks(SEND_RUNNABLE);\n WikipediaApp.getInstance().getMainThreadHandler().postDelayed(SEND_RUNNABLE, WAIT_MS);\n }\n }\n }", "private void sendPendingData() {\n assert(sendNextNumber >= sendUnackNumber);\n\n // Calculate congestion window difference\n long lastUnackNumber = sendUnackNumber + (long) Math.min(congestionWindow, MAX_WINDOW_SIZE);\n long difference = lastUnackNumber - sendNextNumber; // Available window\n\n // Send packets until either the congestion window is full\n // or there is no longer any flow to send\n long amountToSendByte = getFlowSizeByte(sendNextNumber);\n while (difference >= amountToSendByte && amountToSendByte > 0) {\n\n // If it has not yet been confirmed,actually send out the packet\n if (!acknowledgedSegStartSeqNumbers.contains(sendNextNumber)) {\n sendOutDataPacket(sendNextNumber, amountToSendByte);\n\n // If it has already been confirmed by selective acknowledgments, just move along\n } else {\n sendNextNumber += amountToSendByte;\n }\n\n // Determine next amount to send\n difference -= amountToSendByte;\n amountToSendByte = getFlowSizeByte(sendNextNumber);\n\n }\n\n }", "public void send(ExecutorService sender, final boolean flushing) {\n\t\t\t// Not sending this request before delay is expired unless we flush\n\t\t\tassert flushing || this.outDateMs.get() <= System.currentTimeMillis();\n\t\t\tlong lastTransactionTmp;\n\t\t\tLong lastSentTransaction;\n\t\t\tlong outDateTmp;\n\t\t\t// A copy of the elements, deletes and meta to be sent now\n\t\t\tConcurrentMap<String, ConcurrentMap<String, ConcurrentNavigableMap<Long, Object>>> elements;\n\t\t\tConcurrentSkipListSet<Long> deletions;\n\t\t\tMetaInformation metaTmp;\n\t\t\tthis.sendLock.writeLock().lock();\n\t\t\ttry {\n\t\t\t\t// This code cannot be executed concurrently with an update or another send start/stop\n\t\t\t\t\n\t\t\t\toutDateTmp = this.outDateMs.get();\n\t\t\t\tif (!flushing)\n\t\t\t\t\tthis.outDateMs.set(-1);\n\n\t\t\t\tlastTransactionTmp = transactionDistributor.get();\n\t\t\t\tboolean shouldLeave = false;\n\t\t\t\tif (this.sending) {\n\t\t\t\t\t// Already sending ? (e.g. long flush just before) => giving up\n\t\t\t\t\tshouldLeave = true;\n\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t// Newer transaction was sent, giving up\n\t\t\t\t\tif (this.lastSentTransaction != null && lastTransactionTmp <= this.lastSentTransaction) {\n\t\t\t\t\t\tshouldLeave = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (shouldLeave) {\n\t\t\t\t\tif (! flushing) {\n\t\t\t\t\t\t// Replanning\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tthis.plan();\n\t\t\t\t\t\t} catch (RequestIsOutException x) {\n\t\t\t\t\t\t\tassert this.lastSentTransaction == null ? this.transactionDistributor.get() == Long.MIN_VALUE : this.lastSentTransaction == this.transactionDistributor.get();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// As from this line, there MUST be a send request\n\t\t\t\tthis.sending = true;\n\t\t\t\t\n\t\t\t\tlastSentTransaction = this.lastSentTransaction;\n\t\t\t\tthis.lastSentTransaction = lastTransactionTmp;\n\n\t\t\t\t// This request should be the one for this row\n\t\t\t\tassert this == writesByRows.get(this.row);\n\t\t\t\t// Preparing this request to be used while current status is being sent by resetting all\n\t\t\t\telements = this.elements;\n\t\t\t\tthis.elements = new ConcurrentHashMap<String, ConcurrentMap<String,ConcurrentNavigableMap<Long,Object>>>();\n\t\t\t\tdeletions = this.deletions;\n\t\t\t\tthis.deletions = new ConcurrentSkipListSet<Long>();\n\t\t\t\tmetaTmp = this.meta.getAndSet(null);\n\t\t\t\trequestsBeingSending.incrementAndGet();\n\t\t\t\t\n\t\t\t} finally {\n\t\t\t\tthis.sendLock.writeLock().unlock();\n\t\t\t}\n\t\t\tfinal MetaInformation meta = metaTmp;\n\t\t\tfinal long lastTransaction = lastTransactionTmp;\n\t\t\tfinal long outDate = outDateTmp;\n\n\t\t\t// The action to be ran for sending this request\n\t\t\tRunnable action;\t\t\t\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\t// As from this line, we are not considering transactions later than lastTransaction\n\t\t\t\t// If a new transaction happens, request will be planned again once sent\n\t\t\t\t\n\t\t\t\tLong lastDeletion = deletions.isEmpty() ? null : deletions.last();\n\t\t\t\tif (lastDeletion != null && lastSentTransaction != null && lastDeletion < lastSentTransaction) {\n\t\t\t\t\tassert false;\n\t\t\t\t\tlastDeletion = null;\n\t\t\t\t}\n\t\t\t\t// Last no-delete update in order to know whether this element should be deleted or not\n\t\t\t\tlong lastStore = Long.MIN_VALUE;\n\t\n\t\t\t\t// Grabbing changed values.\n\t\t\t\tfinal ColumnFamilyData changes = new DefaultColumnFamilyData();\n\t\t\t\tfinal Map<String, Set<String>> removed = new TreeMap<String, Set<String>>();\n\t\t\t\tfinal Map<String, Map<String, Number>> increments = new TreeMap<String, Map<String, Number>>();\n\t\t\t\tfor (Entry<String, ConcurrentMap<String, ConcurrentNavigableMap<Long, Object>>> famData : elements\n\t\t\t\t\t\t.entrySet()) {\n\t\t\t\t\tfor (Entry<String, ConcurrentNavigableMap<Long, Object>> colData : famData\n\t\t\t\t\t\t\t.getValue().entrySet()) {\n\t\t\t\t\t\tEntry<Long, Object> lastEntry = colData.getValue()\n\t\t\t\t\t\t\t\t.lastEntry();\n\t\t\t\t\t\t// There can be no entry in case of a row delete after a column update\n\t\t\t\t\t\tif (lastEntry == null)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tLong transaction = lastEntry.getKey();\n\t\t\t\t\t\tif (lastSentTransaction != null && transaction < lastSentTransaction) {\n\t\t\t\t\t\t\tassert false;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlastStore = Math.max(lastStore, transaction);\n\t\t\t\t\t\t// Considering only those values after last deletion\n\t\t\t\t\t\tif (lastDeletion == null || lastDeletion < transaction) {\n\t\t\t\t\t\t\tObject latest = lastEntry.getValue();\n\t\t\t\t\t\t\tif (latest instanceof byte[]) {\n\t\t\t\t\t\t\t\tif (latest == DELETED_VALUE) {\n\t\t\t\t\t\t\t\t\t// Column should be deleted\n\t\t\t\t\t\t\t\t\tSet<String> remCols = removed.get(famData\n\t\t\t\t\t\t\t\t\t\t\t.getKey());\n\t\t\t\t\t\t\t\t\tif (remCols == null) {\n\t\t\t\t\t\t\t\t\t\tremCols = new TreeSet<String>();\n\t\t\t\t\t\t\t\t\t\tremoved.put(famData.getKey(), remCols);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tremCols.add(colData.getKey());\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// Column should be changed\n\t\t\t\t\t\t\t\t\tMap<String, byte[]> chgCols = changes\n\t\t\t\t\t\t\t\t\t\t\t.get(famData.getKey());\n\t\t\t\t\t\t\t\t\tif (chgCols == null) {\n\t\t\t\t\t\t\t\t\t\tchgCols = new TreeMap<String, byte[]>();\n\t\t\t\t\t\t\t\t\t\tchanges.put(famData.getKey(), chgCols);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tchgCols.put(colData.getKey(), latest == null ? null : (byte[]) latest);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tassert latest instanceof Number;\n\t\t\t\t\t\t\t\t// Column should be incremented\n\t\t\t\t\t\t\t\t// Summing all values to know the actual increment\n\t\t\t\t\t\t\t\tlong sum = 0;\n\t\t\t\t\t\t\t\tfor (Entry<Long, Object> incr : colData.getValue()\n\t\t\t\t\t\t\t\t\t\t.entrySet()) {\n\t\t\t\t\t\t\t\t\tObject val = incr.getValue();\n\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\tsum += ((Number) val).longValue();\n\t\t\t\t\t\t\t\t\t} catch (ClassCastException x) {\n\t\t\t\t\t\t\t\t\t\t// Just in case datum was updated (not incremented) meanwhile\n\t\t\t\t\t\t\t\t\t\t// This is robustness code as it's not likely to happen\n\t\t\t\t\t\t\t\t\t\tif (val == DELETED_VALUE)\n\t\t\t\t\t\t\t\t\t\t\tsum = 0;\n\t\t\t\t\t\t\t\t\t\telse // if (val instanceof byte[]) \n\t\t\t\t\t\t\t\t\t\t\tsum = ConversionTools.convert(Long.class, (byte[])val).longValue();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\t\t\tMap<String, Number> incCols = increments\n\t\t\t\t\t\t\t\t\t\t.get(famData.getKey());\n\t\t\t\t\t\t\t\tif (incCols == null) {\n\t\t\t\t\t\t\t\t\tincCols = new TreeMap<String, Number>();\n\t\t\t\t\t\t\t\t\tincrements.put(famData.getKey(), incCols);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tincCols.put(colData.getKey(), sum);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\tassert lastDeletion == null || lastTransaction >= lastDeletion;\n\t\t\t\tassert lastTransaction >= lastStore;\n\t\t\t\t\n\t\t\t\t// Sending using the executor\n\t\t\t\t// Checking whether it's a store or a delete\n\t\t\t\tif (lastDeletion == null || lastDeletion < lastStore) {\n\t\t\t\t\t\n\t\t\t\t\t// A delete resets all columns ;\n\t\t\t\t\t// cannot simulate that just using a store\n\t\t\t\t\tfinal boolean shouldDelete = lastDeletion != null;\n\t\t\t\t\t\n\t\t\t\t\taction = new Runnable() {\n\t\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tif (!flushing && outDate != -1) {\n\t\t\t\t\t\t\t\t\t\trequestsLatencySamples.increment();\n\t\t\t\t\t\t\t\t\t\tlong delay = System.currentTimeMillis()-outDate;\n\t\t\t\t\t\t\t\t\t\tassert delay > 0;\n\t\t\t\t\t\t\t\t\t\trequestsCumulativeLatency.add(delay);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// Deleting all cells if necessary\n\t\t\t\t\t\t\t\t\tif (shouldDelete)\n\t\t\t\t\t\t\t\t\t\tgetActualStore().delete(meta, row.table, row.id);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tgetActualStore().storeChanges(meta, row.table, row.id,\n\t\t\t\t\t\t\t\t\t\t\tchanges, removed, increments);\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} catch (RuntimeException x) {\n\t\t\t\t\t\t\t\tlogger.log(Level.WARNING, \"Catched problem while updating \" + StoreRequest.this + \" ; some data might have been lost: \" + x.getMessage(), x);\n\t\t\t\t\t\t\t\tthrow x;\n\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\trequestSent(flushing, lastTransaction);\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} else {\n\t\t\t\t\taction = new Runnable() {\n\t\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tif (!flushing && outDate != -1) {\n\t\t\t\t\t\t\t\t\t\trequestsLatencySamples.increment();\n\t\t\t\t\t\t\t\t\t\tlong delay = System.currentTimeMillis()-outDate;\n\t\t\t\t\t\t\t\t\t\tassert delay > 0;\n\t\t\t\t\t\t\t\t\t\trequestsCumulativeLatency.add(delay);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tgetActualStore().delete(meta, row.table, row.id);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} catch (RuntimeException x) {\n\t\t\t\t\t\t\t\tlogger.log(Level.WARNING, \"Catched problem while deleting \" + StoreRequest.this + \" ; some data might have been be lost: \" + x.getMessage(), x);\n\t\t\t\t\t\t\t\tthrow x;\n\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\trequestSent(flushing, lastTransaction);\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} catch (Throwable r) {\n\t\t\t\trequestsBeingSending.decrementAndGet();\n\t\t\t\tthrow r instanceof RuntimeException ? (RuntimeException)r : new RuntimeException(r);\n\t\t\t}\n\t\t\t\n\t\t\tif (sender == null)\n\t\t\t\taction.run();\n\t\t\telse {\n\t\t\t\tsender.submit(action);\n\t\t\t}\n\t\t}", "private void sendNotifications() {\n for (long sid : self.getCurrentAndNextConfigVoters()) {\n QuorumVerifier qv = self.getQuorumVerifier();\n ToSend notmsg = new ToSend(\n ToSend.mType.notification,\n proposedLeader,\n proposedZxid,\n logicalclock.get(),\n QuorumPeer.ServerState.LOOKING,\n sid,\n proposedEpoch,\n qv.toString().getBytes(UTF_8));\n\n LOG.debug(\n \"Sending Notification: {} (n.leader), 0x{} (n.zxid), 0x{} (n.round), {} (recipient),\"\n + \" {} (myid), 0x{} (n.peerEpoch) \",\n proposedLeader,\n Long.toHexString(proposedZxid),\n Long.toHexString(logicalclock.get()),\n sid,\n self.getMyId(),\n Long.toHexString(proposedEpoch));\n\n sendqueue.offer(notmsg);\n }\n }", "@Test\n public void startedSenderReceivingEventsWhileStoppingShouldDrainQueues()\n throws Exception {\n Integer lnPort = vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(2));\n Integer nyPort = vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(1, lnPort));\n\n createCacheInVMs(lnPort, vm2, vm4);\n createReceiverInVMs(vm2, vm4);\n createCacheInVMs(nyPort, vm3, vm5);\n createReceiverInVMs(vm3, vm5);\n\n vm2.invoke(() -> WANTestBase.createSender(\"ny\", 1, true, 100, 10, false, false, null, false));\n vm4.invoke(() -> WANTestBase.createSender(\"ny\", 1, true, 100, 10, false, false, null, false));\n\n vm3.invoke(() -> WANTestBase.createSender(\"ln\", 2, true, 100, 10, false, false, null, false));\n vm5.invoke(() -> WANTestBase.createSender(\"ln\", 2, true, 100, 10, false, false, null, false));\n\n vm2.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ny\", 1, 100,\n isOffHeap()));\n vm4.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ny\", 1, 100,\n isOffHeap()));\n\n vm3.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ln\", 1, 100,\n isOffHeap()));\n vm5.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ln\", 1, 100,\n isOffHeap()));\n\n AsyncInvocation<Void> inv =\n vm2.invokeAsync(() -> WANTestBase.doPuts(getTestMethodName() + \"_PR\", 1000));\n stopSenderInVMsAsync(\"ny\", vm2, vm4);\n inv.await();\n\n startSenderInVMsAsync(\"ny\", vm2, vm4);\n\n vm2.invoke(() -> WANTestBase.verifyTmpDroppedEventSize(\"ny\", 0));\n vm4.invoke(() -> WANTestBase.verifyTmpDroppedEventSize(\"ny\", 0));\n\n vm2.invoke(() -> WANTestBase.validateParallelSenderQueueAllBucketsDrained(\"ny\"));\n vm4.invoke(() -> WANTestBase.validateParallelSenderQueueAllBucketsDrained(\"ny\"));\n }", "@Override\n public void handleEvents(List<Event> processorEvents) {\n\n }", "public boolean writeOutbound(Object... msgs) {\n/* 381 */ ensureOpen();\n/* 382 */ if (msgs.length == 0) {\n/* 383 */ return isNotEmpty(this.outboundMessages);\n/* */ }\n/* */ \n/* 386 */ RecyclableArrayList futures = RecyclableArrayList.newInstance(msgs.length);\n/* */ try {\n/* 388 */ for (Object m : msgs) {\n/* 389 */ if (m == null) {\n/* */ break;\n/* */ }\n/* 392 */ futures.add(write(m));\n/* */ } \n/* */ \n/* 395 */ flushOutbound0();\n/* */ \n/* 397 */ int size = futures.size();\n/* 398 */ for (int i = 0; i < size; i++) {\n/* 399 */ ChannelFuture future = (ChannelFuture)futures.get(i);\n/* 400 */ if (future.isDone()) {\n/* 401 */ recordException(future);\n/* */ } else {\n/* */ \n/* 404 */ future.addListener((GenericFutureListener)this.recordExceptionListener);\n/* */ } \n/* */ } \n/* */ \n/* 408 */ checkException();\n/* 409 */ return isNotEmpty(this.outboundMessages);\n/* */ } finally {\n/* 411 */ futures.recycle();\n/* */ } \n/* */ }", "public void send(EventStore es, Template template);", "private synchronized void flush() {\r\n\t\tif (!buffer.isEmpty()) {\r\n\t\t\tfor (final LoggingRecord record : buffer) {\r\n\t\t\t\thandler.handle(record);\r\n\t\t\t}\r\n\t\t\tbuffer.clear();\r\n\t\t}\r\n\t}", "private void send() {\n vertx.eventBus().publish(GeneratorConfigVerticle.ADDRESS, toJson());\n }", "@Override\n\tprotected void processPostUpdateStream(KStream<String, Event> events) {\n\n\t}", "public static void sendToKafka(FlightState fs) {\n\t\ttry {\n\t\t\tproducer.send(FlightState.kafkaAvroRecord(fs, 4));\n\t\t\tproducer.send(FlightState.kafkaAvroRecord(fs, 5));\n\t\t\tproducer.send(FlightState.kafkaAvroRecord(fs, 6));\n\t\t\tproducer.send(FlightState.kafkaAvroRecord(fs, 7));\n\t\t} catch(SerializationException e) {\n\t\t\tSystem.out.println(\"Serialization Exception: \"+e);\n\t\t} catch(IllegalArgumentException e) {\n\t\t\t// Incomplete flight state is skipped without notification\n\t\t}\n\t}", "boolean sendEventMessage(Event<T> event, Map<String, Object> messageHeaderMap) {\n T entity = event.getData();\n validateEventEntity(entity);\n\n String entityId = getEntityIdAsString(entity);\n String eventInfo = String.format(\"%s %s(id=%s)\", event.getAction(), entityType, entityId);\n log.debug(\"Sending {} event message.\", eventInfo);\n\n Message<Event<T>> message = MessageBuilder.withPayload(event)\n .setHeader(MessageHeaders.CONTENT_TYPE, MimeTypeUtils.APPLICATION_JSON)\n .setHeader(KafkaHeaders.MESSAGE_KEY, entityId.getBytes())\n .copyHeaders(messageHeaderMap)\n .build();\n\n boolean isSent = messageChannel.send(message);\n\n if (isSent) {\n log.debug(\"{} event message is sent successfully.\", eventInfo);\n return true;\n } else {\n String errorMessage = String.format(\"Unable to send %s event message.\", eventInfo);\n log.error(errorMessage);\n throw new MessageDeliveryException(errorMessage);\n }\n }", "@Override\n public void publish(Event<? extends Enum, ?> event) {\n byte[] body = null;\n if (null == event) {\n log.error(\"Captured event is null...\");\n return;\n }\n if (event instanceof DeviceEvent) {\n body = bytesOf(MQUtil.json((DeviceEvent) event));\n } else if (event instanceof TopologyEvent) {\n body = bytesOf(MQUtil.json((TopologyEvent) event));\n } else if (event instanceof LinkEvent) {\n body = bytesOf(MQUtil.json((LinkEvent) event));\n } else {\n log.error(\"Invalid event: '{}'\", event);\n return;\n }\n processAndPublishMessage(body);\n }", "private void pushPurchases() {\n if (purchaseQueue.isEmpty()) {\n return;\n }\n\n if (!connected) {\n this.reconnectSupplier();\n }\n\n while (true) {\n synchronized (queueLock) {\n PurchaseRequest request = purchaseQueue.peek();\n if (request == null) {\n // finished pushing all buffered\n break;\n }\n\n boolean success = false;\n try {\n success = supplier.purchase(request);\n\n } catch (RemoteException e) {\n System.out.println(\"Unable to communicate with supplier to push request\");\n e.printStackTrace();\n connected=false;\n break;\n }\n\n // purchase either was successful, or denied by supplier, so remove it from buffer\n purchaseQueue.poll();\n if (!success) {\n request.failed();\n }\n }\n }\n }", "public TcpOutgoing(EventQueue eventQueue, AsyncPipe<Object> pipe, int mss, int winSize, long seqNum, Queue<ByteChunker> sendQ) {\n\t\tthis.eventQueue = eventQueue;\n\t\tthis.pipe = pipe;\n\t\tthis.mss = mss;\n\t\tthis.winSize = winSize;\n\t\tthis.seqNum = (int)seqNum;\n\t\tthis.sendQ = (sendQ == null) ? new ConcurrentLinkedQueue<ByteChunker>() : sendQ;\n\t}", "@RabbitListener(queues = RabbitMQConfiguration.EVENT_NOTIFICATION_QUEUE_NAME, containerFactory = \"batchContainerFactory\")\n\t@SuppressWarnings(\"rawtypes\")\n\tpublic void sendNotification(List<EventNotification> notifications) {\n\t\tMono<ResponseEntity> response = webClient.post()\n//\t\t\t\t\t.body(Mono.just(notifications), ArrayList.class)\n\t\t\t\t.accept(MediaType.APPLICATION_JSON)\n\t\t\t\t.bodyValue(notifications).retrieve()\n\t\t\t\t.onStatus(org.springframework.http.HttpStatus::is5xxServerError,\n\t\t\t\t\t\tclientResp -> Mono.error(new WrongSubscriptionDataException()))\n\t\t\t\t.bodyToMono(ResponseEntity.class).onErrorMap(Exception::new);\n//\t\t\t\t\t.timeout(Duration.ofMillis(10_00))\n\n\t\tresponse.subscribe(System.out::println); \n\t}", "public void broadCast(){\n // how many events the user want to broadcast to\n List<String> events = messageController.eventsOfSpeakerInString(speaker);\n ArrayList<String> potentialAnswer= listBuilderWithIntegers(events.size());\n if(potentialAnswer.size() != 0){\n this.speakerMessageScreen.numOfEvents();\n String stringAnswer = this.scanner.nextLine();\n while(!potentialAnswer.contains(stringAnswer)){\n this.speakerMessageScreen.invalidInput(stringAnswer);\n stringAnswer = this.scanner.nextLine();\n }\n int integerAnswer = Integer.parseInt(stringAnswer);\n // now the user want to broadcast to integerAnswer number of events at once\n\n // gives options\n this.speakerMessageScreen.broadCastOptions(events);\n\n ArrayList<String> selectedEvents = new ArrayList<>();\n for(int i = 1; i <= integerAnswer; i++){\n stringAnswer = this.scanner.nextLine();\n while(!potentialAnswer.contains(stringAnswer)){\n this.speakerMessageScreen.invalidInput(stringAnswer);\n stringAnswer = this.scanner.nextLine();\n }\n selectedEvents.add(stringAnswer);\n }\n\n\n ArrayList<Event> allEvents = this.messageController.eventsOfSpeaker(speaker);\n ArrayList<String> finalTargetEvents = new ArrayList<>();\n for(String identifier: selectedEvents){\n finalTargetEvents.add(allEvents.get(Integer.parseInt(identifier)-1).getId());\n }\n\n // now finalTargetEvents contains all events selected by user.\n\n this.speakerMessageScreen.whatMessage();\n String message = this.scanner.nextLine();\n\n // then broadcast\n this.messageController.broadCastForSpeakerMoreEvents(finalTargetEvents, speaker, message);\n\n speakerMessageScreen.congratulations();\n }else{\n speakerMessageScreen.noEvent();\n }\n\n\n }", "protected void dispatchSetupEvents() {\r\n TimedEvent e = null;\r\n while ((e = scenarioQueue.peek()) != null && e.time < 0) {\r\n scenarioQueue.poll();\r\n disp.dispatchEvent(e);\r\n }\r\n }", "@Test\n public void dispatchToMultipleSubscriberMethodsOnSameObject() {\n BaseEventBus eventBus = new SynchronousEventBus(LOG);\n\n final List<String> handler1Received = new ArrayList<>();\n final List<String> handler2Received = new ArrayList<>();\n Object object1 = new Object() {\n @Subscriber\n public void eventHandler1(String event) {\n handler1Received.add(event);\n }\n\n @Subscriber\n public void eventHandler2(String event) {\n handler2Received.add(event);\n }\n };\n\n eventBus.register(object1);\n\n eventBus.post(\"event 1\");\n eventBus.post(\"event 2\");\n\n // both subscribers should receive all items\n assertThat(handler1Received, is(asList(\"event 1\", \"event 2\")));\n assertThat(handler2Received, is(asList(\"event 1\", \"event 2\")));\n }", "protected boolean passEvent(OpLevel level, String msg, Object... args) {\n\t\tboolean pass = true;\n\t\tif (filters.size() == 0) return pass;\n\t\tfor (SinkEventFilter filter : filters) {\n\t\t\tpass = (pass && filter.filter(this, level, msg, args));\n\t\t\tif (!pass) {\n\t\t\t\tfilteredCount.incrementAndGet();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn pass;\n\t}", "@Test\n void receivesWithSmallPrefetch() {\n // Arrange\n final String secondPartitionId = \"2\";\n final AtomicBoolean isActive = new AtomicBoolean(true);\n final EventHubProducerAsyncClient producer = toClose(builder.buildAsyncProducerClient());\n\n final Disposable producerEvents = toClose(getEvents(isActive)\n .flatMap(event -> producer.send(event, new SendOptions().setPartitionId(secondPartitionId)))\n .subscribe(\n sent -> {\n },\n error -> logger.error(\"Error sending event\", error),\n () -> logger.info(\"Event sent.\")));\n\n final int prefetch = 5;\n final int backpressure = 3;\n final int batchSize = 10;\n final EventHubConsumerAsyncClient consumer = toClose(builder\n .prefetchCount(prefetch)\n .buildAsyncConsumerClient());\n\n // Act & Assert\n try {\n StepVerifier.create(consumer.receiveFromPartition(secondPartitionId, EventPosition.latest()), prefetch)\n .expectNextCount(prefetch)\n .thenRequest(backpressure)\n .expectNextCount(backpressure)\n .thenRequest(batchSize)\n .expectNextCount(batchSize)\n .thenRequest(batchSize)\n .expectNextCount(batchSize)\n .thenAwait(Duration.ofSeconds(1))\n .thenCancel()\n .verify(TIMEOUT);\n } finally {\n isActive.set(false);\n }\n }", "boolean deliver(String busType, String topic, Object event);", "@Override\n public void onEvents( PartitionContext context, Iterable<EventData> events ) throws Exception {\n\n // First time calibration time\n //\n if (lastIterationTime<0) {\n lastIterationTime = System.currentTimeMillis();\n }\n\n // See if we're not doing an iteration in the max wait time timer task...\n //\n while (wait.get() && !azureStep.isStopped()) {\n Thread.sleep( 10 );\n }\n\n int eventCount = 0;\n for ( EventData data : events ) {\n\n // It is important to have a try-catch around the processing of each event. Throwing out of onEvents deprives\n // you of the chance to process any remaining events in the batch.\n //\n azureStep.incrementLinesInput();\n\n try {\n\n Object[] row = RowDataUtil.allocateRowData(azureData.outputRowMeta.size());\n int index = 0;\n\n // Message : String\n //\n if ( StringUtils.isNotEmpty(azureData.outputField)) {\n row[ index++ ] = new String( data.getBytes(), \"UTF-8\" );\n }\n\n // Partition ID : String\n //\n if ( StringUtils.isNotEmpty(azureData.partitionIdField)) {\n row[ index++ ] = context.getPartitionId();\n }\n\n // Offset : String\n //\n if ( StringUtils.isNotEmpty(azureData.offsetField)) {\n row[ index++ ] = data.getSystemProperties().getOffset();\n }\n\n // Sequence number: Integer\n //\n if ( StringUtils.isNotEmpty(azureData.sequenceNumberField)) {\n row[ index++ ] = data.getSystemProperties().getSequenceNumber();\n }\n\n // Host: String\n //\n if ( StringUtils.isNotEmpty(azureData.hostField)) {\n row[ index++ ] = context.getOwner();\n }\n\n // Enqued Time: Timestamp\n //\n if ( StringUtils.isNotEmpty(azureData.enquedTimeField)) {\n Instant enqueuedTime = data.getSystemProperties().getEnqueuedTime();\n row[ index++ ] = Timestamp.from( enqueuedTime );\n }\n\n if (azureData.stt) {\n azureData.sttRowProducer.putRow( azureData.outputRowMeta, row );\n passedRowsCount++;\n lastContext = context;\n lastData = data;\n } else {\n // Just pass the row along, row safety is not of primary concern\n //\n azureStep.putRow( azureData.outputRowMeta, row );\n }\n\n if (azureStep.isDebug()) {\n azureStep.logDebug(\"Event read and passed for PartitionId (\" + context.getPartitionId() + \",\" + data.getSystemProperties().getOffset() + \",\" +\n data.getSystemProperties().getSequenceNumber() + \"): \" + new String( data.getBytes(), \"UTF8\" ) +\" (\"+index+\" values in row)\" );\n }\n\n eventCount++;\n\n // Checkpointing persists the current position in the event stream for this partition and means that the next\n // time any host opens an event processor on this event hub+consumer group+partition combination, it will start\n // receiving at the event after this one. Checkpointing is usually not a fast operation, so there is a tradeoff\n // between checkpointing frequently (to minimize the number of events that will be reprocessed after a crash, or\n // if the partition lease is stolen) and checkpointing infrequently (to reduce the impact on event processing\n // performance). Checkpointing every five events is an arbitrary choice for this sample.\n //\n this.checkpointBatchingCount++;\n if ( ( checkpointBatchingCount % checkpointBatchingSize ) == 0 ) {\n if (azureStep.isDebug()) {\n azureStep.logDebug( \"Partition \" + context.getPartitionId() + \" checkpointing at \" +\n data.getSystemProperties().getOffset() + \",\" + data.getSystemProperties().getSequenceNumber() );\n }\n\n if (azureData.stt) {\n\n if (azureStep.isDetailed()) {\n azureStep.logDetailed( \"Processing the rows sent to the batch transformation at event count \" + checkpointBatchingCount );\n }\n\n doOneIteration();\n } else {\n // Checkpoints are created asynchronously. It is important to wait for the result of checkpointing\n // before exiting onEvents or before creating the next checkpoint, to detect errors and to ensure proper ordering.\n //\n context.checkpoint( data ).get();\n }\n\n\n }\n } catch ( Exception e ) {\n azureStep.logError( \"Processing failed for an event: \" + e.toString(), e );\n azureStep.setErrors( 1 );\n azureStep.stopAll();\n }\n }\n if (azureStep.isDebug()) {\n azureStep.logDebug( \"Partition \" + context.getPartitionId() + \" batch size was \" + eventCount + \" for host \" + context.getOwner() );\n }\n }", "private static void performMessageExchange(List<Integer> users, int dosIDForHour){\n // For all pairs of users, send messages from one queue to the other with queue constraints in mind.\n MobyUser mobyUser1, mobyUser2;\n Collections.sort(users);\n for (int u1 : users) {\n mobyUser1 = mobyUserHashMap.get(u1);\n mobyUser1.performDosExchangeForHour(dosIDForHour, dosNumber);\n for (int u2 : users) {\n mobyUser2 = mobyUserHashMap.get(u2);\n mobyUser1.performMessageExchangeTailDrop(mobyUser2, dosNumber, dosIDForHour);\n }\n }\n\n }", "@Test\n public void multipleReceiversSamePartition() throws InterruptedException {\n // Arrange\n final EventHubConsumerAsyncClient consumer = toClose(builder.prefetchCount(1).buildAsyncConsumerClient());\n final EventHubConsumerAsyncClient consumer2 = toClose(builder.buildAsyncConsumerClient());\n final String partitionId = \"1\";\n final PartitionProperties properties = consumer.getPartitionProperties(partitionId).block(TIMEOUT);\n Assertions.assertNotNull(properties, \"Should have been able to get partition properties.\");\n\n final int numberToTake = 10;\n final CountDownLatch countdown1 = new CountDownLatch(numberToTake);\n final CountDownLatch countdown2 = new CountDownLatch(numberToTake);\n final EventPosition position = EventPosition.fromSequenceNumber(properties.getLastEnqueuedSequenceNumber());\n\n final AtomicBoolean isActive = new AtomicBoolean(true);\n final EventHubProducerAsyncClient producer = builder.buildAsyncProducerClient();\n final Disposable producerEvents = toClose(getEvents(isActive).flatMap(event -> {\n event.getProperties().put(PARTITION_ID_HEADER, partitionId);\n return producer.send(event, new SendOptions().setPartitionId(partitionId));\n }).subscribe(\n sent -> logger.info(\"Event sent.\"),\n error -> logger.error(\"Error sending event. Exception:\" + error, error),\n () -> logger.info(\"Completed\")));\n\n toClose(consumer.receiveFromPartition(partitionId, position)\n .filter(x -> TestUtils.isMatchingEvent(x.getData(), MESSAGE_TRACKING_ID))\n .take(numberToTake)\n .subscribe(event -> {\n logger.info(\"Consumer1: Event received\");\n countdown1.countDown();\n }));\n\n toClose(consumer2.receiveFromPartition(partitionId, position)\n .filter(x -> TestUtils.isMatchingEvent(x.getData(), MESSAGE_TRACKING_ID))\n .take(numberToTake)\n .subscribe(event -> {\n logger.info(\"Consumer2: Event received\");\n countdown2.countDown();\n }));\n\n // Assert\n try {\n boolean successful = countdown1.await(TIMEOUT.getSeconds(), TimeUnit.SECONDS);\n boolean successful2 = countdown2.await(TIMEOUT.getSeconds(), TimeUnit.SECONDS);\n\n Assertions.assertTrue(successful,\n String.format(\"Expected to get %s events. Got: %s\", numberToTake, countdown1.getCount()));\n Assertions.assertTrue(successful2,\n String.format(\"Expected to get %s events. Got: %s\", numberToTake, countdown2.getCount()));\n } finally {\n isActive.set(false);\n }\n }", "public void sendEmployeeEventUsingProducerRecord(EmployeeEvent employeeEvent) throws JsonProcessingException {\n\n Integer key = employeeEvent.getEmpEventId();\n String value = objectMapper.writeValueAsString(employeeEvent);\n\n\n ProducerRecord<Integer, String> producerRecord = createProducerRecord(key, value, kafkaTopic);\n// ListenableFuture<SendResult<Integer, String>> listenableFuture = kafkaTemplate.send(kafkaTopic, key, value); // sendDefault is of type Listenable future\n ListenableFuture<SendResult<Integer, String>> listenableFuture = kafkaTemplate.send(producerRecord); // changed overloaded method of send\n\n listenableFuture.addCallback(new ListenableFutureCallback<SendResult<Integer, String>>() { // Call back is of success and failure types\n @Override\n public void onFailure(Throwable e) {\n handleFailure(key, value, e);\n }\n\n @Override\n public void onSuccess(SendResult<Integer, String> result) { // Published message is successful\n handleSuccess(key, value, result);\n }\n });\n\n }", "protected void ProcessOutboundEvent(XMSEvent evt){\n switch(evt.getEventType()){\n case CALL_CONNECTED:\n System.out.println(\"***** Outbound call connected *****\");\n SetOutboundCallState(OutboundCallStates.CALLCONNECTED);\n ConnectCalls();\n break;\n case CALL_RECORD_END:\n \n break; \n case CALL_SENDDTMF_END:\n System.out.println(\"***** END_DTMF *****\");\n System.out.println(\"***** ReJoin Calls *****\");\n ConnectCalls();\n \n break; \n case CALL_DTMF:\n \n System.out.println(\"***** outbound CALL_DTMF *****\");\n System.out.println(\"data=\" + evt.getData());\n myInboundCall.SendInfo(\"DTMF_\" + evt.getData());\n \n break; \n case CALL_INFO:\n \n System.out.println(\"***** Outbound CALL_INFO *****\");\n System.out.println(\"data=\" + evt.getData());\n myInboundCall.SendInfo(evt.getData());\n\n break;\n case CALL_PLAY_END:\n //May need to do something here\n break;\n case CALL_DISCONNECTED: // The far end hung up will simply wait for the media\n System.out.println(\"***** outbound CALL_Disconnected *****\");\n DisconnectCalls();\n break;\n default:\n System.out.println(\"Unknown Event Type!!\");\n }\n }", "final protected void sendAll() {\n\t\tsendAllBut(null);\n\t}", "@Scheduled(every = \"1s\")\n void schedule() {\n if (message != null) {\n final String endpointUri = \"azure-eventhubs:?connectionString=RAW(\" + connectionString.get() + \")\";\n producerTemplate.sendBody(endpointUri, message + (counter++));\n }\n }", "private void fireChunkSent(final int chunkSize) {\n utils.logMonitorChunkSent(monitor, chunkSize);\n try {\n monitor.chunkSent(chunkSize);\n } catch (final Throwable cause) {\n utils.logMonitorError(monitor, cause);\n }\n }", "public String arrangeEvents() throws Exception {\n JSONArray scheduledEventList = calObj.retrieveEvents(\"primary\").getJSONArray(\"items\");\n JSONArray unScheduledEventList = calObj.retrieveEvents(this.user.getCalId()).getJSONArray(\"items\");\n\n //Filter events for this week\n\n\n //Make a list of all events\n\n //Prioritise all unscheduled events\n\n\n //Send the list to client to display\n String events = \"\";\n for (int i = 0; i < scheduledEventList.length(); i++) {\n org.json.JSONObject jsonLineItem = scheduledEventList.getJSONObject(i);\n events += jsonLineItem.getString(\"summary\") + \" \" + jsonLineItem.getJSONObject(\"start\").getString(\"dateTime\") + \"\\n\";\n }\n // Unscheduled events set in bot created aPAS calendar\n for (int i = 0; i < unScheduledEventList.length(); i++) {\n org.json.JSONObject jsonLineItem = unScheduledEventList.getJSONObject(i);\n events += jsonLineItem.getString(\"summary\") + \" \" + jsonLineItem.getJSONObject(\"start\").getString(\"dateTime\") + \"\\n\";\n }\n return events;\n }" ]
[ "0.61648417", "0.6087815", "0.5913808", "0.5833961", "0.57914805", "0.5788404", "0.5627047", "0.56072813", "0.55456764", "0.5540141", "0.5419516", "0.541667", "0.5327851", "0.5250783", "0.5238629", "0.5228517", "0.52174777", "0.5171673", "0.5137563", "0.5126833", "0.51221347", "0.5106065", "0.51025057", "0.5096303", "0.508074", "0.5076451", "0.50686276", "0.5052375", "0.50456625", "0.5045127", "0.5041783", "0.5020114", "0.5015458", "0.49949998", "0.498238", "0.49786767", "0.49747396", "0.497463", "0.49492213", "0.493878", "0.49248964", "0.48884377", "0.4877932", "0.48745197", "0.48720336", "0.4861781", "0.48587027", "0.48512107", "0.4835902", "0.48288196", "0.4822068", "0.48218927", "0.48178303", "0.48071867", "0.48029137", "0.4787904", "0.47866085", "0.47806925", "0.47793692", "0.47750065", "0.47664368", "0.47594377", "0.47594377", "0.4756981", "0.47568303", "0.47354782", "0.47348177", "0.4734288", "0.47314563", "0.4731271", "0.4728376", "0.47274655", "0.47199497", "0.46915078", "0.46901578", "0.46884608", "0.46806273", "0.46772456", "0.4669732", "0.46685237", "0.46654385", "0.46551883", "0.46418828", "0.4641622", "0.4631636", "0.4626338", "0.46246243", "0.46167555", "0.46141788", "0.4613657", "0.46106076", "0.46096778", "0.46080273", "0.4606064", "0.4605875", "0.4599083", "0.45866907", "0.45838854", "0.4583855", "0.45827946" ]
0.7656632
0
Generate a pageview identifier.
static String getPageViewId() { if (PAGEVIEW_ID == null) { PAGEVIEW_ID = generateRandomId(); } return PAGEVIEW_ID; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int generateViewId() {\n return View.generateViewId();\n }", "public static int generateViewId() {\n\t\tdo {\n\t\t\tfinal int result = sNextGeneratedId.get();\n\t\t\t// aapt-generated IDs have the high byte nonzero; clamp to the range under that.\n\t\t\tint newValue = result + 1;\n\t\t\tif (newValue > 0x00FFFFFF){\n\t\t\t\tnewValue = 1; // Roll over to 1, not 0.\n\t\t\t}\n\t\t\tif (sNextGeneratedId.compareAndSet(result, newValue)) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}while(true);\n\t}", "private static int generateViewId() {\n for (;;) {\n final int result = sNextGeneratedId.get();\n // aapt-generated IDs have the high byte nonzero; clamp to the range under that.\n int newValue = result + 1;\n if (newValue > 0x00FFFFFF) newValue = 1; // Roll over to 1, not 0.\n if (sNextGeneratedId.compareAndSet(result, newValue)) {\n return result;\n }\n }\n }", "String getUview_id();", "public static int getViewId() {\n\t\tviewId += 0x00000001;\n\t\treturn viewId;\n\t}", "public int getViewId() {\n return 123456;\n }", "protected abstract String getInitialPageId();", "@Override\n\tpublic String getSameViewID() {\n\t\tif (this.movements.isEmpty()) {\n\t\t\treturn \"/index.html\";\n\t\t} else {\n\t\t\tfinal String lastId = this.movements.peek();\n\t\t\treturn \"/\" + lastId + \".xhtml\";\n\t\t}\n\t}", "public Integer getViewID()\n {\n String x = center.east() + \"_\" + center.north() + \"_\" + scale + \"_\" +\n getWidth() + \"_\" + getHeight();\n java.util.zip.CRC32 id = new java.util.zip.CRC32();\n id.update(x.getBytes());\n return new Long(id.getValue()).intValue();\n }", "String getService_uview_id();", "public static String get_draw_page_id(){\r\n\t\t_draw_page_id ++;\r\n\t\t\r\n\t\treturn \"dp\" + _draw_page_id;\r\n\t}", "int getViewId();", "public String getUniqueId() {\n return getCurrentInstance().getViewRoot().createUniqueId();\n }", "private void generateID(){\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor (String t : terms.keySet())\n\t\t\tsb.append(t.replaceAll(\"\\\\W\", \"\")\n\t\t\t\t\t.substring(0, Math.min(4, t.replaceAll(\"\\\\W\", \"\").length())) + \"-\");\n\t\tfor (String s : sources)\n\t\t\tsb.append(s.replaceAll(\"\\\\W\", \"\")\n\t\t\t\t\t.substring(0, Math.min(4, s.replaceAll(\"\\\\W\", \"\").length())) + \"-\");\n\t\tsb.deleteCharAt(sb.length()-1);\n\t\tif (yearFrom > -1) sb.append(\"_\" + yearFrom);\n\t\tif (yearTo > -1) sb.append(\"_\" + yearTo);\n\t\tif (useCompounds) sb.append(\"_COMP\");\n\t\tif (useStopwords) sb.append(\"_STOP\");\n\t\tsb.append(\"_CNT\" + contextSize);\n\t\tsb.append(\"_\" + System.currentTimeMillis());\n\t\tthis.id = sb.toString();\n\t}", "String getContentGeneratorId();", "public static String generateKey(String key, PageContext pc)\n {\n HttpServletRequest req = (HttpServletRequest)pc.getRequest();\n\n // use the key as the suffix by default\n String suffix = key;\n if (suffix == null) {\n String saved = (String)req.getAttribute(Constants.JSPTAG_COUNTER_KEY);\n\n if (saved == null)\n suffix = \"1\";\n else\n suffix = Integer.toString(Integer.parseInt(saved) + 1);\n\n req.setAttribute(Constants.JSPTAG_COUNTER_KEY, suffix);\n }\n \n // concatenate the servlet path and the suffix to generate key\n return req.getServletPath() + '_' + suffix;\n }", "public abstract String getFacesViewIdFromPath(String viewPath);", "protected String generateReviewID() {\n Random r = new Random();\n String restID;\n do {\n int randomIDnum = r.nextInt(999999999) + 1;\n restID = String.valueOf(randomIDnum);\n } while (this.reviewMap.containsKey(restID));\n return restID;\n }", "String getIdNumber();", "@Override\n\tpublic native final String createUniqueId() /*-{\n // In order to force uid's to be document-unique across multiple modules,\n // we hang a counter from the document.\n if (!this.gwt_uid) {\n this.gwt_uid = 1;\n }\n\n return \"gwt-uid-\" + this.gwt_uid++;\n\t}-*/;", "private String generatePurchaseId() {\n\t\tint purchaseId = purchaseIdCounter.incrementAndGet();\n\t\treturn Integer.toString(purchaseId);\n\t}", "@Override\n\tpublic String generaId(String date) {\n\t\tg=new GenerateId();\n\t\treturn g.generateDocumentId(date, \"paymentlist\");\n\t}", "@Override\n\tpublic String getBackwardViewID() {\n\t\tif (this.movements.isEmpty()) {\n\t\t\treturn \"/index.html\";\n\t\t} else {\n\t\t\tString beforeLastId = this.movements.peek();\n\t\t\tif (this.movements.size() > 1) {\n\t\t\t\tbeforeLastId = this.movements.get(this.movements.size() - 2);\n\t\t\t}\n\t\t\treturn \"/\" + beforeLastId + \".xhtml\";\n\t\t}\n\t}", "public String getPageId() {\n return pageId;\n }", "public abstract String getRenderRedirectViewId();", "private String generateNewCallId()\n {\n\n\t\t// Generate the variant number\n\t\tint variable = NumberUtils.getIntRandom();\n\n\t\t// Convert to hex value\n\t\tString hex = NumberUtils.toHexValue(variable);\n\n\t\t// Compose the final call id\n\t\treturn \"{2B073406-65D8-A7B2-5B13-B287\" + hex + \"}\";\n\t}", "public String generateID() {\n return IDPREFIX + nextidint++;\n }", "private Id getViewContainerID() {\n if (semantic == null) {\n return Id.invalid();\n }\n return new Id(RefreshIDFactory.getOrCreateID(viewContainer));\n }", "@DISPID(14) //= 0xe. The runtime will prefer the VTID if present\n @VTID(20)\n int templateID();", "@Override\r\n\tpublic String getViewIdentifier() {\n\t\treturn ClassUtils.getUrl(this);\r\n\t}", "protected abstract int getLayoutViewId();", "public abstract String getFacesViewIdFromPath(String viewPath, boolean mustExist);", "public static String createPID()\r\n\t{\r\n\t\tunique_count++;\r\n\t\tif(unique_count >= 100) unique_count = 0;\r\n\t\tString str_num = String.format(\"%02d\", unique_count);\r\n\t\t\r\n\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(\"yyMMddHHmmss\");\r\n\t\tString pid = dateFormat.format(new Date()) + str_num;\r\n\t\treturn pid;\r\n\t}", "String generateUID();", "public int getIdentifier();", "public static String createRandomNum() {\n\t\tlogger.debug(\"Navigating to URL\");\n\t\tString num = \"\";\n\t\ttry {\n\t\t\tnum = RandomStringUtils.random(4, true, true);\n\t\t\tlogger.debug(\"Generated Random Number is : \" + num);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn num;\n\t}", "@Override\n\tpublic String getViewIdentifier() {\n\t\treturn ClassUtils.getUrl(this);\n\t}", "@Override\n\tpublic String getViewIdentifier() {\n\t\treturn ClassUtils.getUrl(this);\n\t}", "int getRoutingAppID();", "public int generateId(){\n return repository.getCount()+1;\n }", "public String generateLink_Id() {\n\t\tString Link_Id = \"L\" + String.valueOf(rand.genRandomDigits(7));\n\t\twhile (registerDao.checkLinkIdIfExist(Link_Id)) {\n\t\t\tLink_Id = \"C\" + String.valueOf(rand.genRandomDigits(7));\n\t\t}\n\t\treturn Link_Id;\n\t}", "String idProvider();", "int getIdentifier();", "public String generatePurchaseId() {\n\t\tint purchaseId = purchaseIdCounter.incrementAndGet();\n\t\treturn Integer.toString(purchaseId);\n\t}", "public String getIdentifier() {\n\t\treturn config.getUIName()+\"[\"+getIndex()+\"]\";\n\t}", "protected String getIdentifier() {\n return getBaseUrl() + normalizePath(getRequest().getPath());\n }", "public static int makeSegID() {\n int newID = (int) (Math.random() * 100000000);\n return newID;\n }", "java.lang.String getIdentifier();", "private static int generateId() {\n\t\treturn ++sId;\n\t}", "public String generateTeamID() {\n List<Team> teams = getAllOrdered();\n int idNum;\n \n if (teams == null || teams.isEmpty()) \n idNum = 0;\n else {\n String idStr = teams.get(teams.size() - 1).getTeamID();\n idNum = Integer.parseInt(idStr.substring(2, idStr.length()));\n }\n \n String teamID;\n int newIdNum = idNum + 1;\n if (newIdNum <= 9)\n teamID = \"T_000\" + newIdNum;\n else if (newIdNum <= 99) \n teamID = \"T_00\" + newIdNum;\n else if (newIdNum <= 999)\n teamID = \"T_0\" + newIdNum;\n else \n teamID = \"T_\" + newIdNum;\n \n return teamID;\n }", "String getIdentifier();", "String getIdentifier();", "String getIdentifier();", "String getIdentifier();", "String getIdentifier();", "String getIdentifier();", "String getIdentifier();", "public String generateReferenceId(){\n String lastSequenceNumber = databaseAccessResource.getLastRequestSequenceNumber();\n //ToDo : write the logic to generate the next sequence number.\n return null;\n }", "@Override // com.zhihu.android.app.p1311ui.fragment.BaseFragment\n public String onSendPageId() {\n return C6969H.m41409d(\"G3DD28D\");\n }", "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 }", "@DISPID(86)\r\n\t// = 0x56. The runtime will prefer the VTID if present\r\n\t@VTID(84)\r\n\tint templateID();", "String mo10312id();", "static String generateId() {\r\n\t\treturn UUID.randomUUID().toString().replaceAll(\"-\", \"\");\r\n\t}", "public void generarId() {\n try{\n int numAleatorio = (int)(Math.random()*99999);\n boolean resultado = dgt.generarIdAutomatico(numAleatorio);\n tfid.setText(String.valueOf(numAleatorio));\n }catch(Exception e){\n System.out.println(e.getMessage());\n }\n }", "public static String generate() {\n return StringUtil.join(\n '.',\n PROCESS_ID,\n String.valueOf(Thread.currentThread().getId()),\n String.valueOf(THREAD_ID_SEQUENCE.get().nextSeq())\n );\n }", "private String _getId(int classType, int index) {\n String id;\n\n switch (classType) {\n case CS_C_UNIV:\n id = \"http://www.\" + _getRelativeName(classType, index) + \".edu\";\n break;\n case CS_C_DEPT:\n id = \"http://www.\" + _getRelativeName(classType, index) + \".\" +\n _getRelativeName(CS_C_UNIV, instances_[CS_C_UNIV].count - 1) +\n \".edu\";\n break;\n default:\n id = _getId(CS_C_DEPT, instances_[CS_C_DEPT].count - 1) + ID_DELIMITER +\n _getRelativeName(classType, index);\n break;\n }\n\n return id;\n }", "@LayoutRes\n protected abstract int getContentViewId(Bundle savedInstanceState);", "public static String makeSingleViewString(int cataloguingView) {\n return View.makeSingleViewString(cataloguingView);\n }", "public String GenerateID()\n\t{\n\t\tRandom randomGenerator = new Random();\n\t\treturn Integer.toString(randomGenerator.nextInt(Integer.MAX_VALUE));\n\t}", "String getUniqueId();", "public static String generateProductID() {\n\tproductID++;\n\treturn String.valueOf(productID);\n }", "String id();", "String id();", "String id();", "String id();", "String id();", "String id();", "String id();", "String id();", "String id();", "String id();", "String id();", "String id();", "String id();", "String id();", "String id();", "String id();", "String id();", "String id();", "String id();", "String id();", "String id();", "String id();", "String id();", "String id();", "public static String aUniqueIdentifier() {\n return \"MONEXT\" + new SimpleDateFormat(\"yyyyMMddHHmmss\").format(new Date());\n }", "public String generatePhoneId() {\n String device = Build.DEVICE.equals(\"generic\") ? \"emulator\" : Build.DEVICE;\n String network = getNetwork();\n String carrier = (network == NETWORK_WIFI) ?\n getWifiCarrierName() : getTelephonyCarrierName();\n\n StringBuilder stringBuilder = new StringBuilder(ANDROID_STRING);\n stringBuilder.append('-').append(device).append('_')\n .append(Build.VERSION.RELEASE).append('_').append(network)\n .append('_').append(carrier).append('_').append(getTelephonyPhoneType())\n .append('_').append(isLandscape() ? \"Landscape\" : \"Portrait\");\n\n return stringBuilder.toString();\n }", "@DISPID(38)\r\n\t// = 0x26. The runtime will prefer the VTID if present\r\n\t@VTID(43)\r\n\tint id();", "alluxio.proto.journal.Lineage.LineageIdGeneratorEntry getLineageIdGenerator();", "java.lang.String getDocumentId();" ]
[ "0.80858773", "0.7419313", "0.72571903", "0.7000573", "0.6718615", "0.6310105", "0.62901723", "0.6265047", "0.6238603", "0.62011784", "0.61904615", "0.6018164", "0.5979309", "0.59449196", "0.59142923", "0.5906372", "0.5903543", "0.58620226", "0.5826285", "0.58207744", "0.5793029", "0.5756099", "0.5750589", "0.57190156", "0.57171285", "0.5694109", "0.5692725", "0.5689846", "0.56647617", "0.5648773", "0.563508", "0.5622167", "0.56070167", "0.5596514", "0.5593751", "0.55925494", "0.5588222", "0.5588222", "0.55804485", "0.55792475", "0.5544364", "0.5538055", "0.55236363", "0.5515041", "0.5505161", "0.54898936", "0.54869837", "0.5486223", "0.5478306", "0.5471911", "0.5468636", "0.5468636", "0.5468636", "0.5468636", "0.5468636", "0.5468636", "0.5468636", "0.5467796", "0.54587656", "0.5443807", "0.5443445", "0.54325646", "0.5422322", "0.53994334", "0.5397839", "0.53947973", "0.5381442", "0.5371682", "0.5368195", "0.5367162", "0.53654724", "0.536429", "0.536429", "0.536429", "0.536429", "0.536429", "0.536429", "0.536429", "0.536429", "0.536429", "0.536429", "0.536429", "0.536429", "0.536429", "0.536429", "0.536429", "0.536429", "0.536429", "0.536429", "0.536429", "0.536429", "0.536429", "0.536429", "0.536429", "0.536429", "0.53567916", "0.53500545", "0.5343066", "0.5341387", "0.5340975" ]
0.8128772
0
Generate a session identifier.
static String getSessionId() { if (SESSION_ID == null) { // If there is no runtime value for SESSION_ID, try to load a // value from persistent store. SESSION_ID = Prefs.INSTANCE.getEventPlatformSessionId(); if (SESSION_ID == null) { // If there is no value in the persistent store, generate a new value for // SESSION_ID, and write the update to the persistent store. SESSION_ID = generateRandomId(); Prefs.INSTANCE.setEventPlatformSessionId(SESSION_ID); } } return SESSION_ID; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int generateSessionID(){\r\n SecureRandom randsession = new SecureRandom();\r\n return randsession.nextInt(1234567890);\r\n }", "protected String generateSessionId() {\n String result = null;\n\n SessionIdGenerator sessionIdGenerator = getSessionIdGenerator();\n if (sessionIdGenerator == null) {\n sessionIdGenerator = new StandardSessionIdGenerator();\n }\n int tryTimes = 0;\n do {\n if (result != null) {\n // should rarely be here\n logger.warn(\"duplicated session id!!\");\n if (++tryTimes >= 10) {\n throw new SessionException(\"generate duplicated session id too many times!!\");\n }\n }\n result = sessionIdGenerator.generateSessionId();\n } while (sessionCache.exists(result));\n\n return result;\n }", "public String nextSessionId() {\n\t\tSecureRandom random = new SecureRandom();\n\t\treturn new BigInteger(130, random).toString(32);\n\t}", "private int generateSessionId(){\n int id;\n do{\n id = smIdGenerator.nextInt(50000);\n }while(mSessionMap.containsKey(id));\n\n Log.i(TAG, \"generating session id:\" + id);\n return id;\n }", "private String makeSessionId() {\n if (shareMr3Session) {\n String globalMr3SessionIdFromEnv = System.getenv(MR3_SHARED_SESSION_ID);\n useGlobalMr3SessionIdFromEnv = globalMr3SessionIdFromEnv != null && !globalMr3SessionIdFromEnv.isEmpty();\n if (useGlobalMr3SessionIdFromEnv) {\n return globalMr3SessionIdFromEnv;\n } else {\n return UUID.randomUUID().toString();\n }\n } else {\n return UUID.randomUUID().toString();\n }\n }", "String createSessionId(long seedTerm);", "private synchronized String generateSessionId()\n\t{\n\n\t\tbyte random[] = new byte[16];\n\t\tString jvmRoute = getJvmRoute();\n\t\tString result = null;\n\n\t\t// Render the result as a String of hexadecimal digits\n\t\tStringBuffer buffer = new StringBuffer();\n\t\tdo\n\t\t{\n\t\t\tint resultLenBytes = 0;\n\t\t\tif (result != null)\n\t\t\t{\n\t\t\t\tbuffer = new StringBuffer();\n\t\t\t\tduplicates++;\n\t\t\t}\n\n\t\t\twhile (resultLenBytes < this.sessionIdLength)\n\t\t\t{\n\t\t\t\tgetRandomBytes(random);\n\t\t\t\trandom = getDigest().digest(random);\n\t\t\t\tfor (int j = 0; j < random.length\n\t\t\t\t\t\t&& resultLenBytes < this.sessionIdLength; j++)\n\t\t\t\t{\n\t\t\t\t\tbyte b1 = (byte) ((random[j] & 0xf0) >> 4);\n\t\t\t\t\tbyte b2 = (byte) (random[j] & 0x0f);\n\t\t\t\t\tif (b1 < 10)\n\t\t\t\t\t\tbuffer.append((char) ('0' + b1));\n\t\t\t\t\telse\n\t\t\t\t\t\tbuffer.append((char) ('A' + (b1 - 10)));\n\t\t\t\t\tif (b2 < 10)\n\t\t\t\t\t\tbuffer.append((char) ('0' + b2));\n\t\t\t\t\telse\n\t\t\t\t\t\tbuffer.append((char) ('A' + (b2 - 10)));\n\t\t\t\t\tresultLenBytes++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (jvmRoute != null)\n\t\t\t{\n\t\t\t\tbuffer.append('.').append(jvmRoute);\n\t\t\t}\n\t\t\tresult = buffer.toString();\n\t\t}\n\t\twhile (_sessions.containsKey(result));\n\t\treturn (result);\n\n\t}", "public String generateId() {\n return Utils.generateKey();\n }", "String generateUID();", "public static synchronized String generateSessionId() {\n\n\t\tRandom random = new SecureRandom(); // 取随机数发生器, 默认是SecureRandom\n\t\tbyte bytes[] = new byte[SESSION_ID_BYTES];\n\t\trandom.nextBytes(bytes); // 产生16字节的byte\n\t\tbytes = getDigest().digest(bytes); // 取摘要,默认是\"MD5\"算法\n\t\t// Render the result as a String of hexadecimal digits\n\n\t\tStringBuffer result = new StringBuffer();\n\t\tfor (int i = 0; i < bytes.length; i++) { // 转化为16进制字符串\n\n\t\t\tbyte b1 = (byte) ((bytes[i] & 0xf0) >> 4);\n\t\t\tbyte b2 = (byte) (bytes[i] & 0x0f);\n\t\t\tif (b1 < 10)\n\t\t\t\tresult.append((char) ('0' + b1));\n\t\t\telse\n\t\t\t\tresult.append((char) ('A' + (b1 - 10)));\n\t\t\tif (b2 < 10)\n\t\t\t\tresult.append((char) ('0' + b2));\n\t\t\telse\n\t\t\t\tresult.append((char) ('A' + (b2 - 10)));\n\t\t}\n\n\t\treturn (result.toString());\n\t}", "UUID getSessionId();", "public void generateInstallSessionID() {\n// generateSessionID();\n// hasInstallSession = true;\n }", "java.lang.String getSessionID();", "public static String generateInstanceId() {\n\t\t// TODO Use a complex hashing algorithm and generate 16-character\n\t\t// string;\n\n\t\treturn Calendar.getInstance().getTime().toString().replaceAll(\" \", \"\");\n\t}", "static String generateId() {\r\n\t\treturn UUID.randomUUID().toString().replaceAll(\"-\", \"\");\r\n\t}", "public String generateID() {\n return IDPREFIX + nextidint++;\n }", "String getSessionID();", "String getSessionID();", "private String generatePurchaseId() {\n\t\tint purchaseId = purchaseIdCounter.incrementAndGet();\n\t\treturn Integer.toString(purchaseId);\n\t}", "UUID sessionId();", "int getClientSessionID();", "private String generateUniqueIdString() {\r\n return TimeBasedUUID.getUUIDAsString();\r\n }", "String uniqueId();", "public String createUniqueScriptInstanceIdentifier() {\n\n\t\tLOGGER.debug(\"Creating a unique script instance identifier\");\n\n\t\t// generate a random name for the connection\n\t\tCalendar myCalendar = Calendar.getInstance();\n\t\tSimpleDateFormat dateFormatter = new SimpleDateFormat(\"yyyyMMddHHmmssS\");\n\t\tString scriptIdentifier = \"scriptInstance\"\n\t\t\t\t+ dateFormatter.format(myCalendar.getTime())\n\t\t\t\t+ randomNameSequence;\n\t\trandomNameSequence = randomNameSequence + 1;\n\n\t\tLOGGER.info(\"Generated unique script instance identifier [\"\n\t\t\t\t+ scriptIdentifier + \"]\");\n\n\t\treturn scriptIdentifier;\n\t}", "private int getNextSessionID() {\n\t\treturn sessionNum++;\n\t}", "public String generateId() {\n return RandomStringUtils.randomAlphabetic(32);\n }", "public String generateActivationId() {\n return UUID.randomUUID().toString();\n }", "public String getSessionID() {\n Object ref = sessionID_;\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 sessionID_ = s;\n return s;\n }\n }", "public String getSessionID() {\n Object ref = sessionID_;\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 sessionID_ = s;\n return s;\n }\n }", "com.google.protobuf.ByteString\n getSessionIDBytes();", "com.google.protobuf.ByteString\n getSessionIDBytes();", "public static String getUniqueIdentifier() {\r\n UUID uuid = UUID.randomUUID();\r\n return uuid.toString();\r\n }", "private static int generateId() {\n\t\treturn ++sId;\n\t}", "public String getSessionID() {\n Object ref = sessionID_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n sessionID_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }", "public String getSessionID() {\n Object ref = sessionID_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n sessionID_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }", "java.lang.String getSessionId();", "public String GenerateID()\n\t{\n\t\tRandom randomGenerator = new Random();\n\t\treturn Integer.toString(randomGenerator.nextInt(Integer.MAX_VALUE));\n\t}", "private String creatUniqueID(){\n long ID = System.currentTimeMillis();\n return Long.toString(ID).substring(9,13);\n }", "public com.google.protobuf.ByteString\n getSessionIDBytes() {\n Object ref = sessionID_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n sessionID_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getSessionIDBytes() {\n Object ref = sessionID_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n sessionID_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public static String makeRandomID() {\n UUID uuid = UUID.randomUUID();\n return uuid.toString();\n }", "public String generatePurchaseId() {\n\t\tint purchaseId = purchaseIdCounter.incrementAndGet();\n\t\treturn Integer.toString(purchaseId);\n\t}", "String getSessionId();", "String getSessionId();", "String getSessionId();", "String getSessionId();", "public String generateClientId() {\n return clientIdGenerator.generate().toString();\n }", "public com.google.protobuf.ByteString\n getSessionIDBytes() {\n Object ref = sessionID_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n sessionID_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getSessionIDBytes() {\n Object ref = sessionID_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n sessionID_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public static String createPID()\r\n\t{\r\n\t\tunique_count++;\r\n\t\tif(unique_count >= 100) unique_count = 0;\r\n\t\tString str_num = String.format(\"%02d\", unique_count);\r\n\t\t\r\n\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(\"yyMMddHHmmss\");\r\n\t\tString pid = dateFormat.format(new Date()) + str_num;\r\n\t\treturn pid;\r\n\t}", "String allocateId() throws SessionStorageException;", "public static String generateSaleID() {\n\tsaleID++;\n\treturn String.valueOf(saleID);\n }", "public static String generateNewUserId() {\r\n\t\tDate date = new Date();\r\n\t\treturn String.format(\"%s-%s\", UUID.randomUUID().toString(),\r\n\t\t\t\tString.valueOf(date.getTime()));\r\n\t}", "public static String generateCustomerID() {\n\tcustomerID++;\n\treturn String.valueOf(customerID);\n }", "public static String aUniqueIdentifier() {\n return \"MONEXT\" + new SimpleDateFormat(\"yyyyMMddHHmmss\").format(new Date());\n }", "int nextId();", "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 }", "protected String generateLockId() {\n return AkkaUtils.nextId();\n }", "protected String generateStateId() {\n\t\treturn ServiceBus.crypto.getRandomString();\n\t}", "protected static String generateToken()\n\t{\n\t\treturn UUID.randomUUID().toString();\n\t}", "public static String getSessionId(Context mContext) {\n Calendar aGMTCalendar = Calendar.getInstance(TimeZone.getTimeZone(\"GMT-0\"));\n return ReadCacheTool.getUId(mContext) + \"_\" + aGMTCalendar.getTimeInMillis();\n }", "UUID id();", "private\tString\tgenerateUUID(){\n\t\treturn\tUUID.randomUUID().toString().substring(0, 8).toUpperCase();\n\t}", "public static String generateProductID() {\n\tproductID++;\n\treturn String.valueOf(productID);\n }", "public static String generateId(String s){\n\t\tString date = LocalDate.now().format(DateTimeFormatter.ofPattern(\"yyMMdd\"));\n\t\tString key = s +\"_\" + date;\n\t\t//com.incr(key);\n\t\tredisTemplate.opsForValue().increment(key);\n\t\tInteger num = redisTemplate.opsForValue().get(key);\n\t\treturn date + \"-\" + String.format(\"%08d\",num);\n\t}", "private long generateID() {\n\t\treturn ++lastID;\n\t}", "private String generateNewCallId()\n {\n\n\t\t// Generate the variant number\n\t\tint variable = NumberUtils.getIntRandom();\n\n\t\t// Convert to hex value\n\t\tString hex = NumberUtils.toHexValue(variable);\n\n\t\t// Compose the final call id\n\t\treturn \"{2B073406-65D8-A7B2-5B13-B287\" + hex + \"}\";\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 }", "public static String generateEmpID() {\n\tempID++;\n\treturn String.valueOf(empID);\n }", "String getUniqueId();", "public static String generateId(String prefix) {\n\t\tlong now = System.currentTimeMillis();\n\t\tlong randomLong = Math.round(Math.random() * 89999) + 10000;\n\t\treturn (prefix + now + \"-\" + randomLong);\n\t}", "public static String generateDeviceToken() throws EndlosException {\n\t\treturn hash(Utility.generateUuid() + DateUtility.getCurrentEpoch());\n\t}", "public String getNextID() {\n String id = \"am\" + Integer.toString(nextID);\n nextID++;\n return id;\n }", "public static String uniqueId() {\r\n return UUID.randomUUID().toString();\r\n }", "private void generateID(){\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor (String t : terms.keySet())\n\t\t\tsb.append(t.replaceAll(\"\\\\W\", \"\")\n\t\t\t\t\t.substring(0, Math.min(4, t.replaceAll(\"\\\\W\", \"\").length())) + \"-\");\n\t\tfor (String s : sources)\n\t\t\tsb.append(s.replaceAll(\"\\\\W\", \"\")\n\t\t\t\t\t.substring(0, Math.min(4, s.replaceAll(\"\\\\W\", \"\").length())) + \"-\");\n\t\tsb.deleteCharAt(sb.length()-1);\n\t\tif (yearFrom > -1) sb.append(\"_\" + yearFrom);\n\t\tif (yearTo > -1) sb.append(\"_\" + yearTo);\n\t\tif (useCompounds) sb.append(\"_COMP\");\n\t\tif (useStopwords) sb.append(\"_STOP\");\n\t\tsb.append(\"_CNT\" + contextSize);\n\t\tsb.append(\"_\" + System.currentTimeMillis());\n\t\tthis.id = sb.toString();\n\t}", "public static String uniqueId() {\n return UUID.randomUUID().toString();\n }", "int getSessionId();", "public static String secureRandomId() {\n\t\tSecureRandom random = new SecureRandom();\n\t\treturn new BigInteger(130, random).toString(32);\n\t}", "public static int generateUniqueId(){\r\n String returnme = GregorianCalendar.getInstance().getTimeInMillis() + \"\";\r\n return Integer.parseInt(returnme.substring(returnme.length() - 9, returnme.length()));\r\n }", "String renewSessionId(String oldId, String newId);", "public String getSessionID() {\n\t\treturn SID;\n\t}", "@Override\n public java.lang.String generateRackID() {\n String randomString = \"\";\n String rackId = \"\";\n for (int i = 0; i < 2; i++) {\n char[] arr = \"abcdefghijklmnopqrstuvwxyz\".toCharArray();\n int select = new Random().nextInt(arr.length);\n randomString += arr[select];\n }\n\n rackId = randomString.toUpperCase() + \".\" + rackCounter + \".\" + copyrightYear;\n rackCounter++;\n return rackId;\n }", "String getIdentityId();", "String createUniqueID(String n){\n String uniqueID =UUID.randomUUID().toString();\n return n + uniqueID;\n }", "protected String getNextID(String prefix) {\n return String.format(\"%s-%s\", prefix, UUID.randomUUID().toString()) ;\n }", "private static String obtainSessionID(ApiContext apiContext) throws Exception {\n GetSessionIDCall apiCall = new GetSessionIDCall(apiContext);\n\n apiCall.setRuName(ruName);\n String sessionID = apiCall.getSessionID();\n //Handle the result returned\n logger.info(\"sessionID : \" + sessionID);\n return sessionID;\n }", "protected String getSessionID(Session session) {\n String[] authorizationValues = session.getUpgradeRequest().getHeader(\"Authorization\").split(\":\");\n if (authorizationValues.length < 3) {\n session.close(HttpStatus.BAD_REQUEST_400, \"Invalid Authorization header.\");\n }\n return Player.getPlayer(authorizationValues[2]).getSession().getSessionID();\n\n }", "private Long createId() {\n return System.currentTimeMillis() % 1000;\n }", "private synchronized int generateJobID() {\n\t\t/* generate JobID */\n\t\tint jobID = lastJobID;\n\t\tlastJobID += 1;\n\t\treturn jobID;\n\t}", "public synchronized String generateCallIdentifier(String address) {\n String date = new Long(System.currentTimeMillis() + callIDCounter++ + rand.nextLong()).toString();\n byte cid[] = digester.digest(date.getBytes());\n String cidString = Utils.toHexString(cid);\n return cidString + \"@\" + address;\n }", "public static String generate() {\n return StringUtil.join(\n '.',\n PROCESS_ID,\n String.valueOf(Thread.currentThread().getId()),\n String.valueOf(THREAD_ID_SEQUENCE.get().nextSeq())\n );\n }", "protected String generateUserID() {\n Random r = new Random();\n String userID;\n do {\n int randomIDnum = r.nextInt(999999999) + 1;\n userID = String.valueOf(randomIDnum);\n } while (this.userMap.containsKey(userID));\n return userID;\n }", "private String generateNewPassword() throws Exception\n {\n if(this.weblisketSession != null && \n this.weblisketSession.getId() != null)\n {\n int startIndex = this.weblisketSession.getId().length();\n if(startIndex >= 8)\n {\n return this.weblisketSession.getId().substring(startIndex - 8);\n }\n else\n {\n throw new Exception(\"Error Generating New Password\");\n }\n }\n else\n {\n throw new Exception(\"No Session Available For Generating New Password\");\n }\n }", "String getSessionKey(String sessionId) {\n return this.namespace + \"sessions:\" + sessionId;\n }", "public String getID()\n\t{\n\t return this.sessionID;\n\t}", "public int genID() {\n int uid = this.hashCode();\n if (uid < 0) {\n uid = Math.abs(uid);\n uid = uid * 15551;\n }\n return uid;\n }", "public String getSessionId() {\n// synchronized (mSessionObj) {\n// return mSessionId;\n// }\n return \"\";\n }", "public static byte[] generateClientId() {\n byte[] selfBytes = getIpAddressBytes();\n Long pid = getPid();\n long tid = Thread.currentThread().getId();\n long ts = EnvironmentEdgeManager.currentTime();\n\n byte[] id = new byte[selfBytes.length + ((pid != null ? 1 : 0) + 2) * Bytes.SIZEOF_LONG];\n int offset = Bytes.putBytes(id, 0, selfBytes, 0, selfBytes.length);\n if (pid != null) {\n offset = Bytes.putLong(id, offset, pid);\n }\n offset = Bytes.putLong(id, offset, tid);\n offset = Bytes.putLong(id, offset, ts);\n assert offset == id.length;\n return id;\n }", "public void generateID()\n {\n ID = this.hashCode();\n }", "public String getSessionID ()\n\t{\n\t\treturn sessionID;\n\t}" ]
[ "0.79100156", "0.76930946", "0.76070315", "0.74665433", "0.7451721", "0.7435462", "0.7375507", "0.73078024", "0.72586393", "0.7238921", "0.7136481", "0.710158", "0.7082865", "0.7054333", "0.7043815", "0.70297563", "0.70230275", "0.70230275", "0.68169284", "0.68159676", "0.68089426", "0.6789567", "0.6767915", "0.67616814", "0.67588824", "0.6744554", "0.67159903", "0.6698059", "0.6698059", "0.6684909", "0.6684909", "0.66819656", "0.66737616", "0.664343", "0.664343", "0.663756", "0.66374224", "0.66270393", "0.6608137", "0.6608137", "0.66018915", "0.66006047", "0.65857375", "0.65857375", "0.65857375", "0.65857375", "0.65815806", "0.6578018", "0.6578018", "0.6574509", "0.6574114", "0.65728366", "0.6554132", "0.6552355", "0.650509", "0.65016735", "0.6490734", "0.648453", "0.6453325", "0.64527094", "0.64365256", "0.64187354", "0.641627", "0.64015216", "0.6369719", "0.6368659", "0.63668704", "0.6340855", "0.63364017", "0.63321584", "0.63051295", "0.628627", "0.6276332", "0.62747073", "0.62643075", "0.6251688", "0.6248002", "0.62464666", "0.62446463", "0.62191534", "0.6206003", "0.61931", "0.6185759", "0.6183724", "0.61802334", "0.6172214", "0.61645097", "0.6144116", "0.6143945", "0.6140666", "0.6111133", "0.6111071", "0.6106954", "0.609604", "0.6086975", "0.6077142", "0.6074502", "0.60735303", "0.607329", "0.6073014" ]
0.66036683
40
Clear runtime and persisted value for SESSION_ID.
static void beginNewSession() { SESSION_ID = null; Prefs.INSTANCE.setEventPlatformSessionId(null); // A session refresh implies a pageview refresh, so clear runtime value of PAGEVIEW_ID. PAGEVIEW_ID = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void unsetSessionID();", "void clearSession();", "void clearSession();", "public void logout(){\r\n\t\tallUser.remove(this.sessionID);\r\n\t\tthis.sessionID = -1;\r\n\t}", "public Builder clearSessionId() {\n \n sessionId_ = 0;\n onChanged();\n return this;\n }", "public Builder clearSessionID() {\n \n sessionID_ = getDefaultInstance().getSessionID();\n onChanged();\n return this;\n }", "public Builder clearSessionID() {\n \n sessionID_ = getDefaultInstance().getSessionID();\n onChanged();\n return this;\n }", "@CallSuper\n public void clearSession() {\n callback = null;\n }", "public Builder clearSessionId() {\n bitField0_ = (bitField0_ & ~0x00000001);\n sessionId_ = getDefaultInstance().getSessionId();\n onChanged();\n return this;\n }", "public void clearSession(){\n mIsLoggedIn = false;\n mUser = null;\n clearSharedPreference();\n }", "void flushAndClearSession();", "public Builder clearSessionId() {\n bitField0_ = (bitField0_ & ~0x00000800);\n sessionId_ = 0;\n onChanged();\n return this;\n }", "public void clearUserSession() {\n editor.clear();\r\n editor.commit();\r\n }", "public void clearSessionCache() {\n ofy().clear();\n }", "@Override\n\tpublic void logout() {\n\t\tsessionService.setCurrentUserId(null);\n\t}", "DefaultSession removeSession(String id, boolean invalidate);", "@Override\n\tpublic void clearSession() throws Exception {\n\t\t\n\t}", "public Builder clearClientSessionID() {\n bitField0_ = (bitField0_ & ~0x00000002);\n clientSessionID_ = 0;\n onChanged();\n return this;\n }", "public static void reset() {\n Castle.userId(null);\n Castle.flush();\n }", "private void clearSessionManager(HttpSession p_session)\n {\n SessionManager sessionMgr =\n (SessionManager)p_session.getAttribute(SESSION_MANAGER);\n\n sessionMgr.clear();\n }", "public void clearTid() {\n genClient.clear(CacheKey.tid);\n }", "public void clearStoreId() {\n genClient.clear(CacheKey.storeId);\n }", "private void clearId() {\n \n id_ = 0;\n }", "private Session() {\n userId = -1;\n onUserDeletion = null;\n }", "protected final void closeSessionAndClearTokenInformation() {\n Session currentSession = sessionTracker.getOpenSession();\n if (currentSession != null) {\n currentSession.closeAndClearTokenInformation();\n }\n }", "public static void clearSavedSession(Context context) \n {\n Editor editor = context.getSharedPreferences(KEY, Context.MODE_PRIVATE).edit();\n editor.clear();\n editor.commit();\n singleton = null;\n }", "public void clearSessionFile() {\n try {\n sessionData = new File(wnwData, \"session.dat\");\n sessionData.createNewFile();\n BufferedWriter bufferedWriter = new BufferedWriter(\n new FileWriter(new File(wnwData, \"session.dat\")));\n bufferedWriter.write(\"\");\n bufferedWriter.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "public void resetUUID() {\n sp.edit().remove(UUID_SP_KEY).commit();\n }", "static String getSessionId() {\n if (SESSION_ID == null) {\n // If there is no runtime value for SESSION_ID, try to load a\n // value from persistent store.\n SESSION_ID = Prefs.INSTANCE.getEventPlatformSessionId();\n\n if (SESSION_ID == null) {\n // If there is no value in the persistent store, generate a new value for\n // SESSION_ID, and write the update to the persistent store.\n SESSION_ID = generateRandomId();\n Prefs.INSTANCE.setEventPlatformSessionId(SESSION_ID);\n }\n }\n return SESSION_ID;\n }", "@Override\n public void valueUnbound(HttpSessionBindingEvent arg0) {\n System.out.println(\"在session中移除LoginUser对象(name = \"+ this.getName() +\"), sessionid = \" + arg0.getSession().getId());\n }", "@Override\r\n \t\t\tpublic void deleteSessions() {\n \t\t\t\t\r\n \t\t\t}", "private boolean delete() {\r\n\t\tboolean rtn = false;\r\n\t\ttry {\r\n\t\t\tif ( _where != null ) {\r\n\t\t\t\tif (_where.has(SESSIONID)) {\r\n\t\t\t\t\tString id = _where.getString(SESSIONID);\r\n\t\t\t\t\tif (id.equalsIgnoreCase(ALL)) {\r\n\t\t\t\t\t\trtn = SessionMgr.removeAllSessions();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\trtn = SessionMgr.removeSession(id);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if (_session != null) {\r\n\t\t\t\tSessionMgr.removeSession(_session.getKey());\r\n\t\t\t\t_session = null;\r\n\t\t\t\t_dbi.clearSession();\r\n\t\t\t}\r\n\t\t\trtn = true;\r\n\t\t} catch (Exception e) {\r\n\t\t\tsetError(e);\r\n\t\t} finally {\r\n\t\t\tif (_transaction != null) {\r\n\t\t\t\t_transaction.setSession(_session);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn rtn;\r\n\t}", "private void clearUserId() {\n \n userId_ = 0L;\n }", "public void clearSharedPreferences(){\n\n //clear user session data\n SharedPreferences.Editor editor = mSharedPreferences.edit();\n editor.clear();\n editor.apply();\n\n }", "private void clearUserId() {\n\n userId_ = 0L;\n }", "public void logout() {\n loggedIn = \"\";\n FacesContext.getCurrentInstance().getExternalContext()\n .getSessionMap().put(\"loggedIn\", \"\");\n }", "public void destroySession() {\n existingSession().ifPresent(session -> {\n session.clear();\n context().session().clear();\n });\n }", "public abstract void setIdSession(String id_session);", "@Override\r\n \t\t\tpublic void cleanInvalidSessions() {\n \t\t\t\t\r\n \t\t\t}", "private void clearUserId() {\n \n userId_ = 0;\n }", "public void deleteSession(int uid);", "public synchronized void logout(String session_id){\r\n try {\r\n dao.deleteUserBySession(session_id);\r\n }catch(Exception e) {\r\n ExceptionBroadcast.print(e);\r\n }\r\n }", "private void clearAId() {\n \n aId_ = 0;\n }", "public void invalidateSessionobjects(){\n\n\t}", "@Override\r\n \t\t\tpublic void deleteSession(long sessionId) throws SSessionNotFoundException {\n \t\t\t\t\r\n \t\t\t}", "public String getID()\n\t{\n\t return this.sessionID;\n\t}", "void setSessionID(java.lang.String sessionID);", "@Override\n\tpublic void deleteSession(String sessionId) {\n\t\t\n\t}", "private void clearRoomId() {\n \n roomId_ = 0L;\n }", "@Override\n\tpublic void exitSessionUser() {\n\t\tgetThreadLocalRequest().getSession().invalidate();\n\t\t\n\t}", "public void resetIdentificador()\r\n {\r\n this.identificador = null;\r\n }", "public void changeSessionId(Session session);", "@Override\n\tpublic Boolean logout()\n\t\t\tthrows UnknownException {\n HttpSession sesion = this.getThreadLocalRequest().getSession();\n sesion.removeAttribute(\"beanusuario\");\n sesion.removeAttribute(\"idsession\"); \n sesion.invalidate(); \n return true;\n\t}", "public static void resetIdCounter(){\n idCounter = 0;\n }", "private void clearOtherId() {\n \n otherId_ = 0;\n }", "public void logout() {\n getRequest().getSession().invalidate();\n }", "public void setSessionId(int value) {\n this.sessionId = value;\n }", "void unsetID();", "private void clearUserId() {\n \n userId_ = getDefaultInstance().getUserId();\n }", "@Override\n\tpublic void sessionDestroyed(HttpSessionEvent arg0) {\n\t\tSet all = (Set)this.use.getAttribute(\"onlineuser\");//取出设置的集合\n\t\tall.remove(arg0.getSession().getAttribute(\"userid\"));//取出session中设置的内容\n\t\tthis.use.setAttribute(\"onlineuser\", all);//将更新的集合重新保存\n\t}", "private void clearAid() {\n \n aid_ = 0;\n }", "public void logOut() {\n sp.edit().clear().commit();\n }", "public void logout(int sessionId);", "public void removeOIDCSessionState(String sessionId) {\n\n OIDCSessionParticipantCacheKey cacheKey = new OIDCSessionParticipantCacheKey();\n cacheKey.setSessionID(sessionId);\n\n OIDCSessionParticipantCache.getInstance().clearCacheEntry(cacheKey);\n }", "public static void resetId() {\r\n nextid=1;\r\n }", "public void remove() {\n session.removeAttribute(\"remoteUser\");\n session.removeAttribute(\"authCode\");\n setRemoteUser(\"\");\n setAuthCode(AuthSource.DENIED);\n }", "void clearSessionTaxDocument();", "@Path(\"/{id}\")\n @DELETE\n public Response removeSession(@PathParam(\"id\") Long id) {\n log.debug(\"REST request to delete Session : {}\", id);\n sessionRepository.remove(sessionRepository.find(id));\n return HeaderUtil.createEntityDeletionAlert(Response.ok(), \"session\", id.toString()).build();\n }", "void unsetId();", "public void reset() throws SQLException {\n final Session[] s;\n synchronized (sessions) {\n s = sessions.values().toArray(new Session[sessions.size()]);\n sessions.clear();\n }\n /*\n * The calls to Session.close() must be performed\n * outside the synchronized (sessions) block.\n */\n for (final Session session : s) {\n session.close();\n }\n locale = null;\n }", "public void unsetId()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_attribute(ID$6);\n }\n }", "void unsetSOID();", "public void endSession(){\n currentUser = null;\n ui.returnCard();\n }", "@Test\r\n public void testRemoveSession() {\r\n System.out.println(\"removeSession\");\r\n assertNotNull(sm);\r\n boolean res = sm.initSession(\"test4\", programsHome, programsHome + \"files4/\", requester);\r\n assertTrue(res);\r\n \r\n ISimulationSessionInfo result = sm.getSession(\"test4\");\r\n assertNotNull(result);\r\n assertEquals(result.getRequester(), \"junit\");\r\n \r\n res = sm.removeSession(\"test4\");\r\n assertTrue(res);\r\n \r\n result = sm.getSession(\"test4\");\r\n assertNull(result);\r\n }", "public int deleteSession(Session session) {\n\t\treturn (int)sqlSession.delete(\"sessionMapper.deleteSession\", session);\r\n\t}", "void clearSessionListeners();", "public void unsetID()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_attribute(ID$12);\n }\n }", "public void unsetID()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_attribute(ID$12);\n }\n }", "public void reset() {\r\n id = -1;\r\n username = \"\";\r\n password = \"\";\r\n password2 = \"\";\r\n firstName = \"\";\r\n lastName = \"\";\r\n phoneNumber = \"\";\r\n email = \"\";\r\n address = \"\";\r\n socialSecurityNumber = \"\";\r\n creditCard = \"\";\r\n }", "public static void logout(HttpSession session) {\n session.invalidate();\n }", "synchronized void removeSession(Session session) {\n sessionMap.remove(session.getId());\n }", "public Builder clearSession() {\n if (sessionBuilder_ == null) {\n session_ = com.weizhu.proto.WeizhuProtos.Session.getDefaultInstance();\n onChanged();\n } else {\n sessionBuilder_.clear();\n }\n bitField0_ = (bitField0_ & ~0x00000002);\n return this;\n }", "private void logOut() {\n mApi.getSession().unlink();\n\n // Clear our stored keys\n clearKeys();\n // Change UI state to display logged out version\n setLoggedIn(false);\n }", "private void clearObjId() {\n \n objId_ = 0;\n }", "private void clearObjId() {\n \n objId_ = 0;\n }", "private void clearObjId() {\n \n objId_ = 0;\n }", "private void clearObjId() {\n \n objId_ = 0;\n }", "private void clearObjId() {\n \n objId_ = 0;\n }", "private void clearObjId() {\n \n objId_ = 0;\n }", "default void onReset(SessionID sessionID) {\n }", "public void unsetID()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_attribute(ID$24);\n }\n }", "public com.google.protobuf.ByteString\n getSessionIDBytes() {\n Object ref = sessionID_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n sessionID_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }" ]
[ "0.771529", "0.7062069", "0.7062069", "0.6935856", "0.690199", "0.68141145", "0.68141145", "0.6720807", "0.66397625", "0.6595207", "0.656341", "0.648447", "0.64819235", "0.646374", "0.642281", "0.63153046", "0.6261957", "0.62231314", "0.6202749", "0.61566377", "0.6128726", "0.61285293", "0.61162925", "0.6089315", "0.6083873", "0.6074163", "0.6042748", "0.6018031", "0.6018031", "0.6018031", "0.6018031", "0.6018031", "0.6018031", "0.6018031", "0.6013485", "0.60063", "0.5998012", "0.5955952", "0.5940911", "0.5911431", "0.59096074", "0.5907123", "0.5866704", "0.58565456", "0.58535504", "0.58466786", "0.58424234", "0.58151346", "0.5806864", "0.5780933", "0.5779506", "0.5750895", "0.5733572", "0.57282877", "0.5723665", "0.57209474", "0.57182866", "0.57026565", "0.5692221", "0.5687472", "0.5679976", "0.5672553", "0.56719464", "0.56668895", "0.56631696", "0.56594175", "0.56554234", "0.5648496", "0.5621815", "0.5611694", "0.56084204", "0.55932605", "0.55814314", "0.55766547", "0.55738455", "0.5560083", "0.5559262", "0.5558453", "0.5553045", "0.5519097", "0.54851824", "0.5479808", "0.54791176", "0.54638743", "0.54491556", "0.54491556", "0.5446088", "0.54418236", "0.54353434", "0.54331005", "0.54295975", "0.5420041", "0.5420041", "0.5420041", "0.5420041", "0.5420041", "0.5420041", "0.5415106", "0.54124755", "0.540698" ]
0.5743684
52
/ CompletableFuture future; future.whenComplete();
@RequestMapping(value="/dubbo/say/{name}") public String sayHello(@PathVariable("name") String name){ int c = count.incrementAndGet(); log.info( "调用次数 = " + c); String result=remoteUserService.sayHello( c+""); log.info("result = " + result); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void whenComplete();", "CompletableFuture<WebClientServiceResponse> whenComplete();", "void complete();", "void complete();", "CompletableFuture<Void> next();", "@Override\r\n\t\tpublic void operationComplete(ChannelProgressiveFuture future) {\n }", "public void operationComplete(Future<Response> future) throws Exception {\n }", "@Override\n public void operationComplete(Future<Void> future) throws Exception{\n if(!future.isSuccess()){\n olapFuture.fail(future.cause());\n olapFuture.signal();\n }\n }", "boolean complete();", "@Test\n public void thenAccept() {\n StringBuilder result = new StringBuilder();\n CompletableFuture.completedFuture(\"thenAccept message\")\n .thenAccept(s -> result.append(s));\n assertTrue(\"Result was empty\", result.length() > 0);\n }", "@Override\n\tpublic void complete()\n\t{\n\t}", "protected void completeFuturesForFauxInstances() {\n }", "@Test\n public void thenApply() {\n CompletableFuture<String> cf = CompletableFuture.completedFuture(\"message\")\n .thenApply(s -> {\n assertFalse(Thread.currentThread().isDaemon());\n System.out.println(Thread.currentThread().getName());\n return s.toUpperCase();\n });\n System.out.println(Thread.currentThread().getName());\n assertEquals(\"MESSAGE\", cf.getNow(null));\n }", "public void complete() {\n\t}", "@Override\n public void operationComplete(ChannelFuture future) throws Exception {\n if (!future.isSuccess()) {\n Throwable cause = future.cause();\n // Do something\n }\n }", "@Override\n\t\tpublic void operationComplete(ChannelFuture arg0) throws Exception {\n\t\t\t\n\t\t}", "default void accept(CompletableFuture<? extends T> future) {\n future.handle((value, failure) -> {\n if (failure == null) {\n success(value);\n } else {\n error(failure);\n }\n\n return null;\n });\n }", "private void supplyAsyncThenApply() {\n CompletableFuture<String> completableFuture\n = CompletableFuture.supplyAsync(() -> {\n sleep();\n return \"Hello from \" + Thread.currentThread().getName();\n });\n\n CompletableFuture<String> future = completableFuture\n .thenApply(s -> s + \" World from \" + Thread.currentThread().getName());\n\n try {\n String s = future.get();\n System.out.println(\"supplyAsyncThenApply : \" + s);\n } catch (InterruptedException e) {\n e.printStackTrace();\n } catch (ExecutionException e) {\n e.printStackTrace();\n }\n }", "@Override\r\n\tpublic void complete() {\n\r\n\t}", "public static void main(String[] args) throws InterruptedException, ExecutionException {\n CompletableFuture<String> future = CompletableFuture.supplyAsync(new Supplier<String>() {\n @Override\n public String get() {\n try {\n TimeUnit.SECONDS.sleep(1);\n } catch (InterruptedException e) {\n throw new IllegalStateException(e);\n }\n return \"Result of the asynchronous computation\";\n }\n });\n\n// Block and get the result of the Future\n String result = future.get();\n System.out.println(result);\n }", "@Override\n \t\t\t\tpublic void operationComplete(ChannelFuture future) throws Exception {\n \t\t\t\t\tif (future.isSuccess()) {\n \t\t\t\t\t\tdetermineNextChannelAction(channel, currentSequenceNumber + 1, follow);\n \t\t\t\t\t}\n \t\t\t\t}", "Single<WebClientServiceResponse> whenComplete();", "Single<WebClientServiceResponse> whenComplete();", "@Test\n public void supplierCompletableFutureTest3() throws ExecutionException, InterruptedException {\n CompletableFuture<Void> cf1 = CompletableFuture.supplyAsync(() -> PiCalculator.computePi(400).toString()).thenAccept(s -> {\n this.result = s;\n });\n CompletableFuture<Void> cf2 = CompletableFuture.supplyAsync(() -> PiCalculator.computePi(40).toString()).thenAccept(s -> {\n this.result = s;\n });\n\n CompletableFuture<Void> cfAll = CompletableFuture.allOf(cf1, cf2);\n\n // Wacht tot taak klaar is\n cfAll.get();\n\n Assert.assertThat(result, Matchers.is(\"3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094\"));\n }", "Future<T> then(Runnable result);", "boolean completed();", "@SuppressWarnings(\"SynchronizationOnLocalVariableOrMethodParameter\") // I know what I'm doing - famous last words.\n private static void awaitCompletion(final HashMultimap<UUID, Future<Void>> handles) {\n final Set<Future<Void>> futures;\n synchronized (handles) {\n futures = new HashSet<>(handles.values());\n handles.clear();\n }\n\n for (final Future<Void> future : futures) {\n await(future);\n }\n }", "void completeJob();", "native public <U> Promise<U> then();", "public void complete(T paramT)\n/* */ {\n/* 632 */ setRawResult(paramT);\n/* 633 */ onCompletion(this);\n/* 634 */ quietlyComplete();\n/* 635 */ CountedCompleter localCountedCompleter; if ((localCountedCompleter = this.completer) != null) {\n/* 636 */ localCountedCompleter.tryComplete();\n/* */ }\n/* */ }", "public Status waitUntilFinished();", "public static void main(String[] args) {\n System.out.println(\"Begin\");\n //create().thenAccept(data-> print(data));\n //CompletableFuture<Integer> cFuture=create();\n CompletableFuture<Integer> cFuture=new CompletableFuture<>();\n process(cFuture);\n try {\n Thread.sleep(2000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n cFuture.complete(3);\n System.out.println(\"END\");\n }", "public void complete()\n {\n isComplete = true;\n }", "@Test\n\tvoid contextLoads() throws InterruptedException {\n\t\t\n\t\tSystem.out.println(\"Starting method 1\");\n\t\t\n\t\tCompletableFuture<Void> x1 = CompletableFuture.runAsync(() -> this.completableFutureService.method(1));\t\t\n\t\t\n\t\tThread.sleep(1000);\n\t\t\n\t\tSystem.out.println(\"Starting method 2\");\n\t\t\n\t\tCompletableFuture<Void> x2 = CompletableFuture.runAsync(() -> this.completableFutureService.method(2));\t\t\n\t\t\n\t\tThread.sleep(500);\n\t\t\n\t\tSystem.out.println(\"Starting method 3\");\n\t\t\n\t\tCompletableFuture<Void> x3 = CompletableFuture.runAsync(() -> this.completableFutureService.method(3));\t\t\n\t\t\n\t\tSystem.out.println(\"Pass from three methods... \");\n\t\t\n\t\tVoid combinedResults = CompletableFuture.allOf(x1, x2, x3).join();\n\t\t\n\t\tassertTrue(x1.isDone());\n\t\tassertTrue(x2.isDone());\n\t\tassertTrue(x3.isDone());\n\t\t\n\t}", "void done();", "@Test\n public void testTake() {\n \tBoundedCompletionService<String> ecs = new BoundedCompletionService<String>(\n new ExecutorCompletionService<String>(e));\n try {\n Callable<String> c = new StringTask();\n ecs.submit(c);\n Future<String> f = ecs.take();\n Assert.assertTrue(f.isDone());\n } catch (Exception ex) {\n unexpectedException();\n }\n }", "@Override\n public void done() {\n }", "@Override\n public void done() {\n }", "@Override\n\t\tpublic void onCompleted() {\n\t\t}", "public static void main(String[] args) throws InterruptedException {\n\r\n FutureService futureService = new FutureService();\r\n Future<String> future = futureService.submit(() -> {\r\n try {\r\n Thread.sleep(10_000);\r\n } catch (InterruptedException e) {\r\n e.printStackTrace();\r\n }\r\n return \"FINISH\";\r\n }, System.out::println);\r\n System.out.println(\"================\");\r\n System.out.println(\"do other thing.\");\r\n Thread.sleep(1_000L);\r\n System.out.println(\"================\");\r\n\r\n// System.out.println(future.get());\r\n }", "public interface Future\n{\n\n public abstract boolean cancel(boolean flag);\n\n public abstract boolean isCancelled();\n\n public abstract boolean isDone();\n\n public abstract Object get()\n throws ExecutionException, InterruptedException;\n\n public abstract Object get(long l, TimeUnit timeunit)\n throws ExecutionException, InterruptedException, TimeoutException;\n}", "@SuppressWarnings(\"SynchronizationOnLocalVariableOrMethodParameter\") // I know what I'm doing - famous last words.\n private static void awaitCompletion(final HashMultimap<UUID, Future<Void>> handles, final UUID handle) {\n final Set<Future<Void>> futures;\n synchronized (handles) {\n futures = handles.removeAll(handle);\n }\n\n for (final Future<Void> future : futures) {\n await(future);\n }\n }", "@Override\n\t\t\t\t\tpublic void onComplete() {\n\t\t\t\t\t}", "@Test\n public void thenCompose() {\n String original = \"Message\";\n CompletableFuture<String> cf = CompletableFuture\n .completedFuture(original)\n .thenApply(s -> delayedUpperCase(s))\n .thenCompose(upper -> CompletableFuture\n .completedFuture(original)\n .thenApply(s -> delayedLowerCase(s))\n .thenApply(s -> upper + s));\n assertEquals(\"MESSAGEmessage\", cf.join());\n }", "public static void complete(com.google.common.util.concurrent.AbstractFuture<?> r6) {\n /*\n r1 = 0\n L_0x0001:\n r6.releaseWaiters()\n r6.afterDone()\n com.google.common.util.concurrent.AbstractFuture$Listener r1 = r6.clearListeners(r1)\n r6 = 0\n L_0x000c:\n if (r1 == 0) goto L_0x0035\n r0 = r1\n com.google.common.util.concurrent.AbstractFuture$Listener r1 = r1.next\n java.lang.Runnable r3 = r0.task\n boolean r5 = r3 instanceof com.google.common.util.concurrent.AbstractFuture.SetFuture\n if (r5 == 0) goto L_0x002f\n r2 = r3\n com.google.common.util.concurrent.AbstractFuture$SetFuture r2 = (com.google.common.util.concurrent.AbstractFuture.SetFuture) r2\n com.google.common.util.concurrent.AbstractFuture<V> r6 = r2.owner\n java.lang.Object r5 = r6.value\n if (r5 != r2) goto L_0x000c\n com.google.common.util.concurrent.ListenableFuture<? extends V> r5 = r2.future\n java.lang.Object r4 = getFutureValue(r5)\n com.google.common.util.concurrent.AbstractFuture$AtomicHelper r5 = com.google.common.util.concurrent.AbstractFuture.ATOMIC_HELPER\n boolean r5 = r5.casValue(r6, r2, r4)\n if (r5 == 0) goto L_0x000c\n goto L_0x0001\n L_0x002f:\n java.util.concurrent.Executor r5 = r0.executor\n executeListener(r3, r5)\n goto L_0x000c\n L_0x0035:\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.common.util.concurrent.AbstractFuture.complete(com.google.common.util.concurrent.AbstractFuture):void\");\n }", "public interface WriteFuture extends Future {\n}", "void onComplete();", "public interface IAsyncComplete<T> {\n \n public abstract void onComplete(T result);\n \n}", "boolean isCompleted();", "public void done();", "public void done();", "public void done();", "static CompletableFuture<String> callAsync(Api2 ignored) {\n return CompletableFuture.supplyAsync(() -> {\n System.out.println(\"supplyAsync thread =:\" + Thread.currentThread().getName());\n throw new RuntimeException(\"oops\");\n });\n }", "public abstract T await();", "public void onFetchCompleted () {}", "public void onCompletion();", "public interface CompletionHandler {\n void complete(String retValue);\n void complete();\n void setProgressData(String value);\n}", "CompletableFuture<WriteResponse> submit();", "void requestComplete(UUIDBase uuid, OpResult opResult) {\n recentCompletions.incrementAndGet();\n _requestComplete(uuid, opResult);\n /*\n try {\n completionQueue.put(new Pair<>(uuid, opResult));\n } catch (InterruptedException e) {\n throw new RuntimeException(\"Unexpected interruption\");\n }\n */\n }", "public boolean hasFuture();", "@Override\r\n\tpublic void done() {\n\t\t\r\n\t}", "@Override\n public void onComplete() {\n }", "@Override\n public void onComplete() {\n }", "@Override\n public void onComplete() {\n }", "@Override\n public void onComplete() {\n }", "@Override\n public void onComplete() {\n }", "@Override\n public void onComplete() {\n }", "@Override\n public void onComplete() {\n }", "@Override\n public void onComplete() {\n }", "@Override\n public void onComplete() {\n }", "@Override\n public void onComplete() {\n }", "@Override\n public void onComplete() {\n }", "@Override\n public void onComplete() {\n }", "public ChannelFuture method_4097() {\n return null;\n }", "public void completeData();", "boolean isComplete();", "boolean isComplete();", "void onTaskComplete(T result);", "public void onComplete(T result);", "@Override\r\n\t\t\tpublic void onCompleted() {\n\r\n\t\t\t}", "public abstract boolean isCompleted();", "@Override\n\t\tpublic void done() {\n\n\t\t}", "public void performCompletion() {\n/* 536 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public boolean isComplete();", "Object getCompletionResult();", "@Override\n public void onComplete(long dt) {\n }", "Double getCompletion();", "@Override\r\n\t\t\tpublic void onComplete() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void onComplete() {\n\t\t\t\t\r\n\t\t\t}", "@Override\n public boolean isDone() {\n return future.isDone();\n }", "@NonBlocking\n void success(T value);", "public void completed(final Status status);", "abstract void waitForRehashCompletion();", "public boolean isComplete() {\n return future != null && future.isDone();\n }", "public void onCompleted() {\n\t\t\n\t\t }", "@Override\n public boolean completed() {\n return false;\n }", "public void onComplete() {\n /*\n r3 = this;\n monitor-enter(r3)\n U r0 = r3.l // Catch:{ all -> 0x0022 }\n if (r0 != 0) goto L_0x0007\n monitor-exit(r3) // Catch:{ all -> 0x0022 }\n return\n L_0x0007:\n r1 = 0\n r3.l = r1 // Catch:{ all -> 0x0022 }\n monitor-exit(r3) // Catch:{ all -> 0x0022 }\n d.a.a0.c.e<U> r1 = r3.f13249d\n r1.offer(r0)\n r0 = 1\n r3.f13251f = r0\n boolean r0 = r3.f()\n if (r0 == 0) goto L_0x0021\n d.a.a0.c.e<U> r0 = r3.f13249d\n d.a.s<? super V> r1 = r3.f13248c\n r2 = 0\n d.a.a0.j.q.c(r0, r1, r2, r3, r3)\n L_0x0021:\n return\n L_0x0022:\n r0 = move-exception\n monitor-exit(r3) // Catch:{ all -> 0x0022 }\n throw r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: d.a.a0.e.d.o.b.onComplete():void\");\n }", "public void completeTask() {\n completed = true;\n }", "public abstract boolean isComplete();", "public void set_completed();", "CompletableFuture<?> submit(Runnable request);" ]
[ "0.74045676", "0.73744035", "0.6949901", "0.6949901", "0.68437374", "0.6823878", "0.67956114", "0.67707276", "0.65823305", "0.6571284", "0.65190756", "0.6498955", "0.647786", "0.6415732", "0.6413228", "0.64088476", "0.6403309", "0.63971037", "0.6387294", "0.6320606", "0.62389547", "0.62385905", "0.62385905", "0.618874", "0.61177534", "0.6106523", "0.6091837", "0.60597706", "0.60440594", "0.6042631", "0.60162896", "0.5925897", "0.59168744", "0.5888531", "0.58769614", "0.58616424", "0.58475477", "0.58475477", "0.58406466", "0.58320576", "0.5828595", "0.58260465", "0.5825908", "0.58223635", "0.5820705", "0.5795823", "0.57941544", "0.57653785", "0.5764858", "0.5764118", "0.5764118", "0.5764118", "0.57538944", "0.5739413", "0.5730469", "0.57296985", "0.57288533", "0.57280767", "0.572063", "0.5708861", "0.57034045", "0.57026726", "0.57026726", "0.57026726", "0.57026726", "0.57026726", "0.57026726", "0.57026726", "0.57026726", "0.57026726", "0.57026726", "0.57026726", "0.57026726", "0.56887233", "0.56870294", "0.56815654", "0.56815654", "0.5677476", "0.5676595", "0.5674707", "0.5667102", "0.56666195", "0.5657317", "0.56509656", "0.56494963", "0.5642836", "0.56337786", "0.56284016", "0.56284016", "0.5627347", "0.562592", "0.5625084", "0.5613115", "0.5610765", "0.56015384", "0.5601257", "0.5600091", "0.5589351", "0.5587894", "0.5586645", "0.55774945" ]
0.0
-1
Parses the given date String and returns a java.util.Date object
public static Date parseDate(String formattedDate) { return parseDate(formattedDate, DEFAULT_DATE_FORMAT); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Date parseDate(String date) {\n return DateUtil.toDate(date);\n }", "public static Date parseDate(String date)\n\t{\n\t\treturn parseFormatDate(date, getDateFormat());\n\t}", "public Date parse (String dateAsString , String dateFormat) throws Exception ;", "public static Date parseDate(String date) {\r\n return parseDateWithPattern(date, \"dd/MM/yyyy\");\r\n }", "public Date parseString(String dateString) throws ParseException {\n return dateFormat.parse(dateString);\n }", "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 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 synchronized Date parseDate(String s) throws ParseException {\n return dateFormat.parse(s);\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 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: */ }", "private static Date convertFromString(String dateString) throws ParseException {\n return new SimpleDateFormat(\"yyyyMMddHHmm\").parse(dateString);\n }", "@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 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 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 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 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 parseDateTime(String date)\n\t{\n\t\treturn parseFormatDate(date, getDateTimeFormat());\n\t}", "public Date convertStringToDate(String s) throws ParseException {\n\t\tDate dateTime = SDF.parse(s);\n\t\treturn dateTime;\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 static Date convertStringToDate(String date) throws ParseException {\n\t return new SimpleDateFormat(\"yyyy-MM-dd\").parse(date); \n\t}", "public static LocalDate parse(String dateStr) {\n String d = dateStr.substring(0, dateStr.indexOf('T'));\n LocalDate ld = null;\n try {\n ld = LocalDate.parse(d);\n } catch (Exception e) {\n System.err.println(\"Failed to parse datestring \" + dateStr + \" into a LocalDate!\");\n //e.printStackTrace();\n }\n // TODO: review what happens if format is invalid/LocalDate.parse fails - throw error, return null or both?\n return ld;\n }", "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 }", "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 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 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 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 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 }", "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(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 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 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 static Date toDate(String dateStr, SimpleDateFormat format) throws ParseException {\r\n\t\treturn format.parse(dateStr);\r\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 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 Date parse(String input) throws java.text.ParseException {\n\t\treturn new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.S\").parse(input);\n\n\t}", "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 }", "private LocalDateTime parseDate(String s) {\n String[] splitDate = s.split(\" \", 2);\n // Split day, month, year\n String[] splitDateElements = splitDate[0].split(\"/\", 3);\n int day = parseInt(splitDateElements[0]);\n int month = parseInt(splitDateElements[1]);\n int year = parseInt(splitDateElements[2]);\n // Split hours and minutes\n int hours = parseInt(splitDate[1].substring(0, 2));\n int mins = parseInt(splitDate[1].substring(2, 4));\n return LocalDateTime.of(year, month, day, hours, mins);\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 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 }", "public static Date parseHttpDate(String dateString)\n {\n if (dateString == null)\n {\n return null;\n }\n \n TimeZone gmt = TimeZone.getTimeZone(\"GMT\");\n \n for (int i = 0; i < INPUT_FORMATS.length; i++)\n {\n SimpleDateFormat format = new SimpleDateFormat(INPUT_FORMATS[i]);\n format.setTimeZone(gmt);\n try\n {\n return format.parse(dateString);\n }\n catch (ParseException e)\n {\n // try the next pattern\n }\n }\n \n return null;\n }", "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 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 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 }", "@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 parseFedoraDate(String fedoraDateStr) throws ParseException {\r\n return FEDORA_DATE_FORMAT.parse(fedoraDateStr);\r\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 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 }", "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 parseRFC3339Date(String dateString)\n throws java.text.ParseException, IndexOutOfBoundsException {\n\n Date currentDate = new Date();\n \n if (dateString.endsWith(\"Z\")) {\n try {\n SimpleDateFormat s = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'\");\n currentDate = s.parse(dateString);\n } catch (java.text.ParseException pe) {\n pe.printStackTrace();\n }\n return currentDate;\n }\n \n return currentDate;\n }", "public Date parseDate(String date, String format) {\n return this.convertStringToDate(date, format);\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 static LocalDate parseDate(String dateString)\n throws DateTimeParseException {\n\n // this parses '2011-12-03', timezone information ignored\n return LocalDate.parse(dateString, DateTimeFormatter.ISO_LOCAL_DATE);\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 }", "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 static LocalDate parse(String dateString){\r\n\t\t\r\n\t\ttry{\r\n\t\t\t//below LocalDate::from means use method from in LocalDate(?)\r\n\t\t\treturn DATE_FORMATTER.parse(dateString,LocalDate::from);\r\n\t\t}\r\n\t\tcatch (DateTimeParseException e){\r\n\t\t\treturn null;\t\t\r\n\t\t}\r\n\t}", "public java.util.Date parse(java.lang.String r4, java.text.ParsePosition r5) {\n /*\n r3 = this;\n boolean r0 = r3.looksLikeISO8601(r4)\n if (r0 == 0) goto L_0x000b\n java.util.Date r4 = r3.parseAsISO8601(r4, r5)\n return r4\n L_0x000b:\n int r0 = r4.length()\n L_0x000f:\n int r0 = r0 + -1\n if (r0 < 0) goto L_0x0021\n char r1 = r4.charAt(r0)\n r2 = 48\n if (r1 < r2) goto L_0x0021\n r2 = 57\n if (r1 <= r2) goto L_0x0020\n goto L_0x0021\n L_0x0020:\n goto L_0x000f\n L_0x0021:\n if (r0 >= 0) goto L_0x0034\n r0 = 0\n boolean r0 = com.fasterxml.jackson.core.p007io.NumberInput.inLongRange(r4, r0)\n if (r0 == 0) goto L_0x0034\n java.util.Date r5 = new java.util.Date\n long r0 = java.lang.Long.parseLong(r4)\n r5.<init>(r0)\n return r5\n L_0x0034:\n java.util.Date r4 = r3.parseAsRFC1123(r4, r5)\n return r4\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.fasterxml.jackson.databind.util.StdDateFormat.parse(java.lang.String, java.text.ParsePosition):java.util.Date\");\n }", "public static Date parseDateTime(String str)\n {\n if(Empty.isEmpty(str))\n return null;\n if(str.length() <= 10)\n return parse(str);\n try{\n \treturn (new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\")).parse(str);\n\t\t}catch(ParseException e){\n\t\t \t return null;\n\t\t}\n }", "public static Date parseDate(String dateString, String userId) throws ParseException\n\t{\n\t\tif ((dateString == null) || (dateString.trim().length() == 0)) return null;\n\t\tDateFormat format = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT, getPreferredLocale(userId));\n\t\tformat.setTimeZone(getPreferredTimeZone(userId));\n\t\tDate rv = format.parse(dateString);\n\t\treturn rv;\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 date(String str) throws Exception {\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n\n return sdf.parse( str );\n }", "public static Date parseDateOnly(String dateString, String userId) throws ParseException\n\t{\n\t\tif ((dateString == null) || (dateString.trim().length() == 0)) return null;\n\t\tDateFormat format = DateFormat.getDateInstance(DateFormat.MEDIUM, getPreferredLocale(userId));\n\t\tformat.setTimeZone(getPreferredTimeZone(userId));\n\t\tDate rv = format.parse(dateString);\n\t\treturn rv;\n\t}", "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 parseDateFromDefault(String dateString) throws ParseException\n\t{\n\t\tif ((dateString == null) || (dateString.trim().length() == 0)) return null;\n\t\tDateFormat format = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT, Locale.getDefault());\n\t\tformat.setTimeZone(TimeZone.getDefault());\n\t\tDate rv = format.parse(dateString);\n\t\treturn rv;\n\t}", "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 LocalDate parseToDate(String date) throws DateTimeParseException {\n return LocalDate.parse(date,FORMATTER);\n }", "public static Date dateFromString(String date, String pattern, Locale locale) throws ParseException {\n DateFormat format = new SimpleDateFormat(pattern, locale);\n return format.parse(date);\n }", "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}", "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}", "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 LocalDate englishDateOf(String dateString) {\n int year = Integer.parseInt(dateString.substring(6, 10));\n int month = Integer.parseInt(dateString.substring(0, 2));\n int day = Integer.parseInt(dateString.substring(3, 5));\n LocalDate date = LocalDate.of(year, month, day);\n return date;\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 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}", "default Date fromSource(String date) {\n try {\n return getSourceDateFormat().parse(date);\n } catch (ParseException e) {\n throw new RuntimeException(String.format(\"couldn't parse date:{0} using:{1}\", date, getSourceDateFormat()));\n }\n }", "public static Date dateParsing(String birthDate2) {\n\t\treturn null;\r\n\t}", "public static LocalDate stringToDate(String inputStringDate) {\n\t\treturn LocalDate.parse(inputStringDate);\n\t}", "private static String getDateFromString(String stringDate) throws Exception {\n // matcher for the RegEx\n Matcher matcher = pattern.matcher(stringDate);\n\n //now we want to get the values if matcher found anyhthin\n if (matcher.find()) {\n return matcher.group(); // матчер, группируй найденное\n }\n throw new Exception(\"Can't extract the date from the string\");\n\n }", "public static LocalDate formateDate(String dateString){\n\t\treturn LocalDate.parse(dateString, df);\n\t}", "public static Date getDateFromString(String date, String format)\n {\n SimpleDateFormat formatter = new SimpleDateFormat(format);\n ParsePosition pos = new ParsePosition(0);\n\n // Parse the string back into a Time Stamp.\n return formatter.parse(date, pos);\n }", "public static Date parseFormatDate(String dateString, DateFormat dateFormat)\n\t{\n\t\tdateString = dateString.trim();\n\t\tDate date = null;\n\t\ttry\n\t\t{\n\t\t\tdate = dateFormat.parse(dateString);\n\t\t}\n\t\tcatch (ParseException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn date;\n\t}", "@Override\n public Date parse(String text, Locale locale) throws ParseException {\n return getDateFormat().parse(text);\n }", "private static boolean isParseDate(String dateStr) {\n try {\n simpleDateFormat.parse(dateStr);\n return true;\n } catch (Exception e) {\n return false;\n }\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 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: */ }", "public static long parseDate(String dateStr) {\n\t\tlong longDate = 0;\n\t\tif (dateStr == null)\n\t\t\treturn longDate;\n\t\tdateStr = dateStr.replaceAll(\" +\", \"\");\t\t\n\t\ttry{\n\t\t\tDateTime dateTime = new DateTime();\n\t\t\tif (dateStr.length() == 5) {\n\t\t\t\tdateTime = DateTimeUtil.getDate(dateStr, \"ddMMM\", Locale.ENGLISH);\n\t\t\t\tlongDate = DateTimeUtil.getDateTimestamp(dateTime, 2);\n\t\t\t} else if (dateStr.length() == 7) {\n\t\t\t\tdateTime = DateTimeUtil.getDate(dateStr, \"ddMMMyy\", Locale.ENGLISH);\n\t\t\t\tlongDate = DateTimeUtil.getDateTimestamp(dateTime, 2);\n\t\t\t} else if (dateStr.length() == 9) {\n\t\t\t\tdateTime = DateTimeUtil.getDate(dateStr, \"ddMMMyyyy\", Locale.ENGLISH);\n\t\t\t\tlongDate = DateTimeUtil.getDateTimestamp(dateTime, 2);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn longDate;\n\t}", "public LocalDateTime parseDate(String str) {\n String time = str.substring(str.indexOf(\",\") + 2);\n int hour = new Integer(time.split(\":\")[0].trim());\n int min = new Integer(time.split(\":\")[1].trim());\n LocalTime localTime = LocalTime.of(hour, min);\n\n str = str.substring(0, str.indexOf(\",\")).trim();\n LocalDate localDate = LocalDate.now();\n\n if (str.contains(\"вчера\")) {\n localDate.minusDays(1);\n } else if (!str.contains(\"сегодня\") && !str.contains(\"вчера\")) {\n int year = new Integer(\"20\" + str.substring(str.length() - 2));\n String strMonth = str.substring(2, 6).trim();\n int day = new Integer(str.substring(0, 2).trim());\n localDate = LocalDate.of(year, parseMonth(strMonth), day);\n }\n return LocalDateTime.of(localDate, localTime);\n }", "Date HTMLDateToDatetime(String s)\n\t{\n\t\ttry\n\t\t{\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"EEE, dd MMM yyyy HH:mm:ss z\", java.util.Locale.US);\n\t\t\tjava.util.TimeZone tz = java.util.TimeZone.getTimeZone(\"GMT\");\n\t\t\tsdf.setTimeZone(tz);\n\t\t\treturn sdf.parse(s);\n\t\t\t\n\t\t}\n\t\tcatch(ParseException p)\n\t\t{\n\t\t\tlogger.warn(\"Could not parse RFC Date\", p);\n\t\t\treturn new Date();\n\t\t}\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 ParseFecha(String fecha)\n {\n //SimpleDateFormat formato = new SimpleDateFormat(\"dd-MM-yyyy\");\n SimpleDateFormat formato = new SimpleDateFormat(\"yyyy-MM-dd\");\n Date fechaDate = null;\n try {\n if(!fecha.equals(\"0\")){\n fechaDate = formato.parse(fecha);\n }\n\n }\n catch (ParseException ex)\n {\n System.out.println(ex);\n }\n return fechaDate;\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}", "public static Date parseDateTime(String formattedDate) {\n\t\treturn parseDate(formattedDate, DEFAULT_DATE_TIME_FORMAT);\n\t}", "public static Instant parse(final String dateString) {\n for (DateTimeFormatter formatter : VALID_DATE_FORMATS) {\n try {\n final var temporalAccessor = formatter.parse(dateString);\n return Instant.from(temporalAccessor);\n } catch (final Exception e) {\n //ignore failures - if no date string is parsable, an error is thrown below\n }\n }\n throw new IllegalArgumentException(\"Invalid date format: \\\"\" + dateString + \"\\\"\");\n }", "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 static Date parseToDate(String dateAParser, String type){\n\t\tDateFormat dfTmp = \"US\".equals(type) ? df : dfr;\n\t\tDate retour = null;\n\t\ttry {\n\t\t\tif(dateAParser != null){\n\t\t\t\tretour = df.parse(dateAParser);\n \n\t\t\t}\n\t\t} catch (ParseException e) {\n\t\t\t//TODO : add log\n\t\t}\n\t\treturn retour;\n\t}", "public static String dateStr(String str)\n {\n String month = str.split(\"/\")[0];\n String day = str.split(\"/\")[1];\n String year = str.split(\"/\")[2];\n return day + \"-\" + month + \"-\" + year;\n }", "public static LocalDate convertStringToDate(String date) {\n\t\treturn LocalDate.parse(date, DateTimeFormatter.ISO_LOCAL_DATE);\n\t}", "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 parseJdbcDate(String string) {\n try {\n return DateUtils.parseDate(string, jdbcDateFormatStrings);\n } catch (ParseException e) {\n throw new IllegalArgumentException(\"Failure parsing string \" + string, e);\n }\n }", "public static HISDate valueOf(String datStr) throws HISDateException {\r\n return HISDate.valueOf(datStr, null);\r\n }", "private LocalDate createDate(String date) {\n LocalDate localDate = LocalDate.parse(date);\n\n return localDate;\n }" ]
[ "0.80593234", "0.791", "0.7830173", "0.76954174", "0.75971216", "0.74280065", "0.7374575", "0.73472464", "0.7335816", "0.7332391", "0.7331709", "0.73256093", "0.73214346", "0.72293454", "0.71995765", "0.71751326", "0.71443933", "0.71227205", "0.71116006", "0.7107871", "0.71001774", "0.70892876", "0.70787704", "0.7066954", "0.70602936", "0.7010749", "0.70076793", "0.7006123", "0.6995462", "0.69596666", "0.69526327", "0.69506824", "0.6910619", "0.690418", "0.68897206", "0.6883361", "0.6861932", "0.6785048", "0.67721343", "0.67552453", "0.6747096", "0.67465746", "0.6734722", "0.67326164", "0.6720828", "0.6710855", "0.67101973", "0.6707349", "0.6699036", "0.6697853", "0.6696319", "0.66922647", "0.6683813", "0.6617382", "0.65741265", "0.6548878", "0.65487206", "0.654005", "0.65398467", "0.65304565", "0.65226144", "0.65186405", "0.64853096", "0.64828837", "0.64807016", "0.6465301", "0.64251655", "0.64099157", "0.6398691", "0.6398116", "0.6397502", "0.6360735", "0.6351259", "0.63511294", "0.63508517", "0.63395655", "0.632887", "0.6321438", "0.6288094", "0.6240609", "0.62353325", "0.62347853", "0.62281287", "0.61908954", "0.6179004", "0.61750317", "0.6155657", "0.61461514", "0.61421806", "0.61337847", "0.6100264", "0.60731894", "0.60624343", "0.60577816", "0.6055805", "0.60525525", "0.604757", "0.6040278", "0.6039394", "0.60393316" ]
0.65335524
59
Parses the given date String and returns a java.util.Date object
public static Date parseDateTime(String formattedDate) { return parseDate(formattedDate, DEFAULT_DATE_TIME_FORMAT); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Date parseDate(String date) {\n return DateUtil.toDate(date);\n }", "public static Date parseDate(String date)\n\t{\n\t\treturn parseFormatDate(date, getDateFormat());\n\t}", "public Date parse (String dateAsString , String dateFormat) throws Exception ;", "public static Date parseDate(String date) {\r\n return parseDateWithPattern(date, \"dd/MM/yyyy\");\r\n }", "public Date parseString(String dateString) throws ParseException {\n return dateFormat.parse(dateString);\n }", "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 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 synchronized Date parseDate(String s) throws ParseException {\n return dateFormat.parse(s);\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 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: */ }", "private static Date convertFromString(String dateString) throws ParseException {\n return new SimpleDateFormat(\"yyyyMMddHHmm\").parse(dateString);\n }", "@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 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 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 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 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 parseDateTime(String date)\n\t{\n\t\treturn parseFormatDate(date, getDateTimeFormat());\n\t}", "public Date convertStringToDate(String s) throws ParseException {\n\t\tDate dateTime = SDF.parse(s);\n\t\treturn dateTime;\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 static Date convertStringToDate(String date) throws ParseException {\n\t return new SimpleDateFormat(\"yyyy-MM-dd\").parse(date); \n\t}", "public static LocalDate parse(String dateStr) {\n String d = dateStr.substring(0, dateStr.indexOf('T'));\n LocalDate ld = null;\n try {\n ld = LocalDate.parse(d);\n } catch (Exception e) {\n System.err.println(\"Failed to parse datestring \" + dateStr + \" into a LocalDate!\");\n //e.printStackTrace();\n }\n // TODO: review what happens if format is invalid/LocalDate.parse fails - throw error, return null or both?\n return ld;\n }", "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 }", "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 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 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 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 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 }", "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(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 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 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 static Date toDate(String dateStr, SimpleDateFormat format) throws ParseException {\r\n\t\treturn format.parse(dateStr);\r\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 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 Date parse(String input) throws java.text.ParseException {\n\t\treturn new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.S\").parse(input);\n\n\t}", "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 }", "private LocalDateTime parseDate(String s) {\n String[] splitDate = s.split(\" \", 2);\n // Split day, month, year\n String[] splitDateElements = splitDate[0].split(\"/\", 3);\n int day = parseInt(splitDateElements[0]);\n int month = parseInt(splitDateElements[1]);\n int year = parseInt(splitDateElements[2]);\n // Split hours and minutes\n int hours = parseInt(splitDate[1].substring(0, 2));\n int mins = parseInt(splitDate[1].substring(2, 4));\n return LocalDateTime.of(year, month, day, hours, mins);\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 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 }", "public static Date parseHttpDate(String dateString)\n {\n if (dateString == null)\n {\n return null;\n }\n \n TimeZone gmt = TimeZone.getTimeZone(\"GMT\");\n \n for (int i = 0; i < INPUT_FORMATS.length; i++)\n {\n SimpleDateFormat format = new SimpleDateFormat(INPUT_FORMATS[i]);\n format.setTimeZone(gmt);\n try\n {\n return format.parse(dateString);\n }\n catch (ParseException e)\n {\n // try the next pattern\n }\n }\n \n return null;\n }", "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 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 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 }", "@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 parseFedoraDate(String fedoraDateStr) throws ParseException {\r\n return FEDORA_DATE_FORMAT.parse(fedoraDateStr);\r\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 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 }", "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 parseRFC3339Date(String dateString)\n throws java.text.ParseException, IndexOutOfBoundsException {\n\n Date currentDate = new Date();\n \n if (dateString.endsWith(\"Z\")) {\n try {\n SimpleDateFormat s = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'\");\n currentDate = s.parse(dateString);\n } catch (java.text.ParseException pe) {\n pe.printStackTrace();\n }\n return currentDate;\n }\n \n return currentDate;\n }", "public Date parseDate(String date, String format) {\n return this.convertStringToDate(date, format);\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 static LocalDate parseDate(String dateString)\n throws DateTimeParseException {\n\n // this parses '2011-12-03', timezone information ignored\n return LocalDate.parse(dateString, DateTimeFormatter.ISO_LOCAL_DATE);\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 }", "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 static LocalDate parse(String dateString){\r\n\t\t\r\n\t\ttry{\r\n\t\t\t//below LocalDate::from means use method from in LocalDate(?)\r\n\t\t\treturn DATE_FORMATTER.parse(dateString,LocalDate::from);\r\n\t\t}\r\n\t\tcatch (DateTimeParseException e){\r\n\t\t\treturn null;\t\t\r\n\t\t}\r\n\t}", "public java.util.Date parse(java.lang.String r4, java.text.ParsePosition r5) {\n /*\n r3 = this;\n boolean r0 = r3.looksLikeISO8601(r4)\n if (r0 == 0) goto L_0x000b\n java.util.Date r4 = r3.parseAsISO8601(r4, r5)\n return r4\n L_0x000b:\n int r0 = r4.length()\n L_0x000f:\n int r0 = r0 + -1\n if (r0 < 0) goto L_0x0021\n char r1 = r4.charAt(r0)\n r2 = 48\n if (r1 < r2) goto L_0x0021\n r2 = 57\n if (r1 <= r2) goto L_0x0020\n goto L_0x0021\n L_0x0020:\n goto L_0x000f\n L_0x0021:\n if (r0 >= 0) goto L_0x0034\n r0 = 0\n boolean r0 = com.fasterxml.jackson.core.p007io.NumberInput.inLongRange(r4, r0)\n if (r0 == 0) goto L_0x0034\n java.util.Date r5 = new java.util.Date\n long r0 = java.lang.Long.parseLong(r4)\n r5.<init>(r0)\n return r5\n L_0x0034:\n java.util.Date r4 = r3.parseAsRFC1123(r4, r5)\n return r4\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.fasterxml.jackson.databind.util.StdDateFormat.parse(java.lang.String, java.text.ParsePosition):java.util.Date\");\n }", "public static Date parseDateTime(String str)\n {\n if(Empty.isEmpty(str))\n return null;\n if(str.length() <= 10)\n return parse(str);\n try{\n \treturn (new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\")).parse(str);\n\t\t}catch(ParseException e){\n\t\t \t return null;\n\t\t}\n }", "public static Date parseDate(String dateString, String userId) throws ParseException\n\t{\n\t\tif ((dateString == null) || (dateString.trim().length() == 0)) return null;\n\t\tDateFormat format = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT, getPreferredLocale(userId));\n\t\tformat.setTimeZone(getPreferredTimeZone(userId));\n\t\tDate rv = format.parse(dateString);\n\t\treturn rv;\n\t}", "public static Date parseDate(String formattedDate) {\n\t\treturn parseDate(formattedDate, DEFAULT_DATE_FORMAT);\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 date(String str) throws Exception {\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n\n return sdf.parse( str );\n }", "public static Date parseDateOnly(String dateString, String userId) throws ParseException\n\t{\n\t\tif ((dateString == null) || (dateString.trim().length() == 0)) return null;\n\t\tDateFormat format = DateFormat.getDateInstance(DateFormat.MEDIUM, getPreferredLocale(userId));\n\t\tformat.setTimeZone(getPreferredTimeZone(userId));\n\t\tDate rv = format.parse(dateString);\n\t\treturn rv;\n\t}", "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 parseDateFromDefault(String dateString) throws ParseException\n\t{\n\t\tif ((dateString == null) || (dateString.trim().length() == 0)) return null;\n\t\tDateFormat format = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT, Locale.getDefault());\n\t\tformat.setTimeZone(TimeZone.getDefault());\n\t\tDate rv = format.parse(dateString);\n\t\treturn rv;\n\t}", "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 LocalDate parseToDate(String date) throws DateTimeParseException {\n return LocalDate.parse(date,FORMATTER);\n }", "public static Date dateFromString(String date, String pattern, Locale locale) throws ParseException {\n DateFormat format = new SimpleDateFormat(pattern, locale);\n return format.parse(date);\n }", "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}", "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}", "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 LocalDate englishDateOf(String dateString) {\n int year = Integer.parseInt(dateString.substring(6, 10));\n int month = Integer.parseInt(dateString.substring(0, 2));\n int day = Integer.parseInt(dateString.substring(3, 5));\n LocalDate date = LocalDate.of(year, month, day);\n return date;\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 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}", "default Date fromSource(String date) {\n try {\n return getSourceDateFormat().parse(date);\n } catch (ParseException e) {\n throw new RuntimeException(String.format(\"couldn't parse date:{0} using:{1}\", date, getSourceDateFormat()));\n }\n }", "public static Date dateParsing(String birthDate2) {\n\t\treturn null;\r\n\t}", "public static LocalDate stringToDate(String inputStringDate) {\n\t\treturn LocalDate.parse(inputStringDate);\n\t}", "private static String getDateFromString(String stringDate) throws Exception {\n // matcher for the RegEx\n Matcher matcher = pattern.matcher(stringDate);\n\n //now we want to get the values if matcher found anyhthin\n if (matcher.find()) {\n return matcher.group(); // матчер, группируй найденное\n }\n throw new Exception(\"Can't extract the date from the string\");\n\n }", "public static LocalDate formateDate(String dateString){\n\t\treturn LocalDate.parse(dateString, df);\n\t}", "public static Date getDateFromString(String date, String format)\n {\n SimpleDateFormat formatter = new SimpleDateFormat(format);\n ParsePosition pos = new ParsePosition(0);\n\n // Parse the string back into a Time Stamp.\n return formatter.parse(date, pos);\n }", "public static Date parseFormatDate(String dateString, DateFormat dateFormat)\n\t{\n\t\tdateString = dateString.trim();\n\t\tDate date = null;\n\t\ttry\n\t\t{\n\t\t\tdate = dateFormat.parse(dateString);\n\t\t}\n\t\tcatch (ParseException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn date;\n\t}", "@Override\n public Date parse(String text, Locale locale) throws ParseException {\n return getDateFormat().parse(text);\n }", "private static boolean isParseDate(String dateStr) {\n try {\n simpleDateFormat.parse(dateStr);\n return true;\n } catch (Exception e) {\n return false;\n }\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 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: */ }", "public static long parseDate(String dateStr) {\n\t\tlong longDate = 0;\n\t\tif (dateStr == null)\n\t\t\treturn longDate;\n\t\tdateStr = dateStr.replaceAll(\" +\", \"\");\t\t\n\t\ttry{\n\t\t\tDateTime dateTime = new DateTime();\n\t\t\tif (dateStr.length() == 5) {\n\t\t\t\tdateTime = DateTimeUtil.getDate(dateStr, \"ddMMM\", Locale.ENGLISH);\n\t\t\t\tlongDate = DateTimeUtil.getDateTimestamp(dateTime, 2);\n\t\t\t} else if (dateStr.length() == 7) {\n\t\t\t\tdateTime = DateTimeUtil.getDate(dateStr, \"ddMMMyy\", Locale.ENGLISH);\n\t\t\t\tlongDate = DateTimeUtil.getDateTimestamp(dateTime, 2);\n\t\t\t} else if (dateStr.length() == 9) {\n\t\t\t\tdateTime = DateTimeUtil.getDate(dateStr, \"ddMMMyyyy\", Locale.ENGLISH);\n\t\t\t\tlongDate = DateTimeUtil.getDateTimestamp(dateTime, 2);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn longDate;\n\t}", "public LocalDateTime parseDate(String str) {\n String time = str.substring(str.indexOf(\",\") + 2);\n int hour = new Integer(time.split(\":\")[0].trim());\n int min = new Integer(time.split(\":\")[1].trim());\n LocalTime localTime = LocalTime.of(hour, min);\n\n str = str.substring(0, str.indexOf(\",\")).trim();\n LocalDate localDate = LocalDate.now();\n\n if (str.contains(\"вчера\")) {\n localDate.minusDays(1);\n } else if (!str.contains(\"сегодня\") && !str.contains(\"вчера\")) {\n int year = new Integer(\"20\" + str.substring(str.length() - 2));\n String strMonth = str.substring(2, 6).trim();\n int day = new Integer(str.substring(0, 2).trim());\n localDate = LocalDate.of(year, parseMonth(strMonth), day);\n }\n return LocalDateTime.of(localDate, localTime);\n }", "Date HTMLDateToDatetime(String s)\n\t{\n\t\ttry\n\t\t{\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"EEE, dd MMM yyyy HH:mm:ss z\", java.util.Locale.US);\n\t\t\tjava.util.TimeZone tz = java.util.TimeZone.getTimeZone(\"GMT\");\n\t\t\tsdf.setTimeZone(tz);\n\t\t\treturn sdf.parse(s);\n\t\t\t\n\t\t}\n\t\tcatch(ParseException p)\n\t\t{\n\t\t\tlogger.warn(\"Could not parse RFC Date\", p);\n\t\t\treturn new Date();\n\t\t}\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 ParseFecha(String fecha)\n {\n //SimpleDateFormat formato = new SimpleDateFormat(\"dd-MM-yyyy\");\n SimpleDateFormat formato = new SimpleDateFormat(\"yyyy-MM-dd\");\n Date fechaDate = null;\n try {\n if(!fecha.equals(\"0\")){\n fechaDate = formato.parse(fecha);\n }\n\n }\n catch (ParseException ex)\n {\n System.out.println(ex);\n }\n return fechaDate;\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}", "public static Instant parse(final String dateString) {\n for (DateTimeFormatter formatter : VALID_DATE_FORMATS) {\n try {\n final var temporalAccessor = formatter.parse(dateString);\n return Instant.from(temporalAccessor);\n } catch (final Exception e) {\n //ignore failures - if no date string is parsable, an error is thrown below\n }\n }\n throw new IllegalArgumentException(\"Invalid date format: \\\"\" + dateString + \"\\\"\");\n }", "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 static Date parseToDate(String dateAParser, String type){\n\t\tDateFormat dfTmp = \"US\".equals(type) ? df : dfr;\n\t\tDate retour = null;\n\t\ttry {\n\t\t\tif(dateAParser != null){\n\t\t\t\tretour = df.parse(dateAParser);\n \n\t\t\t}\n\t\t} catch (ParseException e) {\n\t\t\t//TODO : add log\n\t\t}\n\t\treturn retour;\n\t}", "public static String dateStr(String str)\n {\n String month = str.split(\"/\")[0];\n String day = str.split(\"/\")[1];\n String year = str.split(\"/\")[2];\n return day + \"-\" + month + \"-\" + year;\n }", "public static LocalDate convertStringToDate(String date) {\n\t\treturn LocalDate.parse(date, DateTimeFormatter.ISO_LOCAL_DATE);\n\t}", "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 parseJdbcDate(String string) {\n try {\n return DateUtils.parseDate(string, jdbcDateFormatStrings);\n } catch (ParseException e) {\n throw new IllegalArgumentException(\"Failure parsing string \" + string, e);\n }\n }", "public static HISDate valueOf(String datStr) throws HISDateException {\r\n return HISDate.valueOf(datStr, null);\r\n }", "private LocalDate createDate(String date) {\n LocalDate localDate = LocalDate.parse(date);\n\n return localDate;\n }" ]
[ "0.80593234", "0.791", "0.7830173", "0.76954174", "0.75971216", "0.74280065", "0.7374575", "0.73472464", "0.7335816", "0.7332391", "0.7331709", "0.73256093", "0.73214346", "0.72293454", "0.71995765", "0.71751326", "0.71443933", "0.71227205", "0.71116006", "0.7107871", "0.71001774", "0.70892876", "0.70787704", "0.7066954", "0.70602936", "0.7010749", "0.70076793", "0.7006123", "0.6995462", "0.69596666", "0.69526327", "0.69506824", "0.6910619", "0.690418", "0.68897206", "0.6883361", "0.6861932", "0.6785048", "0.67721343", "0.67552453", "0.6747096", "0.67465746", "0.6734722", "0.67326164", "0.6720828", "0.6710855", "0.67101973", "0.6707349", "0.6699036", "0.6697853", "0.6696319", "0.66922647", "0.6683813", "0.6617382", "0.65741265", "0.6548878", "0.65487206", "0.654005", "0.65398467", "0.65335524", "0.65304565", "0.65226144", "0.65186405", "0.64853096", "0.64828837", "0.64807016", "0.6465301", "0.64251655", "0.64099157", "0.6398691", "0.6398116", "0.6397502", "0.6360735", "0.6351259", "0.63511294", "0.63508517", "0.63395655", "0.632887", "0.6321438", "0.6288094", "0.6240609", "0.62353325", "0.62347853", "0.62281287", "0.61908954", "0.6179004", "0.61750317", "0.6155657", "0.61461514", "0.61421806", "0.61337847", "0.60731894", "0.60624343", "0.60577816", "0.6055805", "0.60525525", "0.604757", "0.6040278", "0.6039394", "0.60393316" ]
0.6100264
91
Parses the given date String and returns a java.util.Date object
public static Date parseDate(final String formattedDate, final String dateFormat) { if (formattedDate == null || "".equals(formattedDate)) { return null; } try { DateFormat formatter = new SimpleDateFormat(dateFormat); formatter.setLenient(false); return formatter.parse(formattedDate); } catch (ParseException e) { throw new IllegalArgumentException("Could not parse date " + formattedDate + " according to format " + dateFormat, e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Date parseDate(String date) {\n return DateUtil.toDate(date);\n }", "public static Date parseDate(String date)\n\t{\n\t\treturn parseFormatDate(date, getDateFormat());\n\t}", "public Date parse (String dateAsString , String dateFormat) throws Exception ;", "public static Date parseDate(String date) {\r\n return parseDateWithPattern(date, \"dd/MM/yyyy\");\r\n }", "public Date parseString(String dateString) throws ParseException {\n return dateFormat.parse(dateString);\n }", "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 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 synchronized Date parseDate(String s) throws ParseException {\n return dateFormat.parse(s);\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}", "private static Date convertFromString(String dateString) throws ParseException {\n return new SimpleDateFormat(\"yyyyMMddHHmm\").parse(dateString);\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: */ }", "@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 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 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 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 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 parseDateTime(String date)\n\t{\n\t\treturn parseFormatDate(date, getDateTimeFormat());\n\t}", "public Date convertStringToDate(String s) throws ParseException {\n\t\tDate dateTime = SDF.parse(s);\n\t\treturn dateTime;\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 static Date convertStringToDate(String date) throws ParseException {\n\t return new SimpleDateFormat(\"yyyy-MM-dd\").parse(date); \n\t}", "public static LocalDate parse(String dateStr) {\n String d = dateStr.substring(0, dateStr.indexOf('T'));\n LocalDate ld = null;\n try {\n ld = LocalDate.parse(d);\n } catch (Exception e) {\n System.err.println(\"Failed to parse datestring \" + dateStr + \" into a LocalDate!\");\n //e.printStackTrace();\n }\n // TODO: review what happens if format is invalid/LocalDate.parse fails - throw error, return null or both?\n return ld;\n }", "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 }", "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 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 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 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 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 }", "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(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 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 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 static Date toDate(String dateStr, SimpleDateFormat format) throws ParseException {\r\n\t\treturn format.parse(dateStr);\r\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 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 Date parse(String input) throws java.text.ParseException {\n\t\treturn new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.S\").parse(input);\n\n\t}", "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 }", "private LocalDateTime parseDate(String s) {\n String[] splitDate = s.split(\" \", 2);\n // Split day, month, year\n String[] splitDateElements = splitDate[0].split(\"/\", 3);\n int day = parseInt(splitDateElements[0]);\n int month = parseInt(splitDateElements[1]);\n int year = parseInt(splitDateElements[2]);\n // Split hours and minutes\n int hours = parseInt(splitDate[1].substring(0, 2));\n int mins = parseInt(splitDate[1].substring(2, 4));\n return LocalDateTime.of(year, month, day, hours, mins);\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 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 }", "public static Date parseHttpDate(String dateString)\n {\n if (dateString == null)\n {\n return null;\n }\n \n TimeZone gmt = TimeZone.getTimeZone(\"GMT\");\n \n for (int i = 0; i < INPUT_FORMATS.length; i++)\n {\n SimpleDateFormat format = new SimpleDateFormat(INPUT_FORMATS[i]);\n format.setTimeZone(gmt);\n try\n {\n return format.parse(dateString);\n }\n catch (ParseException e)\n {\n // try the next pattern\n }\n }\n \n return null;\n }", "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 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 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 }", "@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 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 parseFedoraDate(String fedoraDateStr) throws ParseException {\r\n return FEDORA_DATE_FORMAT.parse(fedoraDateStr);\r\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 static Date parseRFC3339Date(String dateString)\n throws java.text.ParseException, IndexOutOfBoundsException {\n\n Date currentDate = new Date();\n \n if (dateString.endsWith(\"Z\")) {\n try {\n SimpleDateFormat s = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'\");\n currentDate = s.parse(dateString);\n } catch (java.text.ParseException pe) {\n pe.printStackTrace();\n }\n return currentDate;\n }\n \n return currentDate;\n }", "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 Date parseDate(String date, String format) {\n return this.convertStringToDate(date, format);\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 static LocalDate parseDate(String dateString)\n throws DateTimeParseException {\n\n // this parses '2011-12-03', timezone information ignored\n return LocalDate.parse(dateString, DateTimeFormatter.ISO_LOCAL_DATE);\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 }", "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 static LocalDate parse(String dateString){\r\n\t\t\r\n\t\ttry{\r\n\t\t\t//below LocalDate::from means use method from in LocalDate(?)\r\n\t\t\treturn DATE_FORMATTER.parse(dateString,LocalDate::from);\r\n\t\t}\r\n\t\tcatch (DateTimeParseException e){\r\n\t\t\treturn null;\t\t\r\n\t\t}\r\n\t}", "public java.util.Date parse(java.lang.String r4, java.text.ParsePosition r5) {\n /*\n r3 = this;\n boolean r0 = r3.looksLikeISO8601(r4)\n if (r0 == 0) goto L_0x000b\n java.util.Date r4 = r3.parseAsISO8601(r4, r5)\n return r4\n L_0x000b:\n int r0 = r4.length()\n L_0x000f:\n int r0 = r0 + -1\n if (r0 < 0) goto L_0x0021\n char r1 = r4.charAt(r0)\n r2 = 48\n if (r1 < r2) goto L_0x0021\n r2 = 57\n if (r1 <= r2) goto L_0x0020\n goto L_0x0021\n L_0x0020:\n goto L_0x000f\n L_0x0021:\n if (r0 >= 0) goto L_0x0034\n r0 = 0\n boolean r0 = com.fasterxml.jackson.core.p007io.NumberInput.inLongRange(r4, r0)\n if (r0 == 0) goto L_0x0034\n java.util.Date r5 = new java.util.Date\n long r0 = java.lang.Long.parseLong(r4)\n r5.<init>(r0)\n return r5\n L_0x0034:\n java.util.Date r4 = r3.parseAsRFC1123(r4, r5)\n return r4\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.fasterxml.jackson.databind.util.StdDateFormat.parse(java.lang.String, java.text.ParsePosition):java.util.Date\");\n }", "public static Date parseDate(String dateString, String userId) throws ParseException\n\t{\n\t\tif ((dateString == null) || (dateString.trim().length() == 0)) return null;\n\t\tDateFormat format = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT, getPreferredLocale(userId));\n\t\tformat.setTimeZone(getPreferredTimeZone(userId));\n\t\tDate rv = format.parse(dateString);\n\t\treturn rv;\n\t}", "public static Date parseDateTime(String str)\n {\n if(Empty.isEmpty(str))\n return null;\n if(str.length() <= 10)\n return parse(str);\n try{\n \treturn (new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\")).parse(str);\n\t\t}catch(ParseException e){\n\t\t \t return null;\n\t\t}\n }", "public static Date parseDate(String formattedDate) {\n\t\treturn parseDate(formattedDate, DEFAULT_DATE_FORMAT);\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 date(String str) throws Exception {\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n\n return sdf.parse( str );\n }", "public static Date parseDateOnly(String dateString, String userId) throws ParseException\n\t{\n\t\tif ((dateString == null) || (dateString.trim().length() == 0)) return null;\n\t\tDateFormat format = DateFormat.getDateInstance(DateFormat.MEDIUM, getPreferredLocale(userId));\n\t\tformat.setTimeZone(getPreferredTimeZone(userId));\n\t\tDate rv = format.parse(dateString);\n\t\treturn rv;\n\t}", "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 parseDateFromDefault(String dateString) throws ParseException\n\t{\n\t\tif ((dateString == null) || (dateString.trim().length() == 0)) return null;\n\t\tDateFormat format = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT, Locale.getDefault());\n\t\tformat.setTimeZone(TimeZone.getDefault());\n\t\tDate rv = format.parse(dateString);\n\t\treturn rv;\n\t}", "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 LocalDate parseToDate(String date) throws DateTimeParseException {\n return LocalDate.parse(date,FORMATTER);\n }", "public static Date dateFromString(String date, String pattern, Locale locale) throws ParseException {\n DateFormat format = new SimpleDateFormat(pattern, locale);\n return format.parse(date);\n }", "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}", "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}", "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 LocalDate englishDateOf(String dateString) {\n int year = Integer.parseInt(dateString.substring(6, 10));\n int month = Integer.parseInt(dateString.substring(0, 2));\n int day = Integer.parseInt(dateString.substring(3, 5));\n LocalDate date = LocalDate.of(year, month, day);\n return date;\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 }", "default Date fromSource(String date) {\n try {\n return getSourceDateFormat().parse(date);\n } catch (ParseException e) {\n throw new RuntimeException(String.format(\"couldn't parse date:{0} using:{1}\", date, getSourceDateFormat()));\n }\n }", "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 dateParsing(String birthDate2) {\n\t\treturn null;\r\n\t}", "public static LocalDate stringToDate(String inputStringDate) {\n\t\treturn LocalDate.parse(inputStringDate);\n\t}", "private static String getDateFromString(String stringDate) throws Exception {\n // matcher for the RegEx\n Matcher matcher = pattern.matcher(stringDate);\n\n //now we want to get the values if matcher found anyhthin\n if (matcher.find()) {\n return matcher.group(); // матчер, группируй найденное\n }\n throw new Exception(\"Can't extract the date from the string\");\n\n }", "public static LocalDate formateDate(String dateString){\n\t\treturn LocalDate.parse(dateString, df);\n\t}", "public static Date getDateFromString(String date, String format)\n {\n SimpleDateFormat formatter = new SimpleDateFormat(format);\n ParsePosition pos = new ParsePosition(0);\n\n // Parse the string back into a Time Stamp.\n return formatter.parse(date, pos);\n }", "public static Date parseFormatDate(String dateString, DateFormat dateFormat)\n\t{\n\t\tdateString = dateString.trim();\n\t\tDate date = null;\n\t\ttry\n\t\t{\n\t\t\tdate = dateFormat.parse(dateString);\n\t\t}\n\t\tcatch (ParseException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn date;\n\t}", "private static boolean isParseDate(String dateStr) {\n try {\n simpleDateFormat.parse(dateStr);\n return true;\n } catch (Exception e) {\n return false;\n }\n }", "@Override\n public Date parse(String text, Locale locale) throws ParseException {\n return getDateFormat().parse(text);\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 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: */ }", "public static long parseDate(String dateStr) {\n\t\tlong longDate = 0;\n\t\tif (dateStr == null)\n\t\t\treturn longDate;\n\t\tdateStr = dateStr.replaceAll(\" +\", \"\");\t\t\n\t\ttry{\n\t\t\tDateTime dateTime = new DateTime();\n\t\t\tif (dateStr.length() == 5) {\n\t\t\t\tdateTime = DateTimeUtil.getDate(dateStr, \"ddMMM\", Locale.ENGLISH);\n\t\t\t\tlongDate = DateTimeUtil.getDateTimestamp(dateTime, 2);\n\t\t\t} else if (dateStr.length() == 7) {\n\t\t\t\tdateTime = DateTimeUtil.getDate(dateStr, \"ddMMMyy\", Locale.ENGLISH);\n\t\t\t\tlongDate = DateTimeUtil.getDateTimestamp(dateTime, 2);\n\t\t\t} else if (dateStr.length() == 9) {\n\t\t\t\tdateTime = DateTimeUtil.getDate(dateStr, \"ddMMMyyyy\", Locale.ENGLISH);\n\t\t\t\tlongDate = DateTimeUtil.getDateTimestamp(dateTime, 2);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn longDate;\n\t}", "public LocalDateTime parseDate(String str) {\n String time = str.substring(str.indexOf(\",\") + 2);\n int hour = new Integer(time.split(\":\")[0].trim());\n int min = new Integer(time.split(\":\")[1].trim());\n LocalTime localTime = LocalTime.of(hour, min);\n\n str = str.substring(0, str.indexOf(\",\")).trim();\n LocalDate localDate = LocalDate.now();\n\n if (str.contains(\"вчера\")) {\n localDate.minusDays(1);\n } else if (!str.contains(\"сегодня\") && !str.contains(\"вчера\")) {\n int year = new Integer(\"20\" + str.substring(str.length() - 2));\n String strMonth = str.substring(2, 6).trim();\n int day = new Integer(str.substring(0, 2).trim());\n localDate = LocalDate.of(year, parseMonth(strMonth), day);\n }\n return LocalDateTime.of(localDate, localTime);\n }", "Date HTMLDateToDatetime(String s)\n\t{\n\t\ttry\n\t\t{\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"EEE, dd MMM yyyy HH:mm:ss z\", java.util.Locale.US);\n\t\t\tjava.util.TimeZone tz = java.util.TimeZone.getTimeZone(\"GMT\");\n\t\t\tsdf.setTimeZone(tz);\n\t\t\treturn sdf.parse(s);\n\t\t\t\n\t\t}\n\t\tcatch(ParseException p)\n\t\t{\n\t\t\tlogger.warn(\"Could not parse RFC Date\", p);\n\t\t\treturn new Date();\n\t\t}\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 ParseFecha(String fecha)\n {\n //SimpleDateFormat formato = new SimpleDateFormat(\"dd-MM-yyyy\");\n SimpleDateFormat formato = new SimpleDateFormat(\"yyyy-MM-dd\");\n Date fechaDate = null;\n try {\n if(!fecha.equals(\"0\")){\n fechaDate = formato.parse(fecha);\n }\n\n }\n catch (ParseException ex)\n {\n System.out.println(ex);\n }\n return fechaDate;\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}", "public static Date parseDateTime(String formattedDate) {\n\t\treturn parseDate(formattedDate, DEFAULT_DATE_TIME_FORMAT);\n\t}", "public static Instant parse(final String dateString) {\n for (DateTimeFormatter formatter : VALID_DATE_FORMATS) {\n try {\n final var temporalAccessor = formatter.parse(dateString);\n return Instant.from(temporalAccessor);\n } catch (final Exception e) {\n //ignore failures - if no date string is parsable, an error is thrown below\n }\n }\n throw new IllegalArgumentException(\"Invalid date format: \\\"\" + dateString + \"\\\"\");\n }", "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 static Date parseToDate(String dateAParser, String type){\n\t\tDateFormat dfTmp = \"US\".equals(type) ? df : dfr;\n\t\tDate retour = null;\n\t\ttry {\n\t\t\tif(dateAParser != null){\n\t\t\t\tretour = df.parse(dateAParser);\n \n\t\t\t}\n\t\t} catch (ParseException e) {\n\t\t\t//TODO : add log\n\t\t}\n\t\treturn retour;\n\t}", "public static String dateStr(String str)\n {\n String month = str.split(\"/\")[0];\n String day = str.split(\"/\")[1];\n String year = str.split(\"/\")[2];\n return day + \"-\" + month + \"-\" + year;\n }", "public static LocalDate convertStringToDate(String date) {\n\t\treturn LocalDate.parse(date, DateTimeFormatter.ISO_LOCAL_DATE);\n\t}", "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 parseJdbcDate(String string) {\n try {\n return DateUtils.parseDate(string, jdbcDateFormatStrings);\n } catch (ParseException e) {\n throw new IllegalArgumentException(\"Failure parsing string \" + string, e);\n }\n }", "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 }", "public static HISDate valueOf(String datStr) throws HISDateException {\r\n return HISDate.valueOf(datStr, null);\r\n }" ]
[ "0.8058802", "0.7908797", "0.7830613", "0.7693909", "0.7598291", "0.74276334", "0.7375023", "0.73460937", "0.73358274", "0.73312145", "0.7330507", "0.73245037", "0.7322896", "0.72278094", "0.7198544", "0.71734947", "0.7142043", "0.7121392", "0.7109926", "0.7105702", "0.71008885", "0.70889515", "0.7078428", "0.70651", "0.7058523", "0.7010756", "0.7005464", "0.7005161", "0.69951946", "0.6958846", "0.6952608", "0.695114", "0.69085133", "0.6902043", "0.688862", "0.6881978", "0.6861364", "0.67854387", "0.67694813", "0.6755036", "0.67481816", "0.6746762", "0.67348725", "0.67332405", "0.6720761", "0.6709766", "0.67096347", "0.67054564", "0.66984314", "0.66979444", "0.66954684", "0.6690432", "0.66827476", "0.6616511", "0.6573121", "0.65509427", "0.6548994", "0.6540287", "0.653806", "0.6533595", "0.65296465", "0.6520077", "0.6518712", "0.64857334", "0.64825827", "0.64810115", "0.64636606", "0.64236647", "0.6408856", "0.6399248", "0.6398479", "0.6397918", "0.6358975", "0.6351899", "0.63515466", "0.63508534", "0.6339944", "0.63307136", "0.6321155", "0.6287281", "0.6241063", "0.6236265", "0.62354755", "0.6228568", "0.61900496", "0.6180314", "0.6174542", "0.6153314", "0.61451274", "0.6140299", "0.6134178", "0.6099396", "0.6074344", "0.6061963", "0.6057723", "0.6055013", "0.6051615", "0.6046328", "0.60404724", "0.60380596", "0.6037821" ]
0.0
-1
Get the all days in the same week as the given date.
public static List<Date> getAllDatesInWeek(Date dateInWeek) { List<Date> allWeek = new ArrayList<Date>(7); allWeek.add(getDateInWeek(dateInWeek, Calendar.MONDAY)); allWeek.add(getDateInWeek(dateInWeek, Calendar.TUESDAY)); allWeek.add(getDateInWeek(dateInWeek, Calendar.WEDNESDAY)); allWeek.add(getDateInWeek(dateInWeek, Calendar.THURSDAY)); allWeek.add(getDateInWeek(dateInWeek, Calendar.FRIDAY)); allWeek.add(getDateInWeek(dateInWeek, Calendar.SATURDAY)); allWeek.add(getDateInWeek(dateInWeek, Calendar.SUNDAY)); return allWeek; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Week(LocalDate date) {\n days = new ArrayList<>();\n LocalDate monday = getStartOfWeek(date);\n days.add(monday);\n for (int i = 1; i < 7; i++) {\n days.add(monday.plusDays(i));\n }\n }", "public static Date[] getCurrentWeekInDates(){\n\t\t Date FromDate=new Date();\n\t\t Date ToDate=new Date();\n\n\t\t int i = 1; \n\t\t while(i <= 7){\n\t\t \n\t\t Date CurDate = DateUtils.addDays(new Date(), i * (-1));\n\t\t \n\t\t Calendar cal = Calendar.getInstance();\n\t\t cal.setTime(CurDate);\n\t\t \n\t\t int DayOfWeek = cal.get(Calendar.DAY_OF_WEEK);\n\t\t \n\t\t if(DayOfWeek == 6){\n\t\t ToDate = CurDate;\n\t\t }\n\t\t \n\t\t if(DayOfWeek == 7){\n\t\t \n\t\t FromDate = CurDate;\n\t\t \n\t\t break;\n\t\t }\n\t\t \n\t\t i++;\n\t\t \n\t\t }// end while\n\t\t \n\t\t \n\t\t Date temp[] = new Date[2];\n\t\t temp[0] = FromDate;\n\t\t temp[1] = ToDate;\n\t\t \n\t\t return temp;\n\t\t \n\t}", "public static WeekDay getWeekDay(Date date) {\r\n\t\t Calendar calendar = Calendar.getInstance();\r\n\t\t calendar.setTime(date);\r\n\t\t return WeekDay.values()[calendar.get(Calendar.DAY_OF_WEEK) - 1];\r\n\t }", "private int[] setDaysOfWeek() {\n int[] daysOfWeek = new int[7];\n\n for (int i = 0; i < 6; i++) {\n daysOfWeek[i] = calculateNumberOfDaysOfWeek(DayOfWeek.of(i + 1));\n }\n\n return daysOfWeek;\n }", "public static TemporalQuery<Integer> dayOfWeek(){\n return (d) -> d.get(ChronoField.DAY_OF_WEEK);\n }", "public static int getDayOfWeekByDate(Date date){\n\t\t\n\t\tCalendar c = Calendar.getInstance();\n\t\tc.setTime(date);\n\t\tint DayOfWeek = c.get(Calendar.DAY_OF_WEEK);\n\t\treturn DayOfWeek;\n\t\t\n\t}", "public Date getWeekStartDate(Date date) {\n Calendar cal = Calendar.getInstance();\n cal.setTime(date);\n cal.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);\n cal.set(Calendar.HOUR_OF_DAY, 0);\n cal.set(Calendar.MINUTE, 0);\n cal.set(Calendar.SECOND, 0);\n cal.set(Calendar.MILLISECOND, 0);\n return cal.getTime();\n }", "public static String getWeek(Date date) {\n String Week = \"\";\n Calendar c = Calendar.getInstance();\n c.setTime(date);\n if (c.get(Calendar.DAY_OF_WEEK) == 1) {\n Week += \"星期日\";\n }\n if (c.get(Calendar.DAY_OF_WEEK) == 2) {\n Week += \"星期一\";\n }\n if (c.get(Calendar.DAY_OF_WEEK) == 3) {\n Week += \"星期二\";\n }\n if (c.get(Calendar.DAY_OF_WEEK) == 4) {\n Week += \"星期三\";\n }\n if (c.get(Calendar.DAY_OF_WEEK) == 5) {\n Week += \"星期四\";\n }\n if (c.get(Calendar.DAY_OF_WEEK) == 6) {\n Week += \"星期五\";\n }\n if (c.get(Calendar.DAY_OF_WEEK) == 7) {\n Week += \"星期六\";\n }\n return Week;\n }", "public static boolean isWeekDay(LocalDate date) {\n return !(date.getDayOfWeek() == DayOfWeek.SATURDAY || date.getDayOfWeek() == DayOfWeek.SUNDAY);\n }", "public static String getWeekDay(String date) {\n\t\tSimpleDateFormat dateformatddMMyyyy = new SimpleDateFormat(\"dd-MM-yyyy\");\n\t\ttry {\n\t\t\tjava.util.Date dat = dateformatddMMyyyy.parse(date);\n\t\t\tdateformatddMMyyyy.applyPattern(\"EEEE\");\n\t\t\tdate_to_string = dateformatddMMyyyy.format(dat);\n\n\t\t\t// Calendar c = Calendar.getInstance();\n\t\t\t// c.setTime(dat);\n\t\t\t// int dayOfWeek = c.get(Calendar.DAY_OF_WEEK);\n\t\t\t// date_to_string = strDays[dayOfWeek];\n\t\t} catch (ParseException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn date_to_string;\n\n\t}", "public List<Week> getAllWeeks() { return weekService.getAllWeeks(); }", "public static int getDayOfWeek(CalendarDate date) {\n\tlong fixedDate = getFixedDate(date.getYear(),\n\t\t\t\t date.getMonth(),\n\t\t\t\t date.getDate());\n\treturn getDayOfWeekFromFixedDate(fixedDate);\n }", "private static int getDayNumberNew(LocalDate date) {\n DayOfWeek day = date.getDayOfWeek();\n return day.getValue() % 7;\n }", "boolean hasWeekday();", "private void getActivatedWeekdays() {\n }", "public static List<WeekDay> convertWeekDays(int bitMask) {\r\n\t\tArrayList<WeekDay> days = new ArrayList<WeekDay>();\r\n\t\r\n\t\t// value = ((byte)bitMask) & (0x01 << position);\r\n\t\tif ((((byte)bitMask) & (0x01 << 7)) > 0)\r\n\t\t\tdays.add(WeekDay.MONDAY);\r\n\t\tif ((((byte)bitMask) & (0x01 << 6)) > 0)\r\n\t\t\tdays.add(WeekDay.TUESDAY);\r\n\t\tif ((((byte)bitMask) & (0x01 << 5)) > 0)\r\n\t\t\tdays.add(WeekDay.WEDNESDAY);\r\n\t\tif ((((byte)bitMask) & (0x01 << 4)) > 0)\r\n\t\t\tdays.add(WeekDay.THURSDAY);\r\n\t\tif ((((byte)bitMask) & (0x01 << 3)) > 0)\r\n\t\t\tdays.add(WeekDay.FRIDAY);\r\n\t\tif ((((byte)bitMask) & (0x01 << 2)) > 0)\r\n\t\t\tdays.add(WeekDay.SATURDAY);\r\n\t\tif ((((byte)bitMask) & (0x01 << 1)) > 0)\r\n\t\t\tdays.add(WeekDay.SUNDAY);\r\n\t\t\r\n\t\treturn days;\r\n\t}", "List<Day> getDays(String userName);", "public DayOfWeek diaDaSemana(LocalDate d);", "com.czht.face.recognition.Czhtdev.Week getWeekday();", "public static void showDaysFromLastMonday(LocalDate lastMonday){\n String targetDate;\n for(int i = 0; i < 7; i++){\n targetDate = lastMonday.plusDays(i).format(DateTimeFormatter.ISO_DATE);\n System.out.println(\"The date is: \" + targetDate);\n }\n }", "private int calculateNumberOfDaysOfWeek (DayOfWeek dayOfWeek) {\n LocalDate dateIterator = startDate.with(nextOrSame(dayOfWeek));\n if (dateIterator.isAfter(endDate)) {\n return 0;\n }\n\n int numberOfDayOfWeek = 1;\n\n while (dateIterator.isBefore(endDate)) {\n dateIterator = dateIterator.with(next(dayOfWeek));\n if (dateIterator.isBefore(endDate) || dateIterator.isEqual(endDate)) {\n numberOfDayOfWeek++;\n }\n }\n\n return numberOfDayOfWeek;\n }", "public int[] getDaysOfWeek() {\n return daysOfWeek;\n }", "public ArrayList<Integer> getValidDays(Date date)\r\n\t{\r\n\t\tint maxDay = Date.maxDayOfMonthAndYear(date.getYear(), date.getMonth());\r\n\t\tArrayList <Integer> validDays = new ArrayList<Integer>(maxDay);\r\n\t\t\r\n\t\tfor (int day = 1; day <= maxDay; day++)\r\n\t\t\tvalidDays.add(day);\r\n\t\t\r\n\t\treturn validDays;\r\n\t}", "private void dayOfWeek(HplsqlParser.Expr_func_paramsContext ctx) {\n Integer v = getPartOfDate(ctx, Calendar.DAY_OF_WEEK);\n if (v != null) {\n evalInt(v);\n }\n else {\n evalNull();\n }\n }", "DayOfWeek getUserVoteSalaryWeeklyDayOfWeek();", "public int getDayOfWeek();", "private RepeatWeekdays() {}", "public static Date addWeeks(final Date date, final int weeks) {\n return Dates.add(date, weeks, Calendar.WEEK_OF_YEAR);\n }", "public static Date addWeeks(final Date date, final int amount) {\n final Calendar calendar = Calendar.getInstance();\n calendar.setTime(date);\n calendar.add(Calendar.WEEK_OF_YEAR, amount);\n return calendar.getTime();\n }", "public int convertWeekDay() {\r\n\t\treturn convertWeekDay(this);\r\n\t}", "public LocalDate getDay(DayOfWeek dayOfWeek) {\n return days.get(dayOfWeek.getValue() - 1);\n }", "public Builder workweekStarts(DayOfWeek day) {\n\t\t\tworkweekStarts = day;\n\t\t\treturn this;\n\t\t}", "public Builder byDay(DayOfWeek... days) {\n\t\t\treturn byDay(Arrays.asList(days));\n\t\t}", "public Integer[][] getAll() {\r\n return weekData;\r\n }", "public Builder byDay(Collection<DayOfWeek> days) {\n\t\t\tfor (DayOfWeek day : days) {\n\t\t\t\tbyDay(null, day);\n\t\t\t}\n\t\t\treturn this;\n\t\t}", "public static LocalDate[] getFirstDayWeekly(final int year) {\n\n final List<LocalDate> dates = new ArrayList<>();\n\n LocalDate localDate = LocalDate.ofYearDay(year, 1).with(TemporalAdjusters.previousOrSame(DayOfWeek.SUNDAY));\n\n final LocalDate testDate = LocalDate.ofYearDay(year, 1);\n if (testDate.getDayOfWeek() == DayOfWeek.THURSDAY) {\n dates.add(testDate.minusDays(4));\n }\n\n for (int i = 0; i <= 53; i++) {\n if (localDate.getYear() == year) {\n dates.add(localDate);\n }\n\n localDate = localDate.plusWeeks(1);\n }\n\n return dates.toArray(new LocalDate[dates.size()]);\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 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 int GetDay(){\n\t\treturn this.date.get(Calendar.DAY_OF_WEEK);\n\t}", "public Weekday getDayOfWeek() {\n\n long utcDays = CALSYS.transform(this);\n return Weekday.valueOf(MathUtils.floorModulo(utcDays + 5, 7) + 1);\n\n }", "public static final Function<Date,Date> setWeek(final int value) {\r\n return new Set(Calendar.WEEK_OF_YEAR, value);\r\n }", "public static String getDayOfWeek(String date) {\n // TODO: move to DateUtils\n Date dateDT = DateUtils.parseDate(date);\n\n if (dateDT == null) {\n return null;\n }\n\n // Get current date\n Calendar c = Calendar.getInstance();\n // it is very important to\n // set the date of\n // the calendar.\n c.setTime(dateDT);\n int day = c.get(Calendar.DAY_OF_WEEK);\n\n String dayStr = null;\n\n switch (day) {\n\n case Calendar.SUNDAY:\n dayStr = \"Sunday\";\n break;\n\n case Calendar.MONDAY:\n dayStr = \"Monday\";\n break;\n\n case Calendar.TUESDAY:\n dayStr = \"Tuesday\";\n break;\n\n case Calendar.WEDNESDAY:\n dayStr = \"Wednesday\";\n break;\n\n case Calendar.THURSDAY:\n dayStr = \"Thursday\";\n break;\n\n case Calendar.FRIDAY:\n dayStr = \"Friday\";\n break;\n\n case Calendar.SATURDAY:\n dayStr = \"Saturday\";\n break;\n }\n\n return dayStr;\n }", "void onWeekNumberClick ( @NonNull MaterialCalendarView widget, @NonNull CalendarDay date );", "public int getWeekDay()\n\t{\n\t\tif (m_nType == AT_WEEK_DAY)\n\t\t\treturn ((Integer)m_oData).intValue();\n\t\telse\n\t\t\treturn -1;\n\t}", "com.czht.face.recognition.Czhtdev.WeekOrBuilder getWeekdayOrBuilder();", "public int getTotalDays() {\r\n int totalDays = 0;\r\n for (int d = 0; d < 5; d++) {\r\n for (int h = 0; h < 13; h++) {\r\n if (weekData[d][h] != 0) {\r\n totalDays += 1;\r\n break;\r\n }\r\n }\r\n }\r\n return totalDays;\r\n }", "public boolean averageWeekDriveDistance(String date)\n\t{\n\t\tint count = 0;\n\t\tdouble totalDistance = 0;\n\n\t\tString beginningOfWeek = \"\";\n\t\tString endOfWeek = \"\";\n\n\t\t//find the specified week\n\t\tfor(int i = 0; i < saveData.size(); i++)\n\t\t{\n\t\t\tString dateToCheck = saveData.get(i).get(\"date\");\n\t\t\tif(dateToCheck.equals(date))\n\t\t\t{\n\t\t\t\t//we have found the date, now to find the beginning and end of the week \n\t\t\t}\n\t\t}\n\t}", "public com.czht.face.recognition.Czhtdev.Week.Builder getWeekdayBuilder() {\n bitField0_ |= 0x00000010;\n onChanged();\n return getWeekdayFieldBuilder().getBuilder();\n }", "public TextView[] Weekdays(){\n Resources r = getResources();\n String name = getPackageName();\n String WeekDays[]={\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\",\"Sun\"};\n String DummyWeekDays[]={\"F1\",\"F2\",\"F3\",\"F4\",\"F5\",\"F6\",\"F7\"};\n TextView Weekdays[]=new TextView[7];\n DropDownCalendar.setCurrentDate(Calendar.getInstance());\n for(int i=0;i<WeekDays.length;++i) {\n TextView weekday,dummyWeekday;\n weekday = (TextView) findViewById(r.getIdentifier(WeekDays[i], \"id\", name));\n dummyWeekday=(TextView)findViewById(r.getIdentifier(DummyWeekDays[i],\"id\",name));\n Weekdays[i]=weekday;\n dummyWeekday.setTextColor(Color.TRANSPARENT);\n dummyWeekday.setHintTextColor(Color.TRANSPARENT);\n MaskWeekdays[i]=dummyWeekday;;\n\n }\n return Weekdays;\n }", "public boolean hasWeekday() {\n return ((bitField0_ & 0x00000010) == 0x00000010);\n }", "public ArrayList<Event> eventsInDay(LocalDate day) {\n ArrayList<Event> myList = new ArrayList<>();\n for (Event e : myAgenda) {\n if (e.isInDay(day)) {\n myList.add(e);\n }\n }\n return myList;\n }", "private int getWeekday() {\n Calendar cal = Calendar.getInstance();\n int i = cal.get(Calendar.DAY_OF_WEEK);\n int weekday = i == 1 ? 6 : (i - 2) % 7;\n myApplication.setWeekday(weekday);\n return weekday;\n }", "public static int convertWeekDays(List<WeekDay> days) {\r\n\t\tint bitMask = 0;\r\n\t\tfor (WeekDay day : days) {\r\n\t\t\tbitMask += convertWeekDay(day);\r\n\t\t}\r\n\t\treturn bitMask;\r\n\t}", "public boolean hasWeekday() {\n return ((bitField0_ & 0x00000010) == 0x00000010);\n }", "private String getWeekDay(int i) {\n String day = \"\";\n switch (i) {\n case 0:\n day = \"Sunday\";\n break;\n case 1:\n day = \"Monday\";\n break;\n case 2:\n day = \"Tuesday\";\n break;\n case 3:\n day = \"Wednesday\";\n break;\n case 4:\n day = \"Thursday\";\n break;\n case 5:\n day = \"Friday\";\n break;\n case 6:\n day = \"Saturday\";\n break;\n\n }\n return day;\n }", "private void loadDays(){\n MyDBHandler db = new MyDBHandler(this);\n dayOfTheWeek.clear();\n dayOfTheWeek.addAll(db.getDaysOfTheWeek());\n }", "public Integer getDayOfWeek() {\n return dayOfWeek;\n }", "public static String addWeeksToDate(String date, int numberOfWeeks) {\r\n\t\t\r\n\t\ttry {\r\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\", Locale.UK);\r\n\t\t\tDateTime dt = new DateTime((Date) sdf.parse(date));\r\n\t\t\tDateTime dt2 = dt.plusWeeks(numberOfWeeks);\r\n\t\t\treturn dt2.toString(\"yyyy-MM-dd\");\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn date;\r\n\t\t}\r\n\t}", "public static long getFirstDayOfWeek(int day) {\n\t\tMutableDateTime firstDay = utc(day);\n\t\tfirstDay.setDayOfWeek(1);\n\t\treturn days(firstDay);\n\t}", "boolean getWeek7();", "@RequestMapping(value = \"/week/all\", \n\t\t\tmethod = RequestMethod.GET, \n\t\t\tproduces = MediaType.APPLICATION_JSON_VALUE)\n\tpublic ResponseEntity<List<Week>> getAllWeek() {\n\n\t\tResponseEntity<List<Week>> returnEntity;\n\n\t\ttry {\n\t\t\tList<Week> result = businessDelegate.getAllWeeks();\n\n\t\t\tif (result == null) {\n\t\t\t\treturnEntity = new ResponseEntity<List<Week>>(result, HttpStatus.NOT_FOUND);\n\t\t\t} else {\n\t\t\t\treturnEntity = new ResponseEntity<List<Week>>(result, HttpStatus.OK);\n\t\t\t}\n\t\t} catch (RuntimeException e) {\n\t\t\treturnEntity = new ResponseEntity<List<Week>>(HttpStatus.BAD_REQUEST);\n\t\t}\n\t\treturn returnEntity;\n\t}", "int getWeek();", "public ArrayList<Event> getCalendarEventsByWeek()\n {\n ArrayList<Event> weekListOfEvents = new ArrayList<>();\n\n for(int i = 0; i < events.size(); i++)\n {\n if( (events.get(i).getCalendar().get(Calendar.YEAR) == currentCalendar.get(Calendar.YEAR)) &&\n (events.get(i).getCalendar().get(Calendar.MONTH) == currentCalendar.get(Calendar.MONTH)) &&\n (events.get(i).getCalendar().get(Calendar.WEEK_OF_MONTH) == currentCalendar.get(Calendar.WEEK_OF_MONTH)))\n {\n weekListOfEvents.add(events.get(i));\n }\n }\n return weekListOfEvents;\n }", "@java.lang.Override\n public app.onepass.apis.DayOfWeek getDay() {\n @SuppressWarnings(\"deprecation\")\n app.onepass.apis.DayOfWeek result = app.onepass.apis.DayOfWeek.valueOf(day_);\n return result == null ? app.onepass.apis.DayOfWeek.UNRECOGNIZED : result;\n }", "@java.lang.Override public app.onepass.apis.DayOfWeek getDay() {\n @SuppressWarnings(\"deprecation\")\n app.onepass.apis.DayOfWeek result = app.onepass.apis.DayOfWeek.valueOf(day_);\n return result == null ? app.onepass.apis.DayOfWeek.UNRECOGNIZED : result;\n }", "private void setCheckedDays(List<Boolean> repeatedDays){\n for(int i = 0; i < DateTime.DAYS_IN_WEEK; i++){\n mWeekCheckBoxes[i].setChecked(repeatedDays.get(i));\n }\n }", "public final int getISODayOfWeek()\n {\n return isoDayOfWeek(ordinal);\n }", "private boolean isWeekend(final Calendar date) {\n return Calendar.SATURDAY == date.get(Calendar.DAY_OF_WEEK)\n || Calendar.SUNDAY == date.get(Calendar.DAY_OF_WEEK);\n }", "public Weet[] getWeetsOn(Date dateOn) {\n return tree.toOnArray(dateOn);\n }", "public DayOfWeek getWorkweekStarts() {\n\t\treturn workweekStarts;\n\t}", "@SuppressWarnings(\"unchecked\")\n\t@External(readonly = true)\n\tpublic Map<String, String> get_daily_wagers(BigInteger day) {\n\t\tif (day.compareTo(BigInteger.ONE) == -1) {\n\t\t\tBigInteger now = BigInteger.valueOf(Context.getBlockTimestamp());\t\t\n\t\t\tday.add(now.divide(U_SECONDS_DAY));\t\t\t\n\t\t}\n\t\t\n\t\t Map.Entry<String, String>[] wagers = new Map.Entry[this.get_approved_games().size()];\n\t\t \n\t\tfor (int i= 0; i< this.get_approved_games().size(); i++ ) {\n\t\t\tAddress game = this.get_approved_games().get(i);\n\t\t\twagers[i] = Map.entry(game.toString(), String.valueOf(this.wagers.at(day).get(game)) );\n\t\t}\n\t\treturn Map.ofEntries(wagers);\n\t}", "protected final String getWeekDay(Calendar day) {\n switch (day.get(Calendar.DAY_OF_WEEK)) {\n case Calendar.SUNDAY:\n return \"SUNDAY\";\n case Calendar.MONDAY:\n return \"MONDAY\";\n case Calendar.TUESDAY:\n return \"TUESDAY\";\n case Calendar.WEDNESDAY:\n return \"WEDNESDAY\";\n case Calendar.THURSDAY:\n return \"THURSDAY\";\n case Calendar.FRIDAY:\n return \"FRIDAY\";\n case Calendar.SATURDAY:\n return \"SATURDAY\";\n default:\n return \"MONDAY\";\n }\n }", "private int[] parseDaysOfWeek(String str) {\n try {\n return enumerate(str.replaceAll(\"7\", \"0\"), 0, 6);\n } catch (IllegalArgumentException e) {\n throw new IllegalArgumentException(\"Error parsing days of week: \" + e.getMessage());\n }\n }", "public static boolean isWorkingDay(Date d) {\r\n \tLocalDate date = d.toLocalDate();\r\n \tArrayList<LocalDate> phDates = getPhDates();\r\n \t\r\n \tif(date.getDayOfWeek() == DayOfWeek.SATURDAY)\r\n\t\t\treturn false;\r\n\t\tif(date.getDayOfWeek() == DayOfWeek.SUNDAY)\r\n\t\t\treturn false;\r\n\t\tif(phDates.contains(date))\r\n\t\t\treturn false;\r\n\r\n\t\treturn true; \t\r\n }", "public int getDay_Of_Week() \n\t{\n\t\treturn m_calendar.get(Calendar.DAY_OF_WEEK);\n\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 Day getWeekStartDay()\r\n {\r\n return (m_weekStartDay);\r\n }", "private static void checkDay(Calendar calendar, int days, int daysPerWeek) {\r\n\r\n\t\tint day = calendar.get(Calendar.DAY_OF_WEEK) - 1;\r\n\r\n\t\tswitch (daysPerWeek) {\r\n\r\n\t\tcase 1:\r\n\t\t\tif (day == 1)\r\n\t\t\t\tcalendar.add(Calendar.DAY_OF_WEEK, 7);\r\n\t\t\telse\r\n\t\t\t\tcalendar.add(Calendar.DAY_OF_WEEK, (getRestDaysOfWeek(day) + 1));\r\n\r\n\t\t\tbreak;\r\n\t\tcase 7:\r\n\t\t\tcalendar.add(Calendar.DAY_OF_MONTH, days);\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tcheckDayHelper(calendar, days, daysPerWeek, day);\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t}", "public DateTimeFormatterBuilder appendDayOfWeek(int minDigits) {\r\n return appendDecimal(DateTimeFieldType.dayOfWeek(), minDigits, 1);\r\n }", "public static int shiftWeekDay(WeekDay day) {\r\n\t\tif (day == SUNDAY)\r\n\t\t\treturn 7;\r\n\t\telse\r\n\t\t\treturn day.ordinal();\r\n\t}", "public static int GetDayOfWeek(int[] dateTime){\n int yr = dateTime[0];\n int mo = dateTime[1];\n int da = dateTime[2];\n int addon = 0; /* number of days that have advanced */\n boolean leap; /* is this year a leap year? */\n yr %= 400;\n if (yr < 0) yr += 400;\n /* is the current year a leap year? */\n if (((((yr % 4) == 0) && ((yr % 100) != 0)) || ((yr % 400) == 0))) {\n leap = true;\n } else leap = false;\n if ((mo < 1) || (mo > 12)) return 0; /* validate the month */\n if (da < 1) return 0; /* and day of month */\n if (leap && (mo == 2)) {\n if (da > (numdays[mo - 1] + 1)) return 0;\n } else if (da > numdays[mo - 1]) return 0;\n addon += yr; /* The day advances by one day every year */\n addon += yr / 4; /* An additional day if it is divisible bay 4 */\n addon -= yr / 100; /* Unless it is divisible by 100 */\n /* However, we should not count that\n extra day if the current year is a leap\n year and we haven't gone past 29th February */\n if (leap && (mo <= 2)) addon--;\n addon += totdays[mo - 1]; /* The day of the week increases by\n the number of days in all the months\n up till now */\n addon += da; /* the day of week advances for each day */\n /* Now as we all know, 2000-01-01 is a Saturday. Using this\n as our reference point, and the knowledge that we want to\n return 0..6 for Sunday..Saturday,\n we find out that we need to compensate by adding 6. */\n addon += 6;\n return (addon % 7); /* the remainder after dividing by 7\n gives the day of week */\n }", "private static boolean isSunday(long[] date){\n long day = date[2];\n long month = date[1];\n long year = date[0];\n \n // Use Zeller's Congruence formula to derive the day of the week of a date\n // h = ( q + 13*(m+1)/5 + k + k/4 + j/4 - 2*j ) mod 7\n \n // Day of the month\n long q = day - 1;\n // Month\n long m = month;\n // January or February need to be considered as month 13 & 14 of the previous year\n if(m < 3){\n m += 12;\n year--;\n }\n // Year of the century\n long k = year % 100;\n // Zero-based century\n long j = (long) Math.floor(year / 100);\n \n // Day of the week\n int h = (int) ((q + Math.floor(13 * (m + 1) / 5) + k + Math.floor(k/4) + Math.floor(j/4) - 2*j) % 7);\n \n // Return if the day of the week is Sunday or not\n boolean isSunday = h == SUNDAY;\n return isSunday;\n }", "public static int getDaysFromNow(Date date) throws Exception{\n\n if(date != null) {\n Days daysbetween = Days.daysBetween(new DateTime(date.getTime()), new DateTime().now());\n return daysbetween.getDays();\n }\n else\n throw new Exception();\n }", "public List<String> getDates() {\n\n List<String> listDate = new ArrayList<>();\n\n Calendar calendarToday = Calendar.getInstance();\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"yyyy-MM-dd\", Locale.ENGLISH);\n String today = simpleDateFormat.format(calendarToday.getTime());\n\n Calendar calendarDayBefore = Calendar.getInstance();\n calendarDayBefore.setTime(calendarDayBefore.getTime());\n\n int daysCounter = 0;\n\n while (daysCounter <= 7) {\n\n if (daysCounter == 0) { // means that its present day\n listDate.add(today);\n } else { // subtracts 1 day after each pass\n calendarDayBefore.add(Calendar.DAY_OF_MONTH, -1);\n Date dateMinusOneDay = calendarDayBefore.getTime();\n String oneDayAgo = simpleDateFormat.format(dateMinusOneDay);\n\n listDate.add(oneDayAgo);\n\n }\n\n daysCounter++;\n }\n\n return listDate;\n\n }", "public static Calendar startOfWeek(Date inDate, TimeZone timeZone) {\r\n\r\n\t\tCalendar c1 = Calendar.getInstance(timeZone);\r\n\t\tc1.setTime(inDate);\r\n\t\t\r\n\t\tCalendar c2 = Calendar.getInstance(timeZone);\r\n\t\tc2.clear();\r\n\t\t\r\n\t\tint daysBefore = isoDayOfWeek(c1.get(Calendar.DAY_OF_WEEK)) - 1;\r\n\t\t\r\n\t\tc2.set(c1.get(Calendar.YEAR), c1.get(Calendar.MONTH), \r\n\t\t\t\tc1.get(Calendar.DAY_OF_MONTH) - daysBefore);\r\n\t\treturn c2;\t\t\r\n\t}", "public com.czht.face.recognition.Czhtdev.WeekOrBuilder getWeekdayOrBuilder() {\n if (weekdayBuilder_ != null) {\n return weekdayBuilder_.getMessageOrBuilder();\n } else {\n return weekday_ == null ?\n com.czht.face.recognition.Czhtdev.Week.getDefaultInstance() : weekday_;\n }\n }", "private void setDay() {\n Boolean result = false;\n for (int i = 0; i < 7; ++i) {\n if(mAlarmDetails.getRepeatingDay(i))\n result = true;\n mAlarmDetails.setRepeatingDay(i, mAlarmDetails.getRepeatingDay(i));\n }\n if(!result)\n mAlarmDetails.setRepeatingDay((Calendar.getInstance().get(Calendar.DAY_OF_WEEK) - 1), true);\n }", "public abstract SortedSet<CalendarEvent> getEventsAt(User user, Date day);", "public Builder byDay(Integer num, DayOfWeek day) {\n\t\t\tbyDay.add(new ByDay(num, day));\n\t\t\treturn this;\n\t\t}", "private List<String> makeListOfDates(HashSet<Calendar> workDays) {\n //SimpleDateFormat sdf = new SimpleDateFormat(\"dd/MM/YYYY\");\n SimpleDateFormat sdf = new SimpleDateFormat();\n List<String> days = new ArrayList<>();\n for (Calendar date : workDays) {\n //SimpleDateFormat sdf = new SimpleDateFormat(\"dd/MM/YYYY\");\n days.add(sdf.format(date.getTime()));\n }\n\n return days;\n }", "public int shiftWeekDay() {\r\n\t\treturn shiftWeekDay(this);\r\n\t}", "public ArrayList<Event> remainingEventsForTheWeek() {\n\t\tArrayList<Event> result = new ArrayList();\n\n\t\tLocalDateTime now = this.now.get();\n\t\tLocalDate today = now.toLocalDate();\n\t\tLocalTime moment = now.toLocalTime();\n\t\tboolean after = false;\n\n\t\tdo {\n\t\t\tTreeSet<Event> todayEvents = this.events.get(today);\n\t\t\tif (todayEvents != null) {\n\t\t\t\t// Events are sorted\n\t\t\t\tfor (Event e: todayEvents) {\n\t\t\t\t\tif (after) {\n\t\t\t\t\t\tresult.add(e);\n\t\t\t\t\t} else if (e.startTime.compareTo(moment) >= 0) {\n\t\t\t\t\t\tresult.add(e);\n\t\t\t\t\t\tafter = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\tafter = true;\n\t\ttoday = today.plusDays(1);\n\t\t// Week ends on Sunday.\n\t\t} while (today.getDayOfWeek() != DayOfWeek.MONDAY);\n\n\t\treturn result;\n\t}", "public com.czht.face.recognition.Czhtdev.WeekOrBuilder getWeekdayOrBuilder() {\n return weekday_ == null ? com.czht.face.recognition.Czhtdev.Week.getDefaultInstance() : weekday_;\n }", "private DayOfWeek convertDayOfWeek(Time.Day studentDay) {\n switch (studentDay) {\n case Sunday:\n return DayOfWeek.SUNDAY;\n\n case Monday:\n return DayOfWeek.MONDAY;\n\n case Tuesday:\n return DayOfWeek.TUESDAY;\n\n case Wednesday:\n return DayOfWeek.WEDNESDAY;\n\n case Thursday:\n return DayOfWeek.THURSDAY;\n\n case Friday:\n return DayOfWeek.FRIDAY;\n\n default:\n return DayOfWeek.SATURDAY;\n }\n }", "public Calendar dayOfWeek(\r\n\t\t\tDayOfWeek dayOfWeek) {\r\n\t\t\r\n\t\tint day = dayOfWeek.getDayNumber();\r\n\t\t\t\t\r\n\t\tCalendar c2 = Calendar.getInstance(\r\n\t\t\t\tbaseCalendar.getTimeZone());\r\n\t\tc2.clear();\r\n\t\tc2.set(baseCalendar.get(Calendar.YEAR), \r\n\t\t\t\tbaseCalendar.get(Calendar.MONTH), \r\n\t\t\t\tbaseCalendar.get(Calendar.DAY_OF_MONTH));\r\n\t\t\r\n\t\tint offset = day - isoDayOfWeek(baseCalendar.get(Calendar.DAY_OF_WEEK));\r\n\t\t\r\n\t\tc2.add(Calendar.DATE, offset);\r\n\t\t\r\n\t\treturn c2;\r\n\t}", "public Integer getDayOfWeek() {\n if (dayOfWeek != null) {\n if (dayOfWeek == 7) {\n // Sunday\n return 1;\n }\n // Monday goes from 1 to 2, Tuesday from 2 to 3, etc.\n return dayOfWeek + 1;\n }\n return dayOfWeek;\n }", "public int dayOfWeek() {\r\n\t\treturn mC.get(Calendar.DAY_OF_WEEK) - 1;\r\n\t}", "public List<DatabaseStore> getVarValuesForWeek(String variable,\n\t\t\tInteger month, Integer day, Integer year, Integer week_day) {\n\t\tSQLiteDatabase db = this.getWritableDatabase();\n\t\tString day_str = QUES_KEY_VAR + \"='\" + variable + \"' AND ( (\"\n\t\t\t\t+ QUES_KEY_DAY + \"=\" + day + \" AND \" + QUES_KEY_MONTH + \"=\"\n\t\t\t\t+ month + \" AND \" + QUES_KEY_YEAR + \"=\" + year + \")\";\n\n\t\tSimpleDateFormat year_fmt = new SimpleDateFormat(\"yyyy\", Locale.US);\n\t\tSimpleDateFormat month_fmt = new SimpleDateFormat(\"MM\", Locale.US);\n\t\tSimpleDateFormat day_fmt = new SimpleDateFormat(\"dd\", Locale.US);\n\n\t\tfor (int i = 0; i < 7; i++) {\n\t\t\tInteger diff = null;\n\t\t\tGregorianCalendar cal = new GregorianCalendar(year, month - 1, day);\n\t\t\tif (week_day < i) {\n\t\t\t\tdiff = i - week_day;\n\t\t\t\tcal.add(Calendar.DAY_OF_YEAR, diff);\n\t\t\t\tDate date = cal.getTime();\n\t\t\t\tint y = Integer.parseInt(year_fmt.format(date));\n\t\t\t\tint m = Integer.parseInt(month_fmt.format(date));\n\t\t\t\tint d = Integer.parseInt(day_fmt.format(date));\n\t\t\t\tday_str = day_str + \" OR (\" + QUES_KEY_DAY + \"=\" + d + \" AND \"\n\t\t\t\t\t\t+ QUES_KEY_MONTH + \"=\" + m + \" AND \" + QUES_KEY_YEAR\n\t\t\t\t\t\t+ \"=\" + y + \")\";\n\t\t\t} else if (week_day > i) {\n\t\t\t\tdiff = week_day - i;\n\t\t\t\tcal.add(Calendar.DAY_OF_YEAR, -1 * diff);\n\t\t\t\tDate date = cal.getTime();\n\t\t\t\tint y = Integer.parseInt(year_fmt.format(date));\n\t\t\t\tint m = Integer.parseInt(month_fmt.format(date));\n\t\t\t\tint d = Integer.parseInt(day_fmt.format(date));\n\t\t\t\tday_str = day_str + \" OR (\" + QUES_KEY_DAY + \"=\" + d + \" AND \"\n\t\t\t\t\t\t+ QUES_KEY_MONTH + \"=\" + m + \" AND \" + QUES_KEY_YEAR\n\t\t\t\t\t\t+ \"=\" + y + \")\";\n\t\t\t}\n\t\t}\n\t\tday_str += \")\";\n\t\tString query = \"SELECT * FROM \" + TABLE_QUES + \" WHERE \" + day_str;\n\t\tCursor cursor = db.rawQuery(query, null);\n\t\tif (cursor.getCount() == 0) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\treturn handleCursor(cursor);\n\t\t}\n\t}", "@Transactional(readOnly = true)\n\t@Query(value = \"SELECT s FROM StockPrice s where stockCd=:stockCd and curTime in (select lastDay from BFWeekDay bfw where date(lastDay) between :fromDate and :toDate) order by s.curTime\")\n\tpublic List<StockPrice> findWeekByStockCd(@Param(\"stockCd\") String stockCd, @Param(\"fromDate\") Date fromDate,\n\t\t\t@Param(\"toDate\") Date toDate);", "boolean hasWeek7();" ]
[ "0.67247504", "0.6622015", "0.6616762", "0.66110533", "0.650486", "0.6336867", "0.62721527", "0.6202836", "0.6161338", "0.60025406", "0.59424686", "0.593228", "0.59199756", "0.58744526", "0.58271617", "0.5737949", "0.5694747", "0.5684513", "0.56294405", "0.56067705", "0.5583484", "0.55681235", "0.5557826", "0.5507022", "0.5498662", "0.5441906", "0.54413944", "0.53822917", "0.5381172", "0.5364479", "0.53624034", "0.5352564", "0.5352532", "0.5314405", "0.53123266", "0.5297355", "0.527946", "0.52686566", "0.52500606", "0.52466446", "0.5243931", "0.523768", "0.5237127", "0.5234556", "0.52315617", "0.52306426", "0.522646", "0.52205545", "0.5215766", "0.5206757", "0.5186304", "0.5175773", "0.51739883", "0.51703465", "0.5142717", "0.51356554", "0.5135549", "0.5132327", "0.5129787", "0.51270276", "0.51224667", "0.5114492", "0.510577", "0.5103712", "0.51012504", "0.50954455", "0.50934744", "0.5088004", "0.5084958", "0.50822556", "0.50747305", "0.50733566", "0.507133", "0.5071174", "0.5063869", "0.50614315", "0.50537455", "0.5052258", "0.5027771", "0.50275725", "0.5026769", "0.5025214", "0.50214887", "0.5013193", "0.50084764", "0.4996025", "0.4990102", "0.49862817", "0.49862072", "0.49834388", "0.49823093", "0.49741277", "0.49705356", "0.496888", "0.49658802", "0.49657735", "0.49610153", "0.49605057", "0.49478582", "0.49401313" ]
0.70212024
0
Parses the given date/time String and returns a java.util.Date object
public static Date parseTime(String formattedTime) { return parseDate(formattedTime, DEFAULT_TIME_FORMAT); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private LocalDateTime parseDate(String timeStr) throws DateTimeParseException {\n return LocalDateTime.parse(timeStr, formatter);\n }", "public static Date parseTime(String time)\n\t{\n\t\treturn parseFormatDate(time, getTimeFormat());\n\t}", "public Date parse (String dateAsString , String dateFormat) throws Exception ;", "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 parseDate(String date) {\n return DateUtil.toDate(date);\n }", "private LocalDateTime parseDate(String s) {\n String[] splitDate = s.split(\" \", 2);\n // Split day, month, year\n String[] splitDateElements = splitDate[0].split(\"/\", 3);\n int day = parseInt(splitDateElements[0]);\n int month = parseInt(splitDateElements[1]);\n int year = parseInt(splitDateElements[2]);\n // Split hours and minutes\n int hours = parseInt(splitDate[1].substring(0, 2));\n int mins = parseInt(splitDate[1].substring(2, 4));\n return LocalDateTime.of(year, month, day, hours, mins);\n }", "public static synchronized Date parseDate(String s) throws ParseException {\n return dateFormat.parse(s);\n }", "public static Date parseDate(String date)\n\t{\n\t\treturn parseFormatDate(date, getDateFormat());\n\t}", "public static Date parseDateTime(String date)\n\t{\n\t\treturn parseFormatDate(date, getDateTimeFormat());\n\t}", "public Date parseString(String dateString) throws ParseException {\n return dateFormat.parse(dateString);\n }", "public static Date parseDateTime(String str)\n {\n if(Empty.isEmpty(str))\n return null;\n if(str.length() <= 10)\n return parse(str);\n try{\n \treturn (new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\")).parse(str);\n\t\t}catch(ParseException e){\n\t\t \t return null;\n\t\t}\n }", "public static Date stringToTime(String time)\r\n/* 43: */ {\r\n/* 44: */ try\r\n/* 45: */ {\r\n/* 46: 54 */ return sdfTime.parse(time);\r\n/* 47: */ }\r\n/* 48: */ catch (ParseException e)\r\n/* 49: */ {\r\n/* 50: 56 */ log.fatal(\"DateUtil.stringToTime抛出异常\", e);\r\n/* 51: */ }\r\n/* 52: 57 */ return new Date();\r\n/* 53: */ }", "public static Date parse(String input) throws java.text.ParseException {\n\t\treturn new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.S\").parse(input);\n\n\t}", "private static Date convertFromString(String dateString) throws ParseException {\n return new SimpleDateFormat(\"yyyyMMddHHmm\").parse(dateString);\n }", "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 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 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: */ }", "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 static Date parseDate(String date) {\r\n return parseDateWithPattern(date, \"dd/MM/yyyy\");\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 LocalDate parse(String dateStr) {\n String d = dateStr.substring(0, dateStr.indexOf('T'));\n LocalDate ld = null;\n try {\n ld = LocalDate.parse(d);\n } catch (Exception e) {\n System.err.println(\"Failed to parse datestring \" + dateStr + \" into a LocalDate!\");\n //e.printStackTrace();\n }\n // TODO: review what happens if format is invalid/LocalDate.parse fails - throw error, return null or both?\n return ld;\n }", "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 }", "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 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: */ }", "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 LocalDateTime parseDate(String str) {\n String time = str.substring(str.indexOf(\",\") + 2);\n int hour = new Integer(time.split(\":\")[0].trim());\n int min = new Integer(time.split(\":\")[1].trim());\n LocalTime localTime = LocalTime.of(hour, min);\n\n str = str.substring(0, str.indexOf(\",\")).trim();\n LocalDate localDate = LocalDate.now();\n\n if (str.contains(\"вчера\")) {\n localDate.minusDays(1);\n } else if (!str.contains(\"сегодня\") && !str.contains(\"вчера\")) {\n int year = new Integer(\"20\" + str.substring(str.length() - 2));\n String strMonth = str.substring(2, 6).trim();\n int day = new Integer(str.substring(0, 2).trim());\n localDate = LocalDate.of(year, parseMonth(strMonth), day);\n }\n return LocalDateTime.of(localDate, localTime);\n }", "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}", "@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 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 }", "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 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 convertStringToDate(String s) throws ParseException {\n\t\tDate dateTime = SDF.parse(s);\n\t\treturn dateTime;\n\t}", "private static Date parseTimestringWithMillis(String timestring) throws ParseException{\r\n boolean containsT = timestring.contains(\"T\");\r\n boolean containsSpace = timestring.contains(\" \");\r\n int len = timestring.length();\r\n char dot = timestring.charAt(len-4);\r\n boolean containsDot = false;\r\n if(dot == '.'){\r\n containsDot = true;\r\n }\r\n if(!containsT && containsSpace && containsDot){\r\n try {\r\n Date date = formatMiliSecs.parse(timestring);\r\n return date;\r\n } catch (ParseException e) {\r\n throw new ParseException(e.getMessage(), 0);\r\n }\r\n }\r\n else if(containsT && !containsSpace && containsDot){\r\n try {\r\n Date date = formatMiliSecsWT.parse(timestring);\r\n return date;\r\n } catch (ParseException e) {\r\n throw new ParseException(e.getMessage(), 0);\r\n }\r\n }\r\n else{\r\n throw new ParseException(\"Unsupported pattern!\", 0);\r\n }\r\n }", "private static Date parseISOTimestring(String timestring) throws ParseException{\r\n boolean containsT = timestring.contains(\"T\");\r\n boolean containsSpace = timestring.contains(\" \");\r\n int len = timestring.length();\r\n char colonTZ = timestring.charAt(len-3);\r\n if(colonTZ == ':'){\r\n String part1 = timestring.substring(0, len-3);\r\n String part2 = timestring.substring(len-2, len);\r\n try{\r\n if(containsT){\r\n Date date = formatSecsTZwT.parse(part1+part2);\r\n return date;\r\n }else if(containsSpace){\r\n Date date = formatSecsTZ.parse(part1+part2);\r\n return date;\r\n }\r\n else{\r\n throw new ParseException(\"Unsupported pattern!\", 0);\r\n }\r\n } catch(ParseException e){\r\n throw new ParseException(e.getMessage(), 0);\r\n }\r\n }\r\n else{\r\n throw new ParseException(\"Unsupported pattern!\", 0);\r\n }\r\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 static Date parseDateTime(String formattedDate) {\n\t\treturn parseDate(formattedDate, DEFAULT_DATE_TIME_FORMAT);\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 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 Timestamp parseDateTime(String date) {\n if (date.endsWith(\"Z\"))\n return parseDateTime_(date);\n else\n return oneOf(date, format_with_tz, format_precise_with_tz);\n }", "public static Date parseHttpDate(String dateString)\n {\n if (dateString == null)\n {\n return null;\n }\n \n TimeZone gmt = TimeZone.getTimeZone(\"GMT\");\n \n for (int i = 0; i < INPUT_FORMATS.length; i++)\n {\n SimpleDateFormat format = new SimpleDateFormat(INPUT_FORMATS[i]);\n format.setTimeZone(gmt);\n try\n {\n return format.parse(dateString);\n }\n catch (ParseException e)\n {\n // try the next pattern\n }\n }\n \n return null;\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 static Date parseRFC3339Date(String dateString)\n throws java.text.ParseException, IndexOutOfBoundsException {\n\n Date currentDate = new Date();\n \n if (dateString.endsWith(\"Z\")) {\n try {\n SimpleDateFormat s = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'\");\n currentDate = s.parse(dateString);\n } catch (java.text.ParseException pe) {\n pe.printStackTrace();\n }\n return currentDate;\n }\n \n return currentDate;\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 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 DateParser(String dateAndTimeString) {\n this.dateAndTimeString = dateAndTimeString;\n }", "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 parseDate(String dateString, String userId) throws ParseException\n\t{\n\t\tif ((dateString == null) || (dateString.trim().length() == 0)) return null;\n\t\tDateFormat format = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT, getPreferredLocale(userId));\n\t\tformat.setTimeZone(getPreferredTimeZone(userId));\n\t\tDate rv = format.parse(dateString);\n\t\treturn rv;\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 java.util.Date parse(java.lang.String r4, java.text.ParsePosition r5) {\n /*\n r3 = this;\n boolean r0 = r3.looksLikeISO8601(r4)\n if (r0 == 0) goto L_0x000b\n java.util.Date r4 = r3.parseAsISO8601(r4, r5)\n return r4\n L_0x000b:\n int r0 = r4.length()\n L_0x000f:\n int r0 = r0 + -1\n if (r0 < 0) goto L_0x0021\n char r1 = r4.charAt(r0)\n r2 = 48\n if (r1 < r2) goto L_0x0021\n r2 = 57\n if (r1 <= r2) goto L_0x0020\n goto L_0x0021\n L_0x0020:\n goto L_0x000f\n L_0x0021:\n if (r0 >= 0) goto L_0x0034\n r0 = 0\n boolean r0 = com.fasterxml.jackson.core.p007io.NumberInput.inLongRange(r4, r0)\n if (r0 == 0) goto L_0x0034\n java.util.Date r5 = new java.util.Date\n long r0 = java.lang.Long.parseLong(r4)\n r5.<init>(r0)\n return r5\n L_0x0034:\n java.util.Date r4 = r3.parseAsRFC1123(r4, r5)\n return r4\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.fasterxml.jackson.databind.util.StdDateFormat.parse(java.lang.String, java.text.ParsePosition):java.util.Date\");\n }", "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 String parseTime(String time) {\n Date date = null;\n try {\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\", Locale.getDefault());\n String todaysDate = new SimpleDateFormat(\"yyyy-MM-dd\", Locale.getDefault()).format(new Date());\n date = simpleDateFormat.parse(todaysDate + \" \" + time.split(\" \")[0]);\n\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\", Locale.getDefault());\n sdf.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n return sdf.format(date);\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n return null;\n }", "public static LocalDate parseDate(String dateString)\n throws DateTimeParseException {\n\n // this parses '2011-12-03', timezone information ignored\n return LocalDate.parse(dateString, DateTimeFormatter.ISO_LOCAL_DATE);\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}", "private LocalDateTime parseTime(String time) {\n String[] str = time.split(\" \");\n String[] oldDate = str[0].split(\"/\");\n if (oldDate.length != 3) {\n throw new DukeException(\"OOPS!!! The time is not of the correct format!\");\n }\n LocalDateTime localTime;\n if (str.length > 1) {\n String hour = str[1].substring(0, 2);\n String min = str[1].substring(2, 4);\n\n localTime = LocalDateTime.of(Integer.parseInt(oldDate[2]), Integer.parseInt(oldDate[1]),\n Integer.parseInt(oldDate[0]), Integer.parseInt(hour), Integer.parseInt(min));\n } else {\n localTime = LocalDate.of(Integer.parseInt(oldDate[2]), Integer.parseInt(oldDate[1]),\n Integer.parseInt(oldDate[0]))\n .atStartOfDay();\n hasTime = false;\n }\n return localTime;\n }", "public LocalDateTime parseLocalDateTime(String inputString){\r\n LocalDateTime dateTime = null;\r\n\r\n //handle cases like Thu Oct 9 09:43:23 2016 where dayOfMonth has one digit\r\n Pattern patternDateTime1 = Pattern.compile(\"(Mon|Tue|Wed|Thu|Fri|Sat|Sun)\\\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\\\s{1,2}\\\\d\\\\s\\\\d{2}:\\\\d{2}:\\\\d{2}\\\\s\\\\d{4}\"); //date pattern\r\n DateTimeFormatter formatter1 = DateTimeFormatter.ofPattern(\"EEE MMM d HH:mm:ss yyyy\");\r\n Matcher matcherDateTime1 = patternDateTime1.matcher(inputString);\r\n\r\n //handle cases like Thu Oct 19 09:43:23 2016 where dayOfMonth has two digit\r\n Pattern patternDateTime2 = Pattern.compile(\"(Mon|Tue|Wed|Thu|Fri|Sat|Sun)\\\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\\\s{1,2}\\\\d{2}\\\\s\\\\d{2}:\\\\d{2}:\\\\d{2}\\\\s\\\\d{4}\"); //date pattern\r\n DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern(\"EEE MMM dd HH:mm:ss yyyy\");\r\n Matcher matcherDateTime2 = patternDateTime2.matcher(inputString);\r\n\r\n if (matcherDateTime1.find()){\r\n try {\r\n dateTime = LocalDateTime.parse(matcherDateTime1.group(),formatter1);\r\n } catch (Exception e) {\r\n return null;\r\n }\r\n }else if(matcherDateTime2.find()){\r\n try {\r\n dateTime = LocalDateTime.parse(matcherDateTime2.group(),formatter2);\r\n } catch (Exception e) {\r\n return null;\r\n }\r\n }\r\n return dateTime;\r\n }", "public static Date parseDateOnly(String dateString, String userId) throws ParseException\n\t{\n\t\tif ((dateString == null) || (dateString.trim().length() == 0)) return null;\n\t\tDateFormat format = DateFormat.getDateInstance(DateFormat.MEDIUM, getPreferredLocale(userId));\n\t\tformat.setTimeZone(getPreferredTimeZone(userId));\n\t\tDate rv = format.parse(dateString);\n\t\treturn rv;\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 parseDateFromDefault(String dateString) throws ParseException\n\t{\n\t\tif ((dateString == null) || (dateString.trim().length() == 0)) return null;\n\t\tDateFormat format = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT, Locale.getDefault());\n\t\tformat.setTimeZone(TimeZone.getDefault());\n\t\tDate rv = format.parse(dateString);\n\t\treturn rv;\n\t}", "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 }", "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 toDate(String dateStr, SimpleDateFormat format) throws ParseException {\r\n\t\treturn format.parse(dateStr);\r\n\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 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 LocalDate parseTime(String time) throws DateTimeParseException {\n try {\n return LocalDate.parse(time);\n } catch (DateTimeParseException e) {\n throw new DukeException(\"OOPS!!! Please specify the time in the yyyy-mm-dd format.\\n\");\n }\n }", "public Date parseDate(String date, String format) {\n return this.convertStringToDate(date, format);\n }", "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 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 DateTime parseTime(String str) {\n if (str.indexOf('.') == -1) {\n return DateTimeFormat.forPattern(\"HH:mm:ss\").withZoneUTC().parseDateTime(str);\n } else {\n return DateTimeFormat.forPattern(\"HH:mm:ss.SSS\").withZoneUTC().parseDateTime(str);\n }\n }", "private static Date parseTimestringWithMillisWithTimeZone(String timestring) throws ParseException{\r\n boolean containsT = timestring.contains(\"T\");\r\n boolean containsSpace = timestring.contains(\" \");\r\n int len = timestring.length();\r\n char dot = timestring.charAt(len-9);\r\n boolean containsDot = false;\r\n if(dot == '.'){\r\n containsDot = true;\r\n }\r\n if(!containsT && containsSpace && containsDot){\r\n try {\r\n Date date = formatMiliSecsTZ.parse(timestring);\r\n return date;\r\n } catch (ParseException e) {\r\n throw new ParseException(e.getMessage(), 0);\r\n }\r\n }\r\n else if(containsT && !containsSpace && containsDot){\r\n try {\r\n Date date = formatMiliSecsTZwT.parse(timestring);\r\n return date;\r\n } catch (ParseException e) {\r\n throw new ParseException(e.getMessage(), 0);\r\n }\r\n }\r\n else{\r\n throw new ParseException(\"Unsupported pattern!\", 0);\r\n }\r\n }", "private static Date parseISOTimestringWithMillis(String timestring) throws ParseException{\r\n boolean containsT = timestring.contains(\"T\");\r\n boolean containsSpace = timestring.contains(\" \");\r\n int len = timestring.length();\r\n char colonTZ = timestring.charAt(len-3);\r\n if(colonTZ == ':'){\r\n String part1 = timestring.substring(0, len-3);\r\n String part2 = timestring.substring(len-2, len);\r\n try{\r\n if(containsT){\r\n Date date = formatMiliSecsTZwT.parse(part1+part2);\r\n return date;\r\n }else if(containsSpace){\r\n Date date = formatMiliSecsTZ.parse(part1+part2);\r\n return date;\r\n }\r\n else{\r\n throw new ParseException(\"Unsupported pattern!\", 0);\r\n }\r\n } catch(ParseException e){\r\n throw new ParseException(e.getMessage(), 0);\r\n }\r\n }\r\n else{\r\n throw new ParseException(\"Unsupported pattern!\", 0);\r\n }\r\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 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 Time fromString( String timeStr ) {\n int hour, minute;\n\n String[] parts = timeStr.split( \":\" );\n if ( parts.length != 2 ) throw new NumberFormatException( timeStr );\n hour = Integer.parseInt( parts[ 0 ] );\n\n String[] subParts = parts[ 1 ].split( \" \" );\n if ( subParts.length > 2 ) throw new NumberFormatException( timeStr );\n minute = Integer.parseInt( subParts[ 0 ] );\n\n if ( subParts.length == 2 ) { // Meridiem indicator is present.\n switch ( subParts[ 1 ] ) {\n case \"AM\":\n case \"am\":\n if ( hour == Time.HALF_DAY_HRS ) {\n hour = 0;\n }\n break;\n case \"PM\":\n case \"pm\":\n if ( hour != Time.HALF_DAY_HRS ) {\n hour += Time.HALF_DAY_HRS;\n }\n break;\n default:\n throw new NumberFormatException( timeStr );\n }\n }\n if (\n hour < 0 || hour >= Time.HRS_PER_DAY ||\n minute < 0 || minute >= Time.MINS_PER_HR\n ) {\n throw new NumberFormatException( \"Bad time \" + hour + ':' + minute );\n }\n return new Time( hour, minute );\n }", "public static Date parseTimestamp(String time) throws ParseException{\r\n /**\r\n * Checks whether timestring contains UTC time zone identifier\r\n */\r\n boolean containsZ = time.contains(\"Z\");\r\n if(containsZ){\r\n time = time.replace(\"Z\", \"+0000\");\r\n }\r\n /**\r\n * checks if the timestring ends with \"+hh\" or \"-hh\" time zone definition\r\n * modifies timestring with minutes to time zone\r\n */\r\n char suffixTZ = time.charAt(time.length()-3);\r\n if(suffixTZ == '+' || suffixTZ == '-'){\r\n time = time+\"00\";\r\n }\r\n int len = time.length();\r\n /**\r\n * checks patterns ending with seconds only\r\n */\r\n if(len == patternSecsLen){\r\n return parseTimestampWithSeconds(time);\r\n }\r\n /**\r\n * checks patterns ending with milliseconds\r\n */\r\n else if(len == patternMiliSecsLen){\r\n return parseTimestringWithMillis(time);\r\n }\r\n /**\r\n * checks patterns ending with seconds and time zone\r\n */\r\n else if(len == patternSecsTZLen){\r\n return parseTimestampWithSecondsWithTimeZone(time);\r\n }\r\n /**\r\n * checks patterns ending with milliseconds and time zone\r\n */\r\n else if(len == patternMiliSecsTZLen){\r\n return parseTimestringWithMillisWithTimeZone(time);\r\n }\r\n /**\r\n * checks patterns according to ISO pattern\r\n */\r\n else if(len == patternISOLen){\r\n return parseISOTimestring(time);\r\n }\r\n /**\r\n * checks patterns according to ISO pattern with milliseconds\r\n */\r\n else if(len == patternISOMilisLen){\r\n return parseISOTimestringWithMillis(time);\r\n }\r\n /**\r\n * checks patterns ending with microseconds\r\n */\r\n else if(len == patternMicroSecLen){\r\n return parseTimestringWithMicros(time);\r\n }\r\n /**\r\n * checks patterns ending with microseconds and time zone\r\n */\r\n else if(len == patternMicroSecTZLen){\r\n return parseTimestringWithMicrosWithTimeZone(time);\r\n }\r\n \r\n else{\r\n throw new ParseException(\"Unsupported pattern!\", 0);\r\n }\r\n }", "public static Date parseDateTime(String val) {\n\n\t\tDate d = null;\n\t\tif (val != null && !val.equals(\"0\")) {\n\t\t\tSimpleDateFormat format = new SimpleDateFormat(\"dd/MM/yyyy HH:mm\");\n\t\t\ttry {\n\t\t\t\td = format.parse(val);\n\t\t\t} catch (ParseException e) {\n\t\t\t}\n\t\t}\n\n\t\treturn d;\n\n\t}", "private static Date parseTimestringWithMicros(String timestring) throws ParseException{\r\n boolean containsT = timestring.contains(\"T\");\r\n boolean containsSpace = timestring.contains(\" \");\r\n boolean containsDot = false;\r\n int len = timestring.length();\r\n char dot = timestring.charAt(len-7);\r\n if(dot == '.'){\r\n containsDot = true;\r\n }\r\n if(!containsT && containsSpace && containsDot){\r\n try {\r\n String milisTime = timestring.substring(0, patternMiliSecsLen);\r\n Date date = formatMiliSecs.parse(milisTime);\r\n return date;\r\n } catch (ParseException e) {\r\n throw new ParseException(e.getMessage(), 0);\r\n }\r\n }\r\n else if(containsT && !containsSpace && containsDot){\r\n try {\r\n String milisTime = timestring.substring(0, patternMiliSecsWTLen);\r\n Date date = formatMiliSecsWT.parse(milisTime);\r\n return date;\r\n } catch (ParseException e) {\r\n throw new ParseException(e.getMessage(), 0);\r\n }\r\n }\r\n else{\r\n throw new ParseException(\"Unsupported pattern!\", 0);\r\n }\r\n }", "private static Date parseTimestampWithSeconds(String timestring) throws ParseException{\r\n boolean containsT = timestring.contains(\"T\");\r\n boolean containsSpace = timestring.contains(\" \");\r\n if(!containsT && containsSpace){\r\n try {\r\n Date date = formatSecs.parse(timestring);\r\n return date;\r\n } catch (ParseException e) {\r\n throw new ParseException(e.getMessage(), 0);\r\n }\r\n }\r\n else if(containsT && !containsSpace){\r\n try {\r\n Date date = formatSecsWT.parse(timestring);\r\n return date;\r\n } catch (ParseException e) {\r\n throw new ParseException(e.getMessage(), 0);\r\n }\r\n }\r\n else{\r\n throw new ParseException(\"Unsupported pattern!\", 0);\r\n }\r\n }", "public static LocalDateTime parseDateTime(String input) {\n\n if (input.contains(\"Weekly\")) {\n WeeklyFlag = true;\n input = input.replace(\"Weekly\",\"\");\n }\n LocalDateTime dateTime = null;\n ArrayList<String> patterns = getPatterns(false);\n for (String pattern : patterns) {\n if (dateTime == null) {\n try {\n dateTime = LocalDateTime.parse(input.trim(), DateTimeFormatter.ofPattern(pattern));\n } catch (Exception e) {\n e.addSuppressed(new CommandException()); // do nothing basically.\n }\n } else {\n break;\n }\n }\n if (dateTime == null) {\n patterns = getPatterns(true);\n for (String datePattern : patterns) {\n if (dateTime == null) {\n try {\n dateTime = LocalDate.parse(input.trim(),\n DateTimeFormatter.ofPattern(datePattern)).atStartOfDay();\n } catch (Exception e) {\n e.addSuppressed(new CommandException()); // do nothing basically.\n }\n } else {\n break;\n }\n }\n }\n return dateTime;\n }", "Date HTMLDateToDatetime(String s)\n\t{\n\t\ttry\n\t\t{\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"EEE, dd MMM yyyy HH:mm:ss z\", java.util.Locale.US);\n\t\t\tjava.util.TimeZone tz = java.util.TimeZone.getTimeZone(\"GMT\");\n\t\t\tsdf.setTimeZone(tz);\n\t\t\treturn sdf.parse(s);\n\t\t\t\n\t\t}\n\t\tcatch(ParseException p)\n\t\t{\n\t\t\tlogger.warn(\"Could not parse RFC Date\", p);\n\t\t\treturn new Date();\n\t\t}\n\t}", "public static Date getDateFromString(String date, String format)\n {\n SimpleDateFormat formatter = new SimpleDateFormat(format);\n ParsePosition pos = new ParsePosition(0);\n\n // Parse the string back into a Time Stamp.\n return formatter.parse(date, pos);\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 LocalDate parseToDate(String date) throws DateTimeParseException {\n return LocalDate.parse(date,FORMATTER);\n }", "public static Date parseFedoraDate(String fedoraDateStr) throws ParseException {\r\n return FEDORA_DATE_FORMAT.parse(fedoraDateStr);\r\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 static Date parseDate(String formattedDate) {\n\t\treturn parseDate(formattedDate, DEFAULT_DATE_FORMAT);\n\t}", "@Override\n public Date parse(String text, Locale locale) throws ParseException {\n return getDateFormat().parse(text);\n }", "public static Instant parse(final String dateString) {\n for (DateTimeFormatter formatter : VALID_DATE_FORMATS) {\n try {\n final var temporalAccessor = formatter.parse(dateString);\n return Instant.from(temporalAccessor);\n } catch (final Exception e) {\n //ignore failures - if no date string is parsable, an error is thrown below\n }\n }\n throw new IllegalArgumentException(\"Invalid date format: \\\"\" + dateString + \"\\\"\");\n }", "public String parseTimeToTimeDate(String time) {\n Date date = null;\n try {\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\", Locale.getDefault());\n String todaysDate = new SimpleDateFormat(\"yyyy-MM-dd\", Locale.getDefault()).format(new Date());\n date = simpleDateFormat.parse(todaysDate + \" \" + time);\n\n SimpleDateFormat sdf = new SimpleDateFormat(\"HH:mm dd,MMM\", Locale.getDefault());\n //sdf.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n return sdf.format(date);\n\n } catch (ParseException e) {\n e.printStackTrace();\n }\n return null;\n }", "public static Time fromString(String str) {\n checkFormat(str);\n int h = Integer.parseInt(str.substring(0, 2));\n int m = Integer.parseInt(str.substring(3, 5));\n String mStr = str.substring(6);\n boolean b = mStr.equals(\"PM\");\n\n return new Time(h, m, b);\n }", "private static Date parseTimeStamp(String timestamp) {\n if (timestamp == null) {\n return null;\n }\n\n try {\n return SIMPLE_DATE_FORMAT.parse(timestamp);\n } catch (ParseException dateTimeParseException) {\n return null;\n }\n }", "public static String convertDateAndTime(String inputString) {\n String trimmedInputString = inputString.trim();\n\n if (trimmedInputString.length() < 10) {\n return convertTime(inputString);\n } else {\n String dateString = trimmedInputString.substring(0, 10).trim();\n String timeString = trimmedInputString.substring(10).trim();\n try {\n String date = LocalDate.parse(dateString).format(DateTimeFormatter.ofPattern(\"d MMM yyyy\"));\n\n if (timeString.length() == 4) {\n return date + \" \" + convertTime(timeString);\n }\n\n return date + timeString;\n } catch (DateTimeParseException e) {\n return inputString;\n }\n }\n }", "public static String fromDate(String s){\n \t\t\n \t\tString[] date = s.split(\"T\");\n \t\tString time = date[1].substring(0,5);\n \t\tString[] dates = date[0].split(\"-\"); \n \t\tString month = dates[1];\n \t\tString day = dates[2];\n \t\t\n \t\treturn day + \"/\" + month + \", kl: \" + time;\n \t}", "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 dateParsing(String birthDate2) {\n\t\treturn null;\r\n\t}", "public static Date fotmatDate21(String myDate) {\n\t\tDate dDate = new SimpleDateFormat(\"HH:mm:ss\").parse(myDate,\r\n\t\t\t\tnew ParsePosition(0));\r\n\t\treturn dDate;\r\n\t}", "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 }", "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 LocalDate parse(String dateString){\r\n\t\t\r\n\t\ttry{\r\n\t\t\t//below LocalDate::from means use method from in LocalDate(?)\r\n\t\t\treturn DATE_FORMATTER.parse(dateString,LocalDate::from);\r\n\t\t}\r\n\t\tcatch (DateTimeParseException e){\r\n\t\t\treturn null;\t\t\r\n\t\t}\r\n\t}", "@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}", "public static Timestamp parseString(String timestampString) {\n return parseString(timestampString, null, true);\n }" ]
[ "0.72596246", "0.7255489", "0.722601", "0.7178132", "0.7163799", "0.7053758", "0.70345867", "0.7033055", "0.7019309", "0.69936115", "0.69859034", "0.6976601", "0.6976055", "0.6942458", "0.685341", "0.6828391", "0.67344683", "0.6690023", "0.6678271", "0.66749215", "0.6672395", "0.6647422", "0.65680593", "0.6546989", "0.650767", "0.6505972", "0.6493748", "0.64924115", "0.64758724", "0.6444701", "0.64338124", "0.6416309", "0.63617325", "0.63462836", "0.6319424", "0.6302433", "0.6274427", "0.62502706", "0.6226218", "0.62257123", "0.6218206", "0.62109303", "0.6202324", "0.6201133", "0.61949193", "0.6187464", "0.61715925", "0.615176", "0.6148811", "0.6137675", "0.61355025", "0.6134092", "0.6127424", "0.61076885", "0.6100994", "0.60872155", "0.605169", "0.6048903", "0.60432035", "0.60356086", "0.60332566", "0.6029672", "0.6026553", "0.6013612", "0.60095596", "0.5993409", "0.5983242", "0.597581", "0.5962392", "0.59593827", "0.59376955", "0.5935767", "0.59343356", "0.5932293", "0.59300804", "0.59108424", "0.59102833", "0.590394", "0.5898378", "0.5869455", "0.58683836", "0.58454615", "0.5844206", "0.58346546", "0.5833904", "0.5825548", "0.58237237", "0.58031225", "0.58022404", "0.5801699", "0.5797993", "0.5765382", "0.5757809", "0.575517", "0.5753268", "0.57295656", "0.5729051", "0.5726092", "0.5719049", "0.57173973" ]
0.6419137
31
Parses the given hour/minute String and returns a java.util.Date object
public static Date parseHourMinute(String formattedTime) { return parseDate(formattedTime, HOUR_MINUTE_FORMAT); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Date parseDateTime(String val, int hour, int minute) {\n\n\t\tDate d = null;\n\t\tval = val + \" \" + hour + \":\" + minute;\n\t\tif (val != null && !val.equals(\"0\")) {\n\t\t\tSimpleDateFormat format = new SimpleDateFormat(\"dd/MM/yyyy hh:mm\");\n\t\t\ttry {\n\t\t\t\td = format.parse(val);\n\t\t\t} catch (ParseException e) {\n\t\t\t}\n\t\t}\n\n\t\treturn d;\n\n\t}", "public static Time fromString( String timeStr ) {\n int hour, minute;\n\n String[] parts = timeStr.split( \":\" );\n if ( parts.length != 2 ) throw new NumberFormatException( timeStr );\n hour = Integer.parseInt( parts[ 0 ] );\n\n String[] subParts = parts[ 1 ].split( \" \" );\n if ( subParts.length > 2 ) throw new NumberFormatException( timeStr );\n minute = Integer.parseInt( subParts[ 0 ] );\n\n if ( subParts.length == 2 ) { // Meridiem indicator is present.\n switch ( subParts[ 1 ] ) {\n case \"AM\":\n case \"am\":\n if ( hour == Time.HALF_DAY_HRS ) {\n hour = 0;\n }\n break;\n case \"PM\":\n case \"pm\":\n if ( hour != Time.HALF_DAY_HRS ) {\n hour += Time.HALF_DAY_HRS;\n }\n break;\n default:\n throw new NumberFormatException( timeStr );\n }\n }\n if (\n hour < 0 || hour >= Time.HRS_PER_DAY ||\n minute < 0 || minute >= Time.MINS_PER_HR\n ) {\n throw new NumberFormatException( \"Bad time \" + hour + ':' + minute );\n }\n return new Time( hour, minute );\n }", "public static Date parseTime(String time)\n\t{\n\t\treturn parseFormatDate(time, getTimeFormat());\n\t}", "public static Time fromString(String str) {\n checkFormat(str);\n int h = Integer.parseInt(str.substring(0, 2));\n int m = Integer.parseInt(str.substring(3, 5));\n String mStr = str.substring(6);\n boolean b = mStr.equals(\"PM\");\n\n return new Time(h, m, b);\n }", "private LocalDateTime parseTime(String time) {\n String[] str = time.split(\" \");\n String[] oldDate = str[0].split(\"/\");\n if (oldDate.length != 3) {\n throw new DukeException(\"OOPS!!! The time is not of the correct format!\");\n }\n LocalDateTime localTime;\n if (str.length > 1) {\n String hour = str[1].substring(0, 2);\n String min = str[1].substring(2, 4);\n\n localTime = LocalDateTime.of(Integer.parseInt(oldDate[2]), Integer.parseInt(oldDate[1]),\n Integer.parseInt(oldDate[0]), Integer.parseInt(hour), Integer.parseInt(min));\n } else {\n localTime = LocalDate.of(Integer.parseInt(oldDate[2]), Integer.parseInt(oldDate[1]),\n Integer.parseInt(oldDate[0]))\n .atStartOfDay();\n hasTime = false;\n }\n return localTime;\n }", "private LocalDateTime parseDate(String timeStr) throws DateTimeParseException {\n return LocalDateTime.parse(timeStr, formatter);\n }", "public static DateTime parseTime(String str) {\n if (str.indexOf('.') == -1) {\n return DateTimeFormat.forPattern(\"HH:mm:ss\").withZoneUTC().parseDateTime(str);\n } else {\n return DateTimeFormat.forPattern(\"HH:mm:ss.SSS\").withZoneUTC().parseDateTime(str);\n }\n }", "public static Date stringToTime(String time)\r\n/* 43: */ {\r\n/* 44: */ try\r\n/* 45: */ {\r\n/* 46: 54 */ return sdfTime.parse(time);\r\n/* 47: */ }\r\n/* 48: */ catch (ParseException e)\r\n/* 49: */ {\r\n/* 50: 56 */ log.fatal(\"DateUtil.stringToTime抛出异常\", e);\r\n/* 51: */ }\r\n/* 52: 57 */ return new Date();\r\n/* 53: */ }", "private static Date convertFromString(String dateString) throws ParseException {\n return new SimpleDateFormat(\"yyyyMMddHHmm\").parse(dateString);\n }", "private LocalDateTime parseDate(String s) {\n String[] splitDate = s.split(\" \", 2);\n // Split day, month, year\n String[] splitDateElements = splitDate[0].split(\"/\", 3);\n int day = parseInt(splitDateElements[0]);\n int month = parseInt(splitDateElements[1]);\n int year = parseInt(splitDateElements[2]);\n // Split hours and minutes\n int hours = parseInt(splitDate[1].substring(0, 2));\n int mins = parseInt(splitDate[1].substring(2, 4));\n return LocalDateTime.of(year, month, day, hours, mins);\n }", "public static Date parse(String input) throws java.text.ParseException {\n\t\treturn new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.S\").parse(input);\n\n\t}", "private static Date parseTimestringWithMillis(String timestring) throws ParseException{\r\n boolean containsT = timestring.contains(\"T\");\r\n boolean containsSpace = timestring.contains(\" \");\r\n int len = timestring.length();\r\n char dot = timestring.charAt(len-4);\r\n boolean containsDot = false;\r\n if(dot == '.'){\r\n containsDot = true;\r\n }\r\n if(!containsT && containsSpace && containsDot){\r\n try {\r\n Date date = formatMiliSecs.parse(timestring);\r\n return date;\r\n } catch (ParseException e) {\r\n throw new ParseException(e.getMessage(), 0);\r\n }\r\n }\r\n else if(containsT && !containsSpace && containsDot){\r\n try {\r\n Date date = formatMiliSecsWT.parse(timestring);\r\n return date;\r\n } catch (ParseException e) {\r\n throw new ParseException(e.getMessage(), 0);\r\n }\r\n }\r\n else{\r\n throw new ParseException(\"Unsupported pattern!\", 0);\r\n }\r\n }", "private String extractHourMinute(String dateTime)\n {\n String[] aux = dateTime.split(\"T\");\n String[] auxTime = aux[1].split(\":\");\n\n return auxTime[0] + \":\" + auxTime[1];\n }", "private static void m1() {\n\n String d = \"2019/03/22 10:00-11:00\";\n DateFormat df = new SimpleDateFormat(\"yyyy/MM/dd HH:mm-HH:mm\");\n try {\n Date parse = df.parse(d);\n System.out.println(df.format(parse));\n } catch (ParseException e) {\n e.printStackTrace();\n }\n }", "public static Date convert_string_time_into_original_time(String hhmmaa) {\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"HH:mm aa\");\n Date convertedDate = new Date();\n try {\n convertedDate = dateFormat.parse(hhmmaa);\n } catch (ParseException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n return convertedDate;\n }", "public static double parse_time(String s) {\n double tm = -1;\n String patternStr = \"[:]\";\n String [] fields2 = s.split(patternStr);\n if (fields2.length >= 3) {\n tm = parse_double(fields2[2]) + 60 * parse_double(fields2[1]) + 3600 * parse_double(fields2[0]); // hrs:min:sec\n } else if (fields2.length == 2) {\n tm = parse_double(fields2[1]) + 60 * parse_double(fields2[0]); // min:sec\n } else if (fields2.length == 1){\n tm = parse_double(fields2[0]); //getColumn(_sec, head[TM_CLK]);\n }\n return tm;\n }", "public String parseTime(String time) {\n Date date = null;\n try {\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\", Locale.getDefault());\n String todaysDate = new SimpleDateFormat(\"yyyy-MM-dd\", Locale.getDefault()).format(new Date());\n date = simpleDateFormat.parse(todaysDate + \" \" + time.split(\" \")[0]);\n\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\", Locale.getDefault());\n sdf.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n return sdf.format(date);\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n return null;\n }", "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}", "private static Date parseISOTimestring(String timestring) throws ParseException{\r\n boolean containsT = timestring.contains(\"T\");\r\n boolean containsSpace = timestring.contains(\" \");\r\n int len = timestring.length();\r\n char colonTZ = timestring.charAt(len-3);\r\n if(colonTZ == ':'){\r\n String part1 = timestring.substring(0, len-3);\r\n String part2 = timestring.substring(len-2, len);\r\n try{\r\n if(containsT){\r\n Date date = formatSecsTZwT.parse(part1+part2);\r\n return date;\r\n }else if(containsSpace){\r\n Date date = formatSecsTZ.parse(part1+part2);\r\n return date;\r\n }\r\n else{\r\n throw new ParseException(\"Unsupported pattern!\", 0);\r\n }\r\n } catch(ParseException e){\r\n throw new ParseException(e.getMessage(), 0);\r\n }\r\n }\r\n else{\r\n throw new ParseException(\"Unsupported pattern!\", 0);\r\n }\r\n }", "public DateHour(String dateHourRepresentation)\n\t{\n\t\tString[] arrString = dateHourRepresentation.split(\"/\");\n\t\tm_day = Integer.parseInt(arrString[0]);\n\t\tm_month = Integer.parseInt(arrString[1]);\n\t\tm_year = Integer.parseInt(arrString[2]);\n\t\tm_hour = Integer.parseInt(arrString[3]);\n\t}", "public static Calendar getTimeFromString(String timeStr) {\r\n\t\tDateFormat format = new SimpleDateFormat(\"hh:mm\");\r\n\t\tCalendar c = new GregorianCalendar();\r\n\t\t\r\n\t\tDate date;\r\n\t\ttry {\r\n\t\t\tdate = (Date)format.parse(timeStr.substring(0, timeStr.length()-1));\r\n\t\t\tc.setTime(date);\r\n\t\t\t\r\n\t\t\tif (timeStr.charAt(timeStr.length()-1) == 'p')\r\n\t\t\t\tc.set(Calendar.HOUR_OF_DAY, c.get(Calendar.HOUR) + 12);\r\n\t\t\telse\r\n\t\t\t\tc.set(Calendar.HOUR_OF_DAY, c.get(Calendar.HOUR));\r\n\t\t\t\r\n\t\t\tCalendar now = Calendar.getInstance();\r\n\t\t\t\r\n\t\t\tc.set(Calendar.DATE, now.get(Calendar.DATE));\r\n\t\t\tc.set(Calendar.MONTH, now.get(Calendar.MONTH));\r\n\t\t\tc.set(Calendar.YEAR, now.get(Calendar.YEAR));\r\n\t\t\t\r\n\t\t\treturn c;\r\n\t\t} catch (ParseException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\r\n\t}", "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 parseTimestamp(String time) throws ParseException{\r\n /**\r\n * Checks whether timestring contains UTC time zone identifier\r\n */\r\n boolean containsZ = time.contains(\"Z\");\r\n if(containsZ){\r\n time = time.replace(\"Z\", \"+0000\");\r\n }\r\n /**\r\n * checks if the timestring ends with \"+hh\" or \"-hh\" time zone definition\r\n * modifies timestring with minutes to time zone\r\n */\r\n char suffixTZ = time.charAt(time.length()-3);\r\n if(suffixTZ == '+' || suffixTZ == '-'){\r\n time = time+\"00\";\r\n }\r\n int len = time.length();\r\n /**\r\n * checks patterns ending with seconds only\r\n */\r\n if(len == patternSecsLen){\r\n return parseTimestampWithSeconds(time);\r\n }\r\n /**\r\n * checks patterns ending with milliseconds\r\n */\r\n else if(len == patternMiliSecsLen){\r\n return parseTimestringWithMillis(time);\r\n }\r\n /**\r\n * checks patterns ending with seconds and time zone\r\n */\r\n else if(len == patternSecsTZLen){\r\n return parseTimestampWithSecondsWithTimeZone(time);\r\n }\r\n /**\r\n * checks patterns ending with milliseconds and time zone\r\n */\r\n else if(len == patternMiliSecsTZLen){\r\n return parseTimestringWithMillisWithTimeZone(time);\r\n }\r\n /**\r\n * checks patterns according to ISO pattern\r\n */\r\n else if(len == patternISOLen){\r\n return parseISOTimestring(time);\r\n }\r\n /**\r\n * checks patterns according to ISO pattern with milliseconds\r\n */\r\n else if(len == patternISOMilisLen){\r\n return parseISOTimestringWithMillis(time);\r\n }\r\n /**\r\n * checks patterns ending with microseconds\r\n */\r\n else if(len == patternMicroSecLen){\r\n return parseTimestringWithMicros(time);\r\n }\r\n /**\r\n * checks patterns ending with microseconds and time zone\r\n */\r\n else if(len == patternMicroSecTZLen){\r\n return parseTimestringWithMicrosWithTimeZone(time);\r\n }\r\n \r\n else{\r\n throw new ParseException(\"Unsupported pattern!\", 0);\r\n }\r\n }", "public DateParser(String dateAndTimeString) {\n this.dateAndTimeString = dateAndTimeString;\n }", "public Date parse (String dateAsString , String dateFormat) throws Exception ;", "public static Date parseDateTime(String str)\n {\n if(Empty.isEmpty(str))\n return null;\n if(str.length() <= 10)\n return parse(str);\n try{\n \treturn (new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\")).parse(str);\n\t\t}catch(ParseException e){\n\t\t \t return null;\n\t\t}\n }", "private static Date parseISOTimestringWithMillis(String timestring) throws ParseException{\r\n boolean containsT = timestring.contains(\"T\");\r\n boolean containsSpace = timestring.contains(\" \");\r\n int len = timestring.length();\r\n char colonTZ = timestring.charAt(len-3);\r\n if(colonTZ == ':'){\r\n String part1 = timestring.substring(0, len-3);\r\n String part2 = timestring.substring(len-2, len);\r\n try{\r\n if(containsT){\r\n Date date = formatMiliSecsTZwT.parse(part1+part2);\r\n return date;\r\n }else if(containsSpace){\r\n Date date = formatMiliSecsTZ.parse(part1+part2);\r\n return date;\r\n }\r\n else{\r\n throw new ParseException(\"Unsupported pattern!\", 0);\r\n }\r\n } catch(ParseException e){\r\n throw new ParseException(e.getMessage(), 0);\r\n }\r\n }\r\n else{\r\n throw new ParseException(\"Unsupported pattern!\", 0);\r\n }\r\n }", "private int parseTime(String timeString){\n\n if(timeString != null) {\n String[] parseTime = timeString.split(\":|\\\\s\");\n String intTime = parseTime[0] + parseTime[1];\n int time = Integer.parseInt((intTime));\n if (time != 1200 && parseTime[2].equals(\"PM\")) {\n time += 1200;\n } else if (time == 1200 && parseTime[2].equals(\"AM\")) {\n time = 0;\n }\n return time;\n\n } else {\n return 0;\n }\n }", "public static Date fotmatDate21(String myDate) {\n\t\tDate dDate = new SimpleDateFormat(\"HH:mm:ss\").parse(myDate,\r\n\t\t\t\tnew ParsePosition(0));\r\n\t\treturn dDate;\r\n\t}", "public static Date parseTime(String formattedTime) {\n\t\treturn parseDate(formattedTime, DEFAULT_TIME_FORMAT);\n\t}", "private static Date parseTimestringWithMillisWithTimeZone(String timestring) throws ParseException{\r\n boolean containsT = timestring.contains(\"T\");\r\n boolean containsSpace = timestring.contains(\" \");\r\n int len = timestring.length();\r\n char dot = timestring.charAt(len-9);\r\n boolean containsDot = false;\r\n if(dot == '.'){\r\n containsDot = true;\r\n }\r\n if(!containsT && containsSpace && containsDot){\r\n try {\r\n Date date = formatMiliSecsTZ.parse(timestring);\r\n return date;\r\n } catch (ParseException e) {\r\n throw new ParseException(e.getMessage(), 0);\r\n }\r\n }\r\n else if(containsT && !containsSpace && containsDot){\r\n try {\r\n Date date = formatMiliSecsTZwT.parse(timestring);\r\n return date;\r\n } catch (ParseException e) {\r\n throw new ParseException(e.getMessage(), 0);\r\n }\r\n }\r\n else{\r\n throw new ParseException(\"Unsupported pattern!\", 0);\r\n }\r\n }", "public static synchronized Date parseDate(String s) throws ParseException {\n return dateFormat.parse(s);\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 }", "private static Date parseTimestringWithMicros(String timestring) throws ParseException{\r\n boolean containsT = timestring.contains(\"T\");\r\n boolean containsSpace = timestring.contains(\" \");\r\n boolean containsDot = false;\r\n int len = timestring.length();\r\n char dot = timestring.charAt(len-7);\r\n if(dot == '.'){\r\n containsDot = true;\r\n }\r\n if(!containsT && containsSpace && containsDot){\r\n try {\r\n String milisTime = timestring.substring(0, patternMiliSecsLen);\r\n Date date = formatMiliSecs.parse(milisTime);\r\n return date;\r\n } catch (ParseException e) {\r\n throw new ParseException(e.getMessage(), 0);\r\n }\r\n }\r\n else if(containsT && !containsSpace && containsDot){\r\n try {\r\n String milisTime = timestring.substring(0, patternMiliSecsWTLen);\r\n Date date = formatMiliSecsWT.parse(milisTime);\r\n return date;\r\n } catch (ParseException e) {\r\n throw new ParseException(e.getMessage(), 0);\r\n }\r\n }\r\n else{\r\n throw new ParseException(\"Unsupported pattern!\", 0);\r\n }\r\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 parseTimestampWithSeconds(String timestring) throws ParseException{\r\n boolean containsT = timestring.contains(\"T\");\r\n boolean containsSpace = timestring.contains(\" \");\r\n if(!containsT && containsSpace){\r\n try {\r\n Date date = formatSecs.parse(timestring);\r\n return date;\r\n } catch (ParseException e) {\r\n throw new ParseException(e.getMessage(), 0);\r\n }\r\n }\r\n else if(containsT && !containsSpace){\r\n try {\r\n Date date = formatSecsWT.parse(timestring);\r\n return date;\r\n } catch (ParseException e) {\r\n throw new ParseException(e.getMessage(), 0);\r\n }\r\n }\r\n else{\r\n throw new ParseException(\"Unsupported pattern!\", 0);\r\n }\r\n }", "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 LocalDateTime parseDate(String str) {\n String time = str.substring(str.indexOf(\",\") + 2);\n int hour = new Integer(time.split(\":\")[0].trim());\n int min = new Integer(time.split(\":\")[1].trim());\n LocalTime localTime = LocalTime.of(hour, min);\n\n str = str.substring(0, str.indexOf(\",\")).trim();\n LocalDate localDate = LocalDate.now();\n\n if (str.contains(\"вчера\")) {\n localDate.minusDays(1);\n } else if (!str.contains(\"сегодня\") && !str.contains(\"вчера\")) {\n int year = new Integer(\"20\" + str.substring(str.length() - 2));\n String strMonth = str.substring(2, 6).trim();\n int day = new Integer(str.substring(0, 2).trim());\n localDate = LocalDate.of(year, parseMonth(strMonth), day);\n }\n return LocalDateTime.of(localDate, localTime);\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 }", "private AbsTime(String t) throws NumberFormatException, Time.Ex_TimeNotAvailable\n {\n // Parse the string.\n parse(t);\n }", "public static LocalDate parseTime(String time) throws DateTimeParseException {\n try {\n return LocalDate.parse(time);\n } catch (DateTimeParseException e) {\n throw new DukeException(\"OOPS!!! Please specify the time in the yyyy-mm-dd format.\\n\");\n }\n }", "public static LocalTime parseTime(String time) {\n return LocalTime.parse(time, formatter);\n }", "private static Date parseTimestringWithMicrosWithTimeZone(String timestring) throws ParseException {\r\n boolean containsT = timestring.contains(\"T\");\r\n boolean containsSpace = timestring.contains(\" \");\r\n boolean containsDot = false;\r\n int len = timestring.length();\r\n char dot = timestring.charAt(len-12);\r\n if(dot == '.'){\r\n containsDot = true;\r\n }\r\n if(!containsT && containsSpace && containsDot){\r\n try {\r\n String milisTime = timestring.substring(0, patternMiliSecsLen);\r\n String timeZone = timestring.substring(len-5, len);\r\n Date date = formatMiliSecsTZ.parse(milisTime+timeZone);\r\n return date;\r\n } catch (ParseException e) {\r\n throw new ParseException(e.getMessage(), 0);\r\n }\r\n }\r\n else if(containsT && !containsSpace && containsDot){\r\n try {\r\n String milisTime = timestring.substring(0, patternMiliSecsWTLen);\r\n String timeZone = timestring.substring(len-5, len);\r\n Date date = formatMiliSecsTZwT.parse(milisTime+timeZone);\r\n return date;\r\n } catch (ParseException e) {\r\n throw new ParseException(e.getMessage(), 0);\r\n }\r\n }\r\n else{\r\n throw new ParseException(\"Unsupported pattern!\", 0);\r\n }\r\n }", "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 }", "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 }", "private boolean splitTime(String timeString) throws Exception {\n\t\tif (timeSet)\n\t\t\tthrow new Exception(\"Double time \" + timeString);\n\t\tStringTokenizer st = new StringTokenizer(timeString, \":\");\n\t\tif (st.countTokens() == 3) {\n\t\t\thour = Integer.valueOf(st.nextToken()).intValue();\n\t\t\tminute = Integer.valueOf(st.nextToken()).intValue();\n\t\t\tsecond = Integer.valueOf(st.nextToken()).intValue();\n\t\t}\n\t\telse if (st.countTokens() == 2) {\n\t\t\thour = Integer.valueOf(st.nextToken()).intValue();\n\t\t\tminute = Integer.valueOf(st.nextToken()).intValue();\n\t\t}\n\t\telse\n\t\t\tthrow new Exception(\"Wrong number of arguments\" + timeString);\n\t\tif ((hour < 0)\n\t\t|| (hour > 23)\n\t\t|| (minute < 0)\n\t\t|| (minute > 59)\n\t\t|| (second < 0)\n\t\t|| (second > 59)) {\n\t\t\tthrow new Exception(\"Not a valid time \" + timeString);\n\t\t}\n\t\thour = hour % 24;\n\t\tminute = minute % 60;\n\t\tsecond = second % 60;\n\t\tdate = new Date((year - 1900)\n\t\t\t , (month - 1)\n\t\t\t\t , day\n\t\t\t , hour\n\t\t\t\t , minute\n\t\t\t\t , second);\n\t\ttimeSet = true;\n\t\treturn true;\n }", "public static boolean isValidTime(String time) throws NumberFormatException {\n\n int timeInt = Integer.parseInt(time); //throws NumberFormatException if \"time\" contains non-digit characters\n\n if (time.length() != 4) {\n return false;\n }\n\n char[] timeArray = time.toCharArray();\n int hour = Integer.parseInt(new String(timeArray, 0, 2));\n\n int minute = 10 * Integer.parseInt(Character.toString(timeArray[2]))\n + Integer.parseInt(Character.toString(timeArray[3]));\n\n return hour >= 0 && hour < 24 && minute >= 0 && minute < 60;\n\n }", "private LocalTime parse(String timeString, boolean recursivelyCalled) {\n LocalTime parsed = null;\n try {\n parsed = LocalTime.parse(timeString);\n } catch (DateTimeParseException | IndexOutOfBoundsException exception) {\n int indexOfColon = timeString.indexOf(\":\");\n String newString = null;\n if (recursivelyCalled) {\n //Has excepted on the supposedly \"fixed\" & parsable string, now try removing the end of the string\n newString = timeString.substring(indexOfColon - 2, indexOfColon + 3); //ie \"12:30blabla\" would return \"12:30\"\n } else {\n newString = timeString.substring(indexOfColon - 2);\n }\n return parse(newString, true);\n }\n return parsed;\n }", "private static Date parseTimestampWithSecondsWithTimeZone(String timestring) throws ParseException{\r\n boolean containsT = timestring.contains(\"T\");\r\n boolean containsSpace = timestring.contains(\" \");\r\n if(!containsT && containsSpace){\r\n try {\r\n Date date = formatSecsTZ.parse(timestring);\r\n return date;\r\n } catch (ParseException e) {\r\n throw new ParseException(e.getMessage(), 0);\r\n }\r\n }\r\n else if(containsT && !containsSpace){\r\n try {\r\n Date date = formatSecsTZwT.parse(timestring);\r\n return date;\r\n } catch (ParseException e) {\r\n throw new ParseException(e.getMessage(), 0);\r\n }\r\n }\r\n else{\r\n throw new ParseException(\"Unsupported pattern!\", 0);\r\n }\r\n }", "public static Date parseDateTime(String date)\n\t{\n\t\treturn parseFormatDate(date, getDateTimeFormat());\n\t}", "public Date parseString(String dateString) throws ParseException {\n return dateFormat.parse(dateString);\n }", "private boolean checkValidTime(String inputTime) {\n int hour = Integer.parseInt(inputTime.substring(0,2));\n int minute = Integer.parseInt(inputTime.substring(2,4));\n \n if ((hour >= 0 && hour <= 23) && (minute >= 0 && minute <= 59)) {\n return true;\n } else {\n return false;\n }\n }", "public String parseTimeToTimeDate(String time) {\n Date date = null;\n try {\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\", Locale.getDefault());\n String todaysDate = new SimpleDateFormat(\"yyyy-MM-dd\", Locale.getDefault()).format(new Date());\n date = simpleDateFormat.parse(todaysDate + \" \" + time);\n\n SimpleDateFormat sdf = new SimpleDateFormat(\"HH:mm dd,MMM\", Locale.getDefault());\n //sdf.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n return sdf.format(date);\n\n } catch (ParseException e) {\n e.printStackTrace();\n }\n return null;\n }", "public static TS valueOf(String time) {\n\t\tif (time != null) {\n\t\t\ttime = time.trim();\n\t\t}\n\t\tif (time == null || time.equals(\"\")) {\n\t\t\treturn TSnull.NA;\n\t\t}\n\t\t//return new TSjuDateAdapter(parseDate(time).getTime(), time.length());\n\n\t\tfinal Calendar c = Calendar.getInstance();\n\t\tint precision = time.indexOf('+'), field, i = 0, zoneOffset;\n\t\tfinal int realLen = time.length();\n\t\tboolean hasTimezone = false;\n\t\tc.clear();\n\t\tif (precision < 0) {\n\t\t\tprecision = time.indexOf('-');\n\t\t\tif (precision < 0) {\n\t\t\t\tprecision = realLen;\n\t\t\t} else {\n\t\t\t\ti = -1;\n\t\t\t}\n\t\t} else {\n\t\t\ti = 1;\n\t\t}\n\t\tif (i != 0) {\n\t\t\tif ((realLen - precision) % 2 == 0) {\n\t\t\t\tthrow new RuntimeException(\"not a valid date: \" + time);\n\t\t\t}\n\t\t\tzoneOffset = MILLIS_PER_HOUR * parseInt(time, precision + 1, precision + 3);\n\t\t\tif (precision + 3 < realLen) {\n\t\t\t\tzoneOffset += (MILLIS_PER_MINUTE * parseInt(time, precision + 3, precision + 5));\n\t\t\t}\n\t\t\tzoneOffset *= i;\n\t\t\tc.set(Calendar.ZONE_OFFSET, zoneOffset);\n\t\t\thasTimezone = true;\n\t\t}\n\t\tif (precision < 4 || (precision < 14 && precision % 2 == 1)) {\n\t\t\tthrow new RuntimeException(\"not a valid date: \" + time);\n\t\t}\n\t\tc.set(Calendar.YEAR, parseInt(time, 0, 4));\n\t\tif (precision >= 6) {\n\t\t\tc.set(Calendar.MONTH, parseInt(time, 4, 6) - 1);\n\t\t\tif (precision >= 8) {\n\t\t\t\tc.set(Calendar.DAY_OF_MONTH, parseInt(time, 6, 8));\n\t\t\t\tif (precision >= 10) {\n\t\t\t\t\tc.set(Calendar.HOUR_OF_DAY, parseInt(time, 8, 10));\n\t\t\t\t\tif (precision >= 12) {\n\t\t\t\t\t\tc.set(Calendar.MINUTE, parseInt(time, 10, 12));\n\t\t\t\t\t\tif (precision >= 14) {\n\t\t\t\t\t\t\tc.set(Calendar.SECOND, parseInt(time, 12, 14));\n\t\t\t\t\t\t\tif (precision >= 16) {\n\t\t\t\t\t\t\t\tfield = parseInt(time, 15, precision);\n\t\t\t\t\t\t\t\tfor (i = precision; i < 18; i++)\n\t\t\t\t\t\t\t\t{\tfield = field * 10;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tfor (i = precision; i > 18; i--)\n\t\t\t\t\t\t\t\t{\tfield = field / 10;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tc.set(Calendar.MILLISECOND, field);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (time.indexOf('.') >= 0) {\n\t\t\tprecision--;\n\t\t}\n\t\treturn new TSjuDateAdapter(c, precision, hasTimezone);\n\t}", "public static String[] validateHours(String hours) {\n\tString[] hourString=new String[2];\r\n\tStringTokenizer st=new StringTokenizer(hours,\"-\");\r\n\ttry{\r\n\t\thourString[0]=st.nextToken();\r\n\t\thourString[1]=st.nextToken();\r\n\t}\r\n\tcatch(Exception e){\r\n\t\tSystem.out.println(\"Hours are not proper:\");\r\n\t\thourString[0]=null;\r\n\t\treturn hourString;\r\n\t}\r\n\tboolean validHour=validInteger(hourString[0]);\r\n\tif(!validHour || hourString[0].length()!=4){\r\n\t\tSystem.out.println(\"Invalid Start Time\");\r\n\t\thourString[0]=null;\r\n\t\treturn hourString;\r\n\t}\r\n\tvalidHour=validInteger(hourString[1]);\r\n\tif(!validHour || hourString[1].length()!=4){\r\n\t\tSystem.out.println(\"Invalid End Time Time\");\r\n\t\thourString[0]=null;\r\n\t\treturn hourString;\r\n\t}\r\n\tString time=hourString[0].substring(0, 2)+\":\"+hourString[0].substring(2, 4);\r\n\thourString[0]=time;\r\n\tSystem.out.println(\"Start Time : \"+time);\r\n\ttime=null;\r\n\ttime=hourString[1].substring(0, 2)+\":\"+hourString[1].substring(2, 4);\r\n\thourString[1]=time;\r\n\treturn hourString;\r\n}", "public static Timestamp parseDateTime(String date) {\n if (date.endsWith(\"Z\"))\n return parseDateTime_(date);\n else\n return oneOf(date, format_with_tz, format_precise_with_tz);\n }", "public int parseTimeForHour(String time)\n\t{\n\t\ttry {\n\t\t\tDate date = new SimpleDateFormat(\"hh:mma\", Locale.ENGLISH).parse(time);\n\t\t\t\n\t\t\t@SuppressWarnings(\"deprecation\")\n\t\t\tint hour = date.getHours();\n\t\t\treturn hour;\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\treturn -1;\n\t}", "private static Long parseTimeStrictly(String s) throws IllegalArgumentException\n {\n String nanos_s;\n\n long hour;\n long minute;\n long second;\n long a_nanos = 0;\n\n String formatError = \"Timestamp format must be hh:mm:ss[.fffffffff]\";\n String zeros = \"000000000\";\n\n if (s == null)\n throw new java.lang.IllegalArgumentException(formatError);\n s = s.trim();\n\n // Parse the time\n int firstColon = s.indexOf(':');\n int secondColon = s.indexOf(':', firstColon+1);\n\n // Convert the time; default missing nanos\n if (firstColon > 0 && secondColon > 0 && secondColon < s.length() - 1)\n {\n int period = s.indexOf('.', secondColon+1);\n hour = Integer.parseInt(s.substring(0, firstColon));\n if (hour < 0 || hour >= 24)\n throw new IllegalArgumentException(\"Hour out of bounds.\");\n\n minute = Integer.parseInt(s.substring(firstColon + 1, secondColon));\n if (minute < 0 || minute >= 60)\n throw new IllegalArgumentException(\"Minute out of bounds.\");\n\n if (period > 0 && period < s.length() - 1)\n {\n second = Integer.parseInt(s.substring(secondColon + 1, period));\n if (second < 0 || second >= 60)\n throw new IllegalArgumentException(\"Second out of bounds.\");\n\n nanos_s = s.substring(period + 1);\n if (nanos_s.length() > 9)\n throw new IllegalArgumentException(formatError);\n if (!Character.isDigit(nanos_s.charAt(0)))\n throw new IllegalArgumentException(formatError);\n nanos_s = nanos_s + zeros.substring(0, 9 - nanos_s.length());\n a_nanos = Integer.parseInt(nanos_s);\n }\n else if (period > 0)\n throw new IllegalArgumentException(formatError);\n else\n {\n second = Integer.parseInt(s.substring(secondColon + 1));\n if (second < 0 || second >= 60)\n throw new IllegalArgumentException(\"Second out of bounds.\");\n }\n }\n else\n throw new IllegalArgumentException(formatError);\n\n long rawTime = 0;\n rawTime += TimeUnit.HOURS.toNanos(hour);\n rawTime += TimeUnit.MINUTES.toNanos(minute);\n rawTime += TimeUnit.SECONDS.toNanos(second);\n rawTime += a_nanos;\n return rawTime;\n }", "public static Date parseDate(String date)\n\t{\n\t\treturn parseFormatDate(date, getDateFormat());\n\t}", "static String timeConversion(String s) throws ParseException {\n SimpleDateFormat to = new SimpleDateFormat(\"HH:mm:ss\");\n SimpleDateFormat from = new SimpleDateFormat(\"hh:mm:ssa\");\n Date parse = from.parse(s);\n return to.format(parse);\n\n }", "@Test\n\tpublic void testParseDate1() throws ParseException {\n\t\tDate date = ParserFacade.getInstance().parseDate(\"1/2 2am\");\n\n\t\tCalendar cal = Calendar.getInstance();\n\t\tcal.set(Calendar.DATE, 1);\n\t\tcal.set(Calendar.MONTH, 1);\n\t\tcal.set(Calendar.HOUR_OF_DAY, 2);\n\t\tcal.set(Calendar.MINUTE, 0);\n\t\tcal.set(Calendar.SECOND, 0);\n\t\tcal.set(Calendar.MILLISECOND, 0);\n\t\tassertEquals(cal.getTime(), date);\n\n\t}", "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}", "private int[] parseHours(String str) {\n try {\n return enumerate(str, 0, 23);\n } catch (IllegalArgumentException e) {\n throw new IllegalArgumentException(\"Error parsing hours: \" + e.getMessage());\n }\n }", "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 static String getParsableTime(String rawDateTime) throws InvalidTimeFormatException {\n try {\n String[] separatedDateTime = rawDateTime.split(\" \");\n if (separatedDateTime[1].length() < 4) {\n separatedDateTime[1] = \"0\" + separatedDateTime[1];\n }\n String hour = separatedDateTime[1].substring(0, 2);\n if (hour.equals(\"24\")) {\n hour = \"00\";\n }\n String minute = separatedDateTime[1].substring(2, 4);\n String formattedTime = hour + \":\" + minute + \":00\";\n return formattedTime;\n } catch (Exception e) {\n throw new InvalidTimeFormatException(TIME_FORMAT_ERROR_MESSAGE);\n }\n }", "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 int parseTimeForMinute(String time)\n\t{\n\t\ttry {\n\t\t\tDate date = new SimpleDateFormat(\"hh:mma\", Locale.ENGLISH).parse(time);\n\t\t\t\n\t\t\t@SuppressWarnings(\"deprecation\")\n\t\t\tint minute = date.getMinutes();\n\t\t\treturn minute;\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\treturn -1;\t\n\t}", "Calendar stringsToCalendar(String hour, String month, String date) throws ParseException {\n\t\tCalendar cal = Calendar.getInstance();\n\t\tString dateString = hour + \" \" + month + \" \" + date;\n\t\tcal.setTime(formatter.parse(dateString));\n\n\t\treturn cal;\n\t}", "public static Date parseDate(String date) {\n return DateUtil.toDate(date);\n }", "private void parse(String str) {\n if (str == null) {\n throw new IllegalArgumentException(\"Empty job execution instruction found!\");\n }\n String[] parts = str.split(\" \");\n if (parts.length == 1) {\n parseSpecial(str);\n } else if (parts.length == 5) {\n try {\n setMinutes(parseMinutes(parts[0].trim().toLowerCase()));\n setHours(parseHours(parts[1].trim().toLowerCase()));\n setDaysOfMonth(parseDaysOfMonth(parts[2].trim().toLowerCase()));\n setMonths(parseMonths(parts[3].trim().toLowerCase()));\n setDaysOfWeek(parseDaysOfWeek(parts[4].trim().toLowerCase()));\n } catch (NumberFormatException e) {\n throw new IllegalArgumentException(\"Schedule \" + str + \" is malformed:\" + e.getMessage());\n }\n } else {\n throw new IllegalArgumentException(\"Schedule \" + str + \" is malformed!\");\n }\n }", "public static Date parseTimestampMicro(String microTime) throws ParseException{\r\n /**\r\n * time string contains microseconds\r\n */\r\n int len = microTime.length();\r\n int dotIndex = microTime.lastIndexOf(\".\");\r\n \r\n /**\r\n * yyyy-MM-dd HH:mm:ss.SSSsss\r\n */\r\n if(len == 26 && dotIndex == 19){\r\n String milisTime = microTime.substring(0, patternMiliSecsLen);\r\n return parseTimestringWithMillis(milisTime);\r\n }\r\n /**\r\n * yyyy-MM-dd HH:mm:ss.SSSsssZZZ\r\n */\r\n else if(len == 29 && dotIndex == 19){\r\n String milisTime = microTime.substring(0, patternMiliSecsLen);\r\n /**\r\n * checks if contains time zone\r\n * if yes add minutes to TZ\r\n */ \r\n char suffixTZ = microTime.charAt(len-3);\r\n if(suffixTZ == '+' || suffixTZ == '-'){\r\n String timeZone = microTime.substring(len-3, len)+\"00\";\r\n return parseTimestringWithMillisWithTimeZone(\"\"+milisTime+timeZone);\r\n }\r\n else{\r\n return parseTimestringWithMillis(milisTime);\r\n }\r\n }\r\n /**\r\n * yyyy-MM-dd HH:mm:ss.SSSsssZZZZZ\r\n */\r\n else if(len == 31 && dotIndex == 19){\r\n String milisTime = microTime.substring(0, patternMiliSecsLen);\r\n /**\r\n * checks if contains time zone\r\n * if yes add minutes to TZ\r\n */ \r\n char suffixTZ = microTime.charAt(len-5);\r\n if(suffixTZ == '+' || suffixTZ == '-'){\r\n String timeZone = microTime.substring(len-5, len);\r\n return parseTimestringWithMillisWithTimeZone(\"\"+milisTime+timeZone);\r\n }\r\n else{\r\n return parseTimestringWithMillis(milisTime);\r\n }\r\n }\r\n else{\r\n throw new ParseException(\"Unsupported pattern!\", 0);\r\n }\r\n }", "public Time( int hour, int minute ) {\n this( hour * MINS_PER_HR + minute );\n }", "public static LocalDateTime parseTimeString(\n String time, String pattern) throws DukeParseException {\n try {\n DateTimeFormatter dtf = DateTimeFormatter.ofPattern(pattern);\n LocalTime localTime = LocalTime.parse(time, dtf);\n return LocalDateTime.of(LocalDate.now(), localTime);\n } catch (DateTimeParseException exception) {\n String msg = String.format(\"Ensure the time passed in is of the form: '%s'.\", pattern);\n throw new DukeParseException(msg);\n }\n }", "public static Timestamp parseString(String timestampString) {\n return parseString(timestampString, null, true);\n }", "public boolean selectDateTime(String timeString);", "public static LocalTime parse(CharSequence text) {\n\t\tMatcher m = TIME_PATTERN.matcher(text);\n\t\treturn extract(m).orElseThrow(() -> new DateTimeParseException(\"not a time\", text, 0));\n\t}", "public static String parseTime(String sTime) {\n\t\treturn sTime.substring(4, 6);\n\t}", "public LocalDateTime parseLocalDateTime(String inputString){\r\n LocalDateTime dateTime = null;\r\n\r\n //handle cases like Thu Oct 9 09:43:23 2016 where dayOfMonth has one digit\r\n Pattern patternDateTime1 = Pattern.compile(\"(Mon|Tue|Wed|Thu|Fri|Sat|Sun)\\\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\\\s{1,2}\\\\d\\\\s\\\\d{2}:\\\\d{2}:\\\\d{2}\\\\s\\\\d{4}\"); //date pattern\r\n DateTimeFormatter formatter1 = DateTimeFormatter.ofPattern(\"EEE MMM d HH:mm:ss yyyy\");\r\n Matcher matcherDateTime1 = patternDateTime1.matcher(inputString);\r\n\r\n //handle cases like Thu Oct 19 09:43:23 2016 where dayOfMonth has two digit\r\n Pattern patternDateTime2 = Pattern.compile(\"(Mon|Tue|Wed|Thu|Fri|Sat|Sun)\\\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\\\s{1,2}\\\\d{2}\\\\s\\\\d{2}:\\\\d{2}:\\\\d{2}\\\\s\\\\d{4}\"); //date pattern\r\n DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern(\"EEE MMM dd HH:mm:ss yyyy\");\r\n Matcher matcherDateTime2 = patternDateTime2.matcher(inputString);\r\n\r\n if (matcherDateTime1.find()){\r\n try {\r\n dateTime = LocalDateTime.parse(matcherDateTime1.group(),formatter1);\r\n } catch (Exception e) {\r\n return null;\r\n }\r\n }else if(matcherDateTime2.find()){\r\n try {\r\n dateTime = LocalDateTime.parse(matcherDateTime2.group(),formatter2);\r\n } catch (Exception e) {\r\n return null;\r\n }\r\n }\r\n return dateTime;\r\n }", "public static String fromDate(String s){\n \t\t\n \t\tString[] date = s.split(\"T\");\n \t\tString time = date[1].substring(0,5);\n \t\tString[] dates = date[0].split(\"-\"); \n \t\tString month = dates[1];\n \t\tString day = dates[2];\n \t\t\n \t\treturn day + \"/\" + month + \", kl: \" + time;\n \t}", "public static Date parseDateTime(String val) {\n\n\t\tDate d = null;\n\t\tif (val != null && !val.equals(\"0\")) {\n\t\t\tSimpleDateFormat format = new SimpleDateFormat(\"dd/MM/yyyy HH:mm\");\n\t\t\ttry {\n\t\t\t\td = format.parse(val);\n\t\t\t} catch (ParseException e) {\n\t\t\t}\n\t\t}\n\n\t\treturn d;\n\n\t}", "private static Date parseTimeStamp(String timestamp) {\n if (timestamp == null) {\n return null;\n }\n\n try {\n return SIMPLE_DATE_FORMAT.parse(timestamp);\n } catch (ParseException dateTimeParseException) {\n return null;\n }\n }", "public static DateTime[] parse(String dateTime){\n boolean containsEndTime = dateTime.contains(\"-\");\n DateTime [] values = null;\n\n String split [] = dateTime.split(\" \");\n String date [] = split[0].split(\"/\");\n\n // send back two times if an end time is given\n if(containsEndTime){\n values = new DateTime[2];\n\n String timeRange [] = split[1].split(\"-\");\n String timeStart [] = timeRange[0].split(\":\");\n String timeStop [] = timeRange[1].split(\":\");\n\n DateTime start = new DateTime();\n start.withYear(Integer.parseInt(date[0]));\n start.withMonthOfYear(Integer.parseInt(date[1]));\n start.withDayOfMonth(Integer.parseInt(date[2]));\n start.withHourOfDay(Integer.parseInt(timeStart[0]));\n start.withMinuteOfHour(Integer.parseInt(timeStart[1]));\n start.withSecondOfMinute(0);\n start.withMillisOfSecond(0);\n\n DateTime end = new DateTime(start);\n end.withHourOfDay(Integer.parseInt(timeStop[0]));\n end.withMinuteOfHour(Integer.parseInt(timeStop[1]));\n\n values[0] = start;\n values[1] = end;\n\n }else{\n // one time if no end date is given\n values = new DateTime[1];\n\n String time[] = split[1].split(\":\");\n\n DateTime allDay = new DateTime();\n allDay.withYear(Integer.parseInt(date[0]));\n allDay.withMonthOfYear(Integer.parseInt(date[1]));\n allDay.withDayOfMonth(Integer.parseInt(date[2]));\n allDay.withHourOfDay(Integer.parseInt(time[0]));\n allDay.withMinuteOfHour(Integer.parseInt(time[1]));\n allDay.withSecondOfMinute(0);\n allDay.withMillisOfSecond(0);\n\n values[0] = allDay;\n }// end if\n\n return values;\n }", "private void parse(String str) throws NumberFormatException, Time.Ex_TimeNotAvailable\n {\n // Remove any extraneous whitespace before parsing\n str = str.trim();\n\n // Apply some heuristics to str to figure out what format it\n // is in, then call the appropriate parsing function.\n if ((str.length() >= 3) && (str.substring(0, 2).equals(\"0x\"))) {\n // If the string begins with \"0x\", then it should be HEX_BAT.\n parseHexBAT(str);\n } else if (str.charAt(4) == ' ') {\n // Fifth character is a space, therefore should be in FORMATTED_BAT\n // format.\n parseFormattedBAT(str);\n } else if (str.charAt(4) == '-') {\n // Fifth character is a \"-\", therefore should be in UTC_STRING format.\n parseUTCString(str);\n } else if (str.indexOf('.') != -1) {\n // The string contains a \".\" charcater. Try to parse it as SECS_BAT.\n parseSecsBAT(str);\n } else {\n // Fall through to DECIMAL_BAT format.\n parseDecimalBAT(str);\n }\n // Check that we didn't create an ASAP or NEVER by mistake.\n if (isASAP() || isNEVER()) {\n throw new NumberFormatException(\"absolute time reserved value: \\\"\" + str + \"\\\"\");\n }\n }", "private String doValidTimeCheck(String pDateTime) {\n String aDateTime = pDateTime;\n\n if (pDateTime.length() > 0) {\n String aTime = pDateTime.substring(8);\n if (aTime.matches(\"240000\")) {\n aDateTime = pDateTime.substring(0,8) + \"235900\";\n }\n }\n return aDateTime;\n }", "private boolean timeValidation(String time){\n if(! time.matches(\"(?:[0-1][0-9]|2[0-4]):[0-5]\\\\d\")){\n return false;\n }\n return true;\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 }", "static Timestamp parseString(String timestampString,\n String pattern,\n boolean withZoneUTC) {\n return parseString(timestampString, pattern, withZoneUTC,\n (pattern == null));\n }", "static String timeConversion1(String s) {\n String[] timeSplit = s.split(\":\");\n String hours = timeSplit[0];\n String minutes = timeSplit[1];\n String seconds = timeSplit[2].substring(0, 2);\n String ampm = timeSplit[2].substring(2);\n\n int hour = Integer.parseInt(hours);\n\n int differential = 0;\n if (\"PM\".equals(ampm) && hour != 12) {\n differential = 12;\n }\n\n\n hour += differential;\n hour = hour % 24;\n\n hours = String.format(\"%02d\", hour);\n\n return hours + \":\" + minutes + \":\" + seconds;\n\n }", "public static Date parseDate(String date) {\r\n return parseDateWithPattern(date, \"dd/MM/yyyy\");\r\n }", "public static LocalDate parse(String dateStr) {\n String d = dateStr.substring(0, dateStr.indexOf('T'));\n LocalDate ld = null;\n try {\n ld = LocalDate.parse(d);\n } catch (Exception e) {\n System.err.println(\"Failed to parse datestring \" + dateStr + \" into a LocalDate!\");\n //e.printStackTrace();\n }\n // TODO: review what happens if format is invalid/LocalDate.parse fails - throw error, return null or both?\n return ld;\n }", "public static TimeRange parse(String value) {\n\t\tTimeRange obj = new TimeRange();\n\t\tString startStr = null;\n\t\tString endStr = null;\n\t\tif (value.contains(\"-\")) {\n\t\t\tString[] startEnd = value.split(\"-\");\n\t\t\tstartStr = startEnd[0];\n\t\t\tendStr = startEnd[1];\n\t\t} else {\n\t\t\tstartStr = value;\n\t\t}\n\t\tlong start = 0;\n\t\tlong end = 0;\n\t\tString[] values = startStr.split(\":\");\n\t\tint size = values.length;\n\t\tfor (int i=0; i<size; i++) {\n\t\t\tstart += getValue(values[i], i);\n\t\t}\n\t\tif (endStr == null) {\n\t\t\tend = start;\n\t\t} else {\n\t\t\tvalues = endStr.split(\":\");\n\t\t\tsize = values.length;\n\t\t\tfor (int i=0; i<size; i++) {\n\t\t\t\tend += getValue(values[i], i);\n\t\t\t}\n\t\t}\n\t\tobj.setStart(start);\n\t\tobj.setEnd(end);\n\t\treturn obj;\n\t}", "private int[] parseMinutes(String str) {\n try {\n return enumerate(str, 0, 59);\n } catch (IllegalArgumentException e) {\n throw new IllegalArgumentException(\"Error parsing minutes: \" + e.getMessage());\n }\n }", "public static Instant parse(final String dateString) {\n for (DateTimeFormatter formatter : VALID_DATE_FORMATS) {\n try {\n final var temporalAccessor = formatter.parse(dateString);\n return Instant.from(temporalAccessor);\n } catch (final Exception e) {\n //ignore failures - if no date string is parsable, an error is thrown below\n }\n }\n throw new IllegalArgumentException(\"Invalid date format: \\\"\" + dateString + \"\\\"\");\n }", "public String convertDateToTime(String date){\n Date test = null;\n if(date !=null) {\n try {\n test = sdf.parse(date);\n } catch (ParseException e) {\n System.out.println(\"Parse not working: \" + e);\n }\n calendar.setTime(test);\n return String.format(\"%02d:%02d\",\n calendar.get(Calendar.HOUR_OF_DAY),\n calendar.get(Calendar.MINUTE)\n );\n }\n return \"n\";\n }", "public static Date parseHttpDate(String dateString)\n {\n if (dateString == null)\n {\n return null;\n }\n \n TimeZone gmt = TimeZone.getTimeZone(\"GMT\");\n \n for (int i = 0; i < INPUT_FORMATS.length; i++)\n {\n SimpleDateFormat format = new SimpleDateFormat(INPUT_FORMATS[i]);\n format.setTimeZone(gmt);\n try\n {\n return format.parse(dateString);\n }\n catch (ParseException e)\n {\n // try the next pattern\n }\n }\n \n return null;\n }", "public static LocalDateTime parseDateTime(String input) {\n\n if (input.contains(\"Weekly\")) {\n WeeklyFlag = true;\n input = input.replace(\"Weekly\",\"\");\n }\n LocalDateTime dateTime = null;\n ArrayList<String> patterns = getPatterns(false);\n for (String pattern : patterns) {\n if (dateTime == null) {\n try {\n dateTime = LocalDateTime.parse(input.trim(), DateTimeFormatter.ofPattern(pattern));\n } catch (Exception e) {\n e.addSuppressed(new CommandException()); // do nothing basically.\n }\n } else {\n break;\n }\n }\n if (dateTime == null) {\n patterns = getPatterns(true);\n for (String datePattern : patterns) {\n if (dateTime == null) {\n try {\n dateTime = LocalDate.parse(input.trim(),\n DateTimeFormatter.ofPattern(datePattern)).atStartOfDay();\n } catch (Exception e) {\n e.addSuppressed(new CommandException()); // do nothing basically.\n }\n } else {\n break;\n }\n }\n }\n return dateTime;\n }", "public static Date parseDate(String dateString, String userId) throws ParseException\n\t{\n\t\tif ((dateString == null) || (dateString.trim().length() == 0)) return null;\n\t\tDateFormat format = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT, getPreferredLocale(userId));\n\t\tformat.setTimeZone(getPreferredTimeZone(userId));\n\t\tDate rv = format.parse(dateString);\n\t\treturn rv;\n\t}", "public LocalDateTime getDateTime(String time) {\n if(!isTimeValid(time)){\n log.log(Level.WARNING, \"wrong time format set it to default\");\n return LocalDateTime.now();\n }\n return LocalDateTime.parse(time, dateTimeFormatter);\n }", "public Date parseDate(String nameAndDateLine) {\n String dateAndTime = \n nameAndDateLine.substring(nameAndDateLine.indexOf(\"Date: \"));\n \n int indexOfColon = dateAndTime.indexOf(\"/:\");\n if(indexOfColon != -1) {\n dateAndTime = dateAndTime.substring(0, indexOfColon)\n + dateAndTime.substring(indexOfColon, indexOfColon + 2).replace(':','0')\n + dateAndTime.substring(indexOfColon + 2);\n }\n \n try {\n Date lastModifiedDate = this.vssDateTimeFormat.parse(\n dateAndTime.trim() + \"m\");\n \n return lastModifiedDate;\n } catch (ParseException pe) {\n pe.printStackTrace();\n return null;\n }\n }", "protected static int getHour(String dateTime) {\n return Integer.parseInt(dateTime.substring(7, 9));\n }" ]
[ "0.70300114", "0.659632", "0.61919063", "0.6187425", "0.6183062", "0.6166252", "0.6151427", "0.60673934", "0.60291165", "0.6027041", "0.6017524", "0.58680254", "0.58610356", "0.5846526", "0.5826721", "0.58133036", "0.577623", "0.57548094", "0.57530653", "0.5752051", "0.5742612", "0.57214713", "0.56991297", "0.56734645", "0.56432116", "0.56400514", "0.56356853", "0.5635459", "0.5619226", "0.561508", "0.5608703", "0.5541803", "0.552323", "0.55224705", "0.5502601", "0.548725", "0.5479492", "0.5452751", "0.5422039", "0.5400712", "0.5362375", "0.5345721", "0.53301644", "0.53275", "0.5303273", "0.52732855", "0.52638674", "0.525263", "0.5242424", "0.5230495", "0.5230314", "0.5226715", "0.52227414", "0.5217993", "0.5212314", "0.5211052", "0.52036995", "0.5186072", "0.5176339", "0.5171283", "0.5167986", "0.5160735", "0.51597095", "0.5152833", "0.514817", "0.51475036", "0.51437175", "0.51377237", "0.5133084", "0.51326287", "0.5130294", "0.5121305", "0.5119425", "0.51190656", "0.5098077", "0.5095016", "0.5090633", "0.5090629", "0.5085213", "0.5083321", "0.50673974", "0.5060527", "0.50558406", "0.50374585", "0.50336456", "0.50278646", "0.50241673", "0.50179976", "0.49932525", "0.49807227", "0.49785814", "0.4930107", "0.4927273", "0.49249485", "0.49040994", "0.49026272", "0.48942223", "0.48893014", "0.4871309", "0.48640326" ]
0.6869766
1
Validate a Time (Hour + Minutes)
public static boolean isTimeValid(String argTime, String format) { DateFormat timeFormat = new SimpleDateFormat(format); timeFormat.setLenient(false); try { timeFormat.parse(argTime); } catch (ParseException e) { return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean checkValidTime(String inputTime) {\n int hour = Integer.parseInt(inputTime.substring(0,2));\n int minute = Integer.parseInt(inputTime.substring(2,4));\n \n if ((hour >= 0 && hour <= 23) && (minute >= 0 && minute <= 59)) {\n return true;\n } else {\n return false;\n }\n }", "private boolean timeValidation(String time){\n if(! time.matches(\"(?:[0-1][0-9]|2[0-4]):[0-5]\\\\d\")){\n return false;\n }\n return true;\n }", "public static boolean isValidTime(String time) throws NumberFormatException {\n\n int timeInt = Integer.parseInt(time); //throws NumberFormatException if \"time\" contains non-digit characters\n\n if (time.length() != 4) {\n return false;\n }\n\n char[] timeArray = time.toCharArray();\n int hour = Integer.parseInt(new String(timeArray, 0, 2));\n\n int minute = 10 * Integer.parseInt(Character.toString(timeArray[2]))\n + Integer.parseInt(Character.toString(timeArray[3]));\n\n return hour >= 0 && hour < 24 && minute >= 0 && minute < 60;\n\n }", "public static boolean validateTime(String validTill) {\n\t\treturn true;\n\t}", "private boolean checkTime(int hour, int minutes) {\n\tboolean check = true;\n\t\tif((hour < 0) || (hour > 23) || (minutes < 0) || (minutes > 59)) {\n\t\t\tcheck = false;\n\t\t}\n\t\telse {\n\t\t\tcheck = true;\n\t\t}\n\treturn check;\n\t}", "private boolean checkValidHour() {\n return numHours >= 0 && numHours <= 23;\n }", "boolean isValidExpTime();", "private Boolean TimeInRange(String time){\n \n String[] t = time.split(\":\");\n \n int hours = Integer.parseInt(t[0]);\n int minutes = Integer.parseInt(t[1]);\n int seconds = Integer.parseInt(t[2]);\n \n if(hours == 11 && minutes == 59 && (seconds >= 55)){\n return true;\n }\n \n return false;\n \n }", "public static boolean isPickupTimeValid(int hour, int minute){\n Calendar currentTime = Calendar.getInstance();\n int c_hour = currentTime.get(Calendar.HOUR_OF_DAY);\n int c_minute = currentTime.get(Calendar.MINUTE);\n\n //Given time in minutes\n int g_mins = hour*60 + minute;\n\n //Current time in minutes\n int c_mins = c_hour*60 + c_minute;\n\n if(g_mins-c_mins<30){\n return false;\n }\n\n return true;\n }", "public static boolean isReservationTimeValid(int hour, int minute){\n Calendar currentTime = Calendar.getInstance();\n int c_hour = currentTime.get(Calendar.HOUR_OF_DAY);\n int c_minute = currentTime.get(Calendar.MINUTE);\n\n //Given time in minutes\n int g_mins = hour*60 + minute;\n\n //Current time in minutes\n int c_mins = c_hour*60 + c_minute;\n\n if(g_mins-c_mins<180){\n return false;\n }\n\n return true;\n }", "private String doValidTimeCheck(String pDateTime) {\n String aDateTime = pDateTime;\n\n if (pDateTime.length() > 0) {\n String aTime = pDateTime.substring(8);\n if (aTime.matches(\"240000\")) {\n aDateTime = pDateTime.substring(0,8) + \"235900\";\n }\n }\n return aDateTime;\n }", "public boolean validateTime(){\n if(startSpinner.getValue().isAfter(endSpinner.getValue())){\n showError(true, \"The start time can not be greater than the end time.\");\n return false;\n }\n if(startSpinner.getValue().equals(endSpinner.getValue())){\n showError(true, \"The start time can not be the same as the end time.\");\n return false;\n }\n startLDT = convertToTimeObject(startSpinner.getValue());\n endLDT = convertToTimeObject(endSpinner.getValue());\n startZDT = convertToSystemZonedDateTime(startLDT);\n endZDT = convertToSystemZonedDateTime(endLDT);\n\n if (!validateZonedDateTimeBusiness(startZDT)){\n return false;\n }\n if (!validateZonedDateTimeBusiness(endZDT)){\n return false;\n };\n return true;\n }", "public boolean validateTimes() {\n if (!allDay) {\n // Convert the time strings to ints\n int startTimeInt = parseTime(startTime);\n int endTimeInt = parseTime(endTime);\n\n if (startTimeInt > endTimeInt) {\n return false;\n }\n }\n return true;\n }", "public static boolean isValidTime(String test) {\n try {\n LocalTime.parse(test, TIME_FORMATTER);\n LocalTime.parse(test, TIME_FORMATTER_STRICT);\n return true;\n } catch (DateTimeParseException ex) {\n return false;\n }\n }", "public static String[] validateHours(String hours) {\n\tString[] hourString=new String[2];\r\n\tStringTokenizer st=new StringTokenizer(hours,\"-\");\r\n\ttry{\r\n\t\thourString[0]=st.nextToken();\r\n\t\thourString[1]=st.nextToken();\r\n\t}\r\n\tcatch(Exception e){\r\n\t\tSystem.out.println(\"Hours are not proper:\");\r\n\t\thourString[0]=null;\r\n\t\treturn hourString;\r\n\t}\r\n\tboolean validHour=validInteger(hourString[0]);\r\n\tif(!validHour || hourString[0].length()!=4){\r\n\t\tSystem.out.println(\"Invalid Start Time\");\r\n\t\thourString[0]=null;\r\n\t\treturn hourString;\r\n\t}\r\n\tvalidHour=validInteger(hourString[1]);\r\n\tif(!validHour || hourString[1].length()!=4){\r\n\t\tSystem.out.println(\"Invalid End Time Time\");\r\n\t\thourString[0]=null;\r\n\t\treturn hourString;\r\n\t}\r\n\tString time=hourString[0].substring(0, 2)+\":\"+hourString[0].substring(2, 4);\r\n\thourString[0]=time;\r\n\tSystem.out.println(\"Start Time : \"+time);\r\n\ttime=null;\r\n\ttime=hourString[1].substring(0, 2)+\":\"+hourString[1].substring(2, 4);\r\n\thourString[1]=time;\r\n\treturn hourString;\r\n}", "private boolean checkTime(){\n\t\treturn false;\r\n\t}", "boolean hasTime();", "boolean hasTime();", "public void verifyTime(@NonNull final LocalDateTime date) {\n onView(viewMatcher).check(ViewAssertions.matches(withText(date.format(timeFormat))));\n }", "private static boolean validate(String line){\n\t\tString[] lineArray = line.split(\" \");\n\t\t\n\t\tif(lineArray.length != 3) return false; //skip lines in incorrect format\n\t\t\n\t\t//http://stackoverflow.com/questions/25873636/regex-pattern-for-exactly-hhmmss-time-string\n\t\tif(!lineArray[0].matches(\"(?:[01]\\\\d|2[0123]):(?:[012345]\\\\d):(?:[012345]\\\\d)\")) return false;\n\n\t\tif(!lineArray[2].equals(\"Start\") && !lineArray[2].equals(\"End\")) return false;\n\t\t\n\t\treturn true;\n\t}", "public static boolean hasTime(String time) {\n String[] components = time.split(\" \");\n return components.length == 2;\n }", "boolean hasDesiredTime();", "private static void checkFormat(String str) {\n if (str.length() != 8)\n throw new IllegalArgumentException(\"length has too be 8\");\n try {\n Integer.parseInt(str.substring(0,2)); //Hours\n Integer.parseInt(str.substring(3,5)); //Minutes\n } catch (NumberFormatException e) {\n throw new IllegalArgumentException(\"These numbers are wrong\");\n }\n if (str.charAt(2) != ':') {\n throw new IllegalArgumentException(\"requires colon between times\");\n }\n if (str.charAt(5) != ' ') {\n throw new IllegalArgumentException(\"requires space between time and period\");\n }\n String mStr = str.substring(6);\n if (!mStr.equals(\"PM\") && !mStr.equals(\"AM\")) {\n throw new IllegalArgumentException(\"Must be AM or PM\");\n }\n }", "public Time(int hour, int minutes) throws BlablakidException{\n\t\tif(checkTime(hour,minutes)==false) {\n\t\t\tthrow new BlablakidException(\"The hour or the minutes introduced are wrong , \"+hour+\":\"+minutes);\n\t\t}\n\t\telse {\n\t\t\tthis.hour = hour;\n\t\t\tthis.minutes = minutes;\n\t\t}\n\t}", "private boolean validateArrivingTime(StopPoint currentSP) {\n\t\ttry {\n\t\t\tint time = Integer.valueOf(hourComboBox.getValue()) * 60;\n\t\t\ttime += Integer.valueOf(minuteComboBox.getValue());\n\t\t\ttime += timeIndicatorComboBox.getValue().equals(\"PM\") ? 12 * 60 : 0;\n\t\t\tfor (StopPoint stopPoint : stopPoints) {\n\t\t\t\tif (stopPoint.getTime() != null && !stopPoint.getTime().equals(\"\") && stopPoint != currentSP) {\n\t\t\t\t\tString[] spTimeString = stopPoint.getTime().split(\"[ :]+\");\n\t\t\t\t\tint spTime = Integer.valueOf(spTimeString[0]) * 60;\n\t\t\t\t\tspTime += Integer.valueOf(spTimeString[1]);\n\t\t\t\t\tspTime += spTimeString[2].equals(\"PM\") ? 12 * 60 : 0;\n\n\t\t\t\t\tif (time <= spTime + 5 && time >= spTime - 5) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} catch (Exception e) {\n\t\t\treturn false;\n\t\t}\n\t}", "private boolean splitTime(String timeString) throws Exception {\n\t\tif (timeSet)\n\t\t\tthrow new Exception(\"Double time \" + timeString);\n\t\tStringTokenizer st = new StringTokenizer(timeString, \":\");\n\t\tif (st.countTokens() == 3) {\n\t\t\thour = Integer.valueOf(st.nextToken()).intValue();\n\t\t\tminute = Integer.valueOf(st.nextToken()).intValue();\n\t\t\tsecond = Integer.valueOf(st.nextToken()).intValue();\n\t\t}\n\t\telse if (st.countTokens() == 2) {\n\t\t\thour = Integer.valueOf(st.nextToken()).intValue();\n\t\t\tminute = Integer.valueOf(st.nextToken()).intValue();\n\t\t}\n\t\telse\n\t\t\tthrow new Exception(\"Wrong number of arguments\" + timeString);\n\t\tif ((hour < 0)\n\t\t|| (hour > 23)\n\t\t|| (minute < 0)\n\t\t|| (minute > 59)\n\t\t|| (second < 0)\n\t\t|| (second > 59)) {\n\t\t\tthrow new Exception(\"Not a valid time \" + timeString);\n\t\t}\n\t\thour = hour % 24;\n\t\tminute = minute % 60;\n\t\tsecond = second % 60;\n\t\tdate = new Date((year - 1900)\n\t\t\t , (month - 1)\n\t\t\t\t , day\n\t\t\t , hour\n\t\t\t\t , minute\n\t\t\t\t , second);\n\t\ttimeSet = true;\n\t\treturn true;\n }", "public Time(int hours, int minutes) {\n this.hours = hours;\n this.minutes = minutes;\n }", "public void check(int time)\n {\n if(time < 0)\n {\n throw new IllegalArgumentException();\n }\n }", "public static void checkTime(String[] desc, Commands type) throws EmptyTimeException {\n String usage = \"Please input using the format: \" + (type.equals(Commands.TODO)\n ? \"todo <todo_desc>\"\n : type.equals(Commands.DEADLINE)\n ? \"deadline <deadline_desc> /by <time>\"\n : \"event <event_desc> /at <time>\");\n if (desc.length < 2 || desc[1].trim().equals(\"\")) {\n throw new EmptyTimeException(\"Please specify the time for the task\\n\" + usage);\n }\n }", "public Time( int hour, int minute ) {\n this( hour * MINS_PER_HR + minute );\n }", "@Test\n void deve_retornar_uma_datetimeexception() {\n List<LocalTime> localTimes = Arrays.asList(LocalTime.parse(\"12:00:00\"));\n TimeModel timeModel = TimeModelStub.getTimeModel();\n timeModel.setPeriod(TimeCourseEnum.SECOND_PERIOD_IN);\n timeModel.setTime(\"12:30\");\n Assert.assertThrows(DateTimeException.class, () -> timeService.checkInterval(timeModel, localTimes));\n }", "private LocalDateTime parseTime(String time) {\n String[] str = time.split(\" \");\n String[] oldDate = str[0].split(\"/\");\n if (oldDate.length != 3) {\n throw new DukeException(\"OOPS!!! The time is not of the correct format!\");\n }\n LocalDateTime localTime;\n if (str.length > 1) {\n String hour = str[1].substring(0, 2);\n String min = str[1].substring(2, 4);\n\n localTime = LocalDateTime.of(Integer.parseInt(oldDate[2]), Integer.parseInt(oldDate[1]),\n Integer.parseInt(oldDate[0]), Integer.parseInt(hour), Integer.parseInt(min));\n } else {\n localTime = LocalDate.of(Integer.parseInt(oldDate[2]), Integer.parseInt(oldDate[1]),\n Integer.parseInt(oldDate[0]))\n .atStartOfDay();\n hasTime = false;\n }\n return localTime;\n }", "public final void mRULE_TIME() throws RecognitionException {\n try {\n int _type = RULE_TIME;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // InternalMyDsl.g:15366:11: ( ( '0' .. '9' )+ ':' ( '0' .. '9' )+ )\n // InternalMyDsl.g:15366:13: ( '0' .. '9' )+ ':' ( '0' .. '9' )+\n {\n // InternalMyDsl.g:15366:13: ( '0' .. '9' )+\n int cnt5=0;\n loop5:\n do {\n int alt5=2;\n int LA5_0 = input.LA(1);\n\n if ( ((LA5_0>='0' && LA5_0<='9')) ) {\n alt5=1;\n }\n\n\n switch (alt5) {\n \tcase 1 :\n \t // InternalMyDsl.g:15366:14: '0' .. '9'\n \t {\n \t matchRange('0','9'); \n\n \t }\n \t break;\n\n \tdefault :\n \t if ( cnt5 >= 1 ) break loop5;\n EarlyExitException eee =\n new EarlyExitException(5, input);\n throw eee;\n }\n cnt5++;\n } while (true);\n\n match(':'); \n // InternalMyDsl.g:15366:29: ( '0' .. '9' )+\n int cnt6=0;\n loop6:\n do {\n int alt6=2;\n int LA6_0 = input.LA(1);\n\n if ( ((LA6_0>='0' && LA6_0<='9')) ) {\n alt6=1;\n }\n\n\n switch (alt6) {\n \tcase 1 :\n \t // InternalMyDsl.g:15366:30: '0' .. '9'\n \t {\n \t matchRange('0','9'); \n\n \t }\n \t break;\n\n \tdefault :\n \t if ( cnt6 >= 1 ) break loop6;\n EarlyExitException eee =\n new EarlyExitException(6, input);\n throw eee;\n }\n cnt6++;\n } while (true);\n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "public static boolean isValidDatetime(String test) {\n String[] components = test.split(\" \");\n String date = components[0];\n String startTime = components[1];\n\n //If the format is dd/mm/yyyy hhmm k\n if (components.length == 3) {\n String duration = components[2];\n return isValidDate(date) && isValidTime(startTime) && isValidDuration(duration);\n //If the format is dd/mm/yyyy hhmm to hhmm\n } else if (components.length == 4) {\n String endtime = components[3];\n return isValidDate(date) && isValidTime(startTime) && isValidTime(endtime);\n } else {\n return false;\n }\n }", "public boolean checkTime(Calendar from,Calendar to,Calendar time)\n {\n if(time.after(from) && time.before(to))\n {\n return true;\n }\n return false;\n }", "public void setValidTime(java.util.Date validTime) {\r\n this.validTime = validTime;\r\n }", "public boolean timeValidated(Event e) {\n\t\tLocalDate date = e.sDate;\n\t\tLocalTime stime = e.sTime;\n\t\tLocalTime etime = e.eTime;\n\t\tArrayList<Event> list = new ArrayList<Event>();\n\t\tif(map.containsKey(date)) {\n\t\t\tlist = map.get(date);\n\n\t\t\tfor(int i = 0; i<list.size(); i++) {\n\t\t\t\tEvent evnt = list.get(i);\n\n\t\t\t\tif(e.sTime.equals(evnt.sTime) || e.eTime.equals(evnt.eTime)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t//check for start times\n\t\t\t\tif(e.sTime.isBefore(evnt.sTime)) {\n\t\t\t\t\tif(!e.eTime.isBefore(evnt.sTime)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//check for end time\n\t\t\t\tif(e.sTime.isAfter(evnt.sTime)) {\n\t\t\t\t\tif(!e.sTime.isAfter(evnt.eTime)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn true;\n\t\t}\n\t}", "private boolean checkStartTimeBeforeEndTime(String startTime, String endTime) {\n int startHour = Integer.parseInt(startTime.substring(0,2));\n int startMinute = Integer.parseInt(startTime.substring(2,4));\n int endHour = Integer.parseInt(endTime.substring(0,2));\n int endMinute = Integer.parseInt(endTime.substring(2,4));\n \n if (startHour < endHour) {\n return true;\n } else if (startHour > endHour) {\n return false;\n } else {\n if (startMinute < endMinute) {\n return true;\n } else {\n return false;\n }\n }\n }", "private boolean isValidHours(int hours){\n boolean isValid = false;\n if(hours < 0){\n generalTextArea.appendText(\"Working hours cannot be negative.\\n\");\n }else if(hours > MAXHOURS){\n generalTextArea.appendText(\"Invalid hours: over 100.\\n\");\n }else{\n isValid = true;\n }\n return isValid;\n }", "public boolean isBefore(Time time) {\n\tboolean check = true;\n\t\tif(this.getHour() > time.getHour()) {\n\t\t\tcheck = false;\n\t\t} else if((this.getHour() == time.getHour()) && (this.getMinutes() > time.getMinutes())){\n\t\t\tcheck = false;\n\t\t}\n\t\treturn check;\n\t}", "public final void mRULE_TWELVEHRSTIME() throws RecognitionException {\n try {\n int _type = RULE_TWELVEHRSTIME;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // InternalDSL.g:16739:20: ( '0' .. '1' '0' .. '9' ':' '0' .. '5' '0' .. '9' ( ':' '0' .. '6' '0' .. '9' ( '.' '0' .. '9' '0' .. '9' '0' .. '9' )? )? ( 'am' | 'pm' ) )\n // InternalDSL.g:16739:22: '0' .. '1' '0' .. '9' ':' '0' .. '5' '0' .. '9' ( ':' '0' .. '6' '0' .. '9' ( '.' '0' .. '9' '0' .. '9' '0' .. '9' )? )? ( 'am' | 'pm' )\n {\n matchRange('0','1'); \n matchRange('0','9'); \n match(':'); \n matchRange('0','5'); \n matchRange('0','9'); \n // InternalDSL.g:16739:62: ( ':' '0' .. '6' '0' .. '9' ( '.' '0' .. '9' '0' .. '9' '0' .. '9' )? )?\n int alt30=2;\n int LA30_0 = input.LA(1);\n\n if ( (LA30_0==':') ) {\n alt30=1;\n }\n switch (alt30) {\n case 1 :\n // InternalDSL.g:16739:63: ':' '0' .. '6' '0' .. '9' ( '.' '0' .. '9' '0' .. '9' '0' .. '9' )?\n {\n match(':'); \n matchRange('0','6'); \n matchRange('0','9'); \n // InternalDSL.g:16739:85: ( '.' '0' .. '9' '0' .. '9' '0' .. '9' )?\n int alt29=2;\n int LA29_0 = input.LA(1);\n\n if ( (LA29_0=='.') ) {\n alt29=1;\n }\n switch (alt29) {\n case 1 :\n // InternalDSL.g:16739:86: '.' '0' .. '9' '0' .. '9' '0' .. '9'\n {\n match('.'); \n matchRange('0','9'); \n matchRange('0','9'); \n matchRange('0','9'); \n\n }\n break;\n\n }\n\n\n }\n break;\n\n }\n\n // InternalDSL.g:16739:121: ( 'am' | 'pm' )\n int alt31=2;\n int LA31_0 = input.LA(1);\n\n if ( (LA31_0=='a') ) {\n alt31=1;\n }\n else if ( (LA31_0=='p') ) {\n alt31=2;\n }\n else {\n NoViableAltException nvae =\n new NoViableAltException(\"\", 31, 0, input);\n\n throw nvae;\n }\n switch (alt31) {\n case 1 :\n // InternalDSL.g:16739:122: 'am'\n {\n match(\"am\"); \n\n\n }\n break;\n case 2 :\n // InternalDSL.g:16739:127: 'pm'\n {\n match(\"pm\"); \n\n\n }\n break;\n\n }\n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "Builder addTimeRequired(String value);", "boolean hasErrorTime();", "public String verifyTimeMatch(String startTime, String startTimeAMPM,\r\n\t\t\tString endTime, String endTimeAMPM, String webinarTime) {\r\n\t\tString returnMsg = \"success\";\r\n\r\n\t\tString[] webinarTimeDetails = this.getTimeAMPMZone(webinarTime);\r\n\t\tif (!startTime.equalsIgnoreCase(webinarTimeDetails[0])) {\r\n\t\t\treturnMsg = \"Start Time is not matching\";\r\n\t\t}\r\n\t\tif (!startTimeAMPM.equalsIgnoreCase(webinarTimeDetails[1])) {\r\n\t\t\treturnMsg = \"Start Time AMPM is not matching\";\r\n\t\t}\r\n\t\tif (!endTime.equalsIgnoreCase(webinarTimeDetails[2])) {\r\n\t\t\treturnMsg = \"End Time is not matching\";\r\n\t\t}\r\n\t\tif (!endTimeAMPM.equalsIgnoreCase(webinarTimeDetails[3])) {\r\n\t\t\treturnMsg = \"End Time AMPM is not matching\";\r\n\t\t}\r\n\t\treturn returnMsg;\r\n\r\n\t}", "public void setValidtime(String validtime) {\n this.validtime = validtime == null ? null : validtime.trim();\n }", "@Override\n\tpublic void validate(Component arg0, Object arg1) throws WrongValueException {\n\t\tif (arg0 instanceof Timebox) {\n\n\t\t\t// no need for checking ?\n\t\t\tif (((Timebox) arg0).isDisabled())\n\t\t\t\treturn;\n\t\t\t\n\t\t\tif (arg1 == null)\n\t\t\t\tthrow new WrongValueException(arg0, \"Campo obligatorio\");\n\t\t\telse{\n\t\t\t\tCalendar validaMinutos = Calendar.getInstance();\n\t\t\t\tvalidaMinutos.setTime((Date)arg1);\n\t\t\t\tint totalMinutos = ((validaMinutos.get(Calendar.HOUR_OF_DAY)*60) + validaMinutos.get(Calendar.MINUTE));\n\t\t\t\t\n\t\t\t\tif(totalMinutos < 15)\n\t\t\t\t\tthrow new WrongValueException(arg0, \"Duración mínima de recesos es de 15 minutos\");\n\t\t\t\telse\n\t\t\t\t\tif(totalMinutos % 5 != 0)\n\t\t\t\t\t\tthrow new WrongValueException(arg0, \"Tiempo no permitido, debe ser múltiplo de 5 minutos\");\n\t\t\t}\n\t\t}\n\t}", "private static int validTimeLength(String timeString) {\n\t\tif (TextUtils.isEmpty(timeString)) { return 0; }\n\t\t\n\t\tint time;\n\t\ttry {\n\t\t\ttime = Integer.parseInt(timeString);\n\t\t\tif (time > MAX_TIME_VALUE) { time = MAX_TIME_VALUE; }\n\t\t} catch (Exception e) { // Don't care which exception it is.\n\t\t\ttime = MAX_TIME_VALUE;\n\t\t}\n\t\treturn time;\n\t}", "private void checkPlayingAt(@NonNull TimeIntervalMatcher time) {\n checkPlaying();\n timeView.check(matches(withText(time)));\n }", "public boolean isTime() {\n return false;\n }", "public InvalidTimeException(String message) {\n super(message);\n }", "public static boolean verifyTimeStamp(String timeStr) {\n return true;\n }", "public Time(long hour, long minute, long second) {\r\n\t\tthis.hour = hour;\r\n\t\tthis.minute = minute;\r\n\t\tthis.second = second;\r\n\t}", "public String getValidtime() {\n return validtime;\n }", "private AbsTime(String t) throws NumberFormatException, Time.Ex_TimeNotAvailable\n {\n // Parse the string.\n parse(t);\n }", "public FlightTime(int hour, int minute, String timeType) {\n\t\tthis.hour = hour;\n\t\tthis.minute = minute;\n\t\tthis.timeType = timeType;\n\t}", "private int getHour() {\n\t\tString time = getPersistedString(this.defaultValue);\n\t\tif (time == null || !time.matches(VALIDATION_EXPRESSION)) {\n\t\t\treturn -1;\n\t\t}\n\n\t\treturn Integer.valueOf(time.split(\":|/\")[0]);\n\t}", "public static Time fromString( String timeStr ) {\n int hour, minute;\n\n String[] parts = timeStr.split( \":\" );\n if ( parts.length != 2 ) throw new NumberFormatException( timeStr );\n hour = Integer.parseInt( parts[ 0 ] );\n\n String[] subParts = parts[ 1 ].split( \" \" );\n if ( subParts.length > 2 ) throw new NumberFormatException( timeStr );\n minute = Integer.parseInt( subParts[ 0 ] );\n\n if ( subParts.length == 2 ) { // Meridiem indicator is present.\n switch ( subParts[ 1 ] ) {\n case \"AM\":\n case \"am\":\n if ( hour == Time.HALF_DAY_HRS ) {\n hour = 0;\n }\n break;\n case \"PM\":\n case \"pm\":\n if ( hour != Time.HALF_DAY_HRS ) {\n hour += Time.HALF_DAY_HRS;\n }\n break;\n default:\n throw new NumberFormatException( timeStr );\n }\n }\n if (\n hour < 0 || hour >= Time.HRS_PER_DAY ||\n minute < 0 || minute >= Time.MINS_PER_HR\n ) {\n throw new NumberFormatException( \"Bad time \" + hour + ':' + minute );\n }\n return new Time( hour, minute );\n }", "private void assertValidTimeWindow() {\n if (getSuggestedWindowStart().isAfter(getSuggestedWindowEnd())) {\n throw new AcmeProtocolException(\"Received an invalid suggested window\");\n }\n }", "public boolean hasTime() {\n return ((bitField0_ & 0x00000008) == 0x00000008);\n }", "public int parseTimeForHour(String time)\n\t{\n\t\ttry {\n\t\t\tDate date = new SimpleDateFormat(\"hh:mma\", Locale.ENGLISH).parse(time);\n\t\t\t\n\t\t\t@SuppressWarnings(\"deprecation\")\n\t\t\tint hour = date.getHours();\n\t\t\treturn hour;\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\treturn -1;\n\t}", "public boolean hasTime() {\n return ((bitField0_ & 0x00000008) == 0x00000008);\n }", "private boolean validateDateAndTime(String date) {\n boolean isValid;\n Calendar prevDay;\n\n if(date != null && !date.isEmpty() && date.length() < MIN_DATE_LEN) {\n isValid = false;\n } else {\n prevDay = Calendar.getInstance(Locale.CANADA);\n prevDay.add(Calendar.DATE, -1); // All days valid from one day in the past\n Calendar cal = DateUtility.convertToDateObj(date);\n isValid = cal != null && cal.after(prevDay);\n }\n\n return isValid;\n }", "public static int secondsAfterMidnight(String t) {\n int seconds; //initializing seconds, will be returned to main.\n t.toLowerCase(); //setting all input to lowercase so it is easier to handle.\n if (t.length() == 10){ //if input is 10 characters\n // if statement below checks whether each character is appropriate before continuing.\n if((t.startsWith(\"0\") || t.startsWith(\"1\"))&& Character.isDigit(t.charAt(1))&& \n t.charAt(2) == ':' && Character.isDigit(t.charAt(3))&& Character.isDigit(t.charAt(4))&&\n t.charAt(5) == ':' && Character.isDigit(t.charAt(6))&& Character.isDigit(t.charAt(7))&&\n (t.endsWith(\"am\") || t.endsWith(\"pm\"))){\n // Characters converted to numeric values and hours, minutes, and seconds are\n // calculated below.\n int hours = Character.getNumericValue(t.charAt(0))*10 \n + Character.getNumericValue(t.charAt(1));\n //if hours is equal to 12 such as 12:35, switched to 0:35, for easier calc.\n if(hours == 12){ \n hours = 0;\n }\n int minutes = Character.getNumericValue(t.charAt(3))*10 \n + Character.getNumericValue(t.charAt(4));\n seconds = Character.getNumericValue(t.charAt(6))*10 \n + Character.getNumericValue(t.charAt(7)); \n if(minutes < 60 && seconds < 60){//checks whether minute and second input is below 60.\n if(t.endsWith(\"pm\")){ //adding 43200 (12 hours in seconds) if time is pm.\n seconds = hours*3600 + minutes*60 + seconds + 43200;\n }else{\n seconds = hours*3600 + minutes*60 + seconds; \n }\n }else{\n seconds = -1; //if proper input is not given, seconds set to -1.\n }\n } else {\n seconds = -1; //improper input leads to seconds set to -1.\n }\n //below is for input that has 9 characters, such as 9:12:23am, instead of 09:12:23am. The code below\n // is very similar to to code for 10 characters above. \n }else if (t.length() == 9){\n if(Character.isDigit(t.charAt(0))&& t.charAt(1) == ':' && Character.isDigit(t.charAt(2))\n && Character.isDigit(t.charAt(3))&& t.charAt(4) == ':' && Character.isDigit(t.charAt(5))\n && Character.isDigit(t.charAt(6))&&(t.endsWith(\"am\") || t.endsWith(\"pm\"))){\n int hours = Character.getNumericValue(t.charAt(0));\n int minutes = Character.getNumericValue(t.charAt(2))*10 \n + Character.getNumericValue(t.charAt(3));\n seconds = Character.getNumericValue(t.charAt(5))*10 \n + Character.getNumericValue(t.charAt(6)); \n if(minutes < 60 && seconds < 60){\n if(t.endsWith(\"pm\")){\n seconds = hours*3600 + minutes*60 + seconds + 43200;\n }else{\n seconds = hours*3600 + minutes*60 + seconds; \n }\n }else{\n seconds = -1;\n }\n } else {\n seconds = -1;\n }\n }else{ // if input has neither 10 or 9 characters, input not proper.\n seconds = -1;\n }\n return seconds; //seconds is returned to main.\n}", "private boolean CheckVisitorHour() {\n\t\tif (VisitHour_ComboBox.getValue() == null) {\n\t\t\tif (!VisitHour_ComboBox.getStyleClass().contains(\"error\"))\n\t\t\t\tVisitHour_ComboBox.getStyleClass().add(\"error\");\n\t\t\tVisitorHourNote.setText(\"* Select hour\");\n\t\t\treturn false;\n\t\t}\n\t\tVisitHour_ComboBox.getStyleClass().remove(\"error\");\n\t\tVisitorHourNote.setText(\"*\");\n\t\treturn true;\n\t}", "public void validateStartDateAndTime(String date){\n setStartDateAndTimeValid(validateDateAndTime(date));\n }", "public boolean selectDateTime(String timeString);", "public void setHour(int hour) throws InvalidDateException {\r\n\t\tif (hour < 24 & hour >= 0) {\r\n\t\t\tthis.hour = hour;\r\n\t\t} else {\r\n\t\t\tthrow new InvalidDateException(\"Please enter a realistic hour for the date (between 0 and 23) !\");\r\n\t\t}\r\n\t}", "@Override\n public LocalTime processInput() {\n LocalTime startTime = null;\n while (startTime == null) {\n eventUI.displayTimePrompt();\n try {\n String[] hourAndMinute = scanner.nextLine().split(\":\");\n startTime = LocalTime.of(Integer.parseInt(hourAndMinute[0]), Integer.parseInt(hourAndMinute[1]));\n }\n catch (ArrayIndexOutOfBoundsException | NumberFormatException | DateTimeException e) {\n eventUI.displayInvalidTime();\n }\n }\n return startTime;\n }", "public void updateChangedTime(int hour, int minute);", "private void validateTime()\n {\n List<Object> collisions = validateCollisions();\n\n for (Object object : collisions)\n {\n if (DietTreatmentBO.class.isAssignableFrom(object.getClass()))\n {\n _errors.add(String\n .format(\"Die Diätbehandlung '%s' überschneidet sich mit der Diätbehandlung '%s'\",\n _dietTreatment.getDisplayText(),\n ((DietTreatmentBO) object).getName()));\n }\n }\n }", "private void checkAlarm() {\n\t\tif(this.alarmHour==this.currHour && this.alarmMin==Integer.valueOf(this.currMin)) {\n\t\t\ttimer.cancel();\n\t\t\tSystem.out.println(this.alarmMsg+\"\\nThe time is \"+this.currHour+\":\"+this.currMin);\n\t\t\tString time;\n\t\t\tif(String.valueOf(alarmHour).length()==1) {\n\t\t\t\ttime= \"0\"+alarmHour+\":\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttime=alarmHour+\":\";\n\t\t\t}\n\t\t\tif(String.valueOf(alarmMin).length()==1) {\n\t\t\t\ttime+=\"0\"+alarmMin;\n\t\t\t}else {\n\t\t\t\ttime+=alarmMin;\n\t\t\t}\n\t\t\tJOptionPane.showMessageDialog(null, alarmMsg + \" - \"+ time+\"\\n\"+\"The time is \"+ time);\n\t\t}\n\t}", "private static boolean dateValid(int[] time ) { \r\n\t\tfor ( int i = 0 ; i < time.length; i++) \r\n\t\t\tif (time[i] >2400 || time[i] < 0 ) \r\n\t\t\t\treturn false;\r\n\t\treturn true;\t\t\r\n\t}", "public void testCmdUpdate_time_field() {\n\t\t// Initialize test variables\n\t\tCommandAction expectedCA;\n\t\tTask expectedTask;\n\t\tList<Task> expectedTaskList;\n\n\t\t/*\n\t\t * Test 3: Testing time field (all ID are valid)\n\t\t */\n\t\tctf.initialize();\n\t\texpectedTaskList = null;\n\t\taddNewTask(TASK_NAME_1);\n\n\t\t// Test 3a: start time and end time are both null\n\t\t_testCmdUpdate = new CmdUpdate();\n\t\tsetParameters(VALID_TASKID + \"\", TASK_NAME_1, null, null, null);\n\t\texpectedCA = new CommandAction(MSG_TASKNOUPDATE, false, expectedTaskList);\n\t\tctf.assertCommandAction(expectedCA, _testCmdUpdate.execute());\n\n\t\t// Test 3b: valid start time without end time\n\t\t_testCmdUpdate = new CmdUpdate();\n\t\tsetParameters(VALID_TASKID + \"\", TASK_NAME_1, VALID_START_TIME + \"\", null, null);\n\t\texpectedCA = new CommandAction(MSG_INVALIDTIME, false, expectedTaskList);\n\t\tctf.assertCommandAction(expectedCA, _testCmdUpdate.execute());\n\n\t\t// Test 3c: start time after end time\n\t\t_testCmdUpdate = new CmdUpdate();\n\t\tsetParameters(VALID_TASKID + \"\", TASK_NAME_1, INVALID_START_TIME + \"\", VALID_END_TIME + \"\", null);\n\t\texpectedCA = new CommandAction(MSG_INVALIDTIME, false, expectedTaskList);\n\t\tctf.assertCommandAction(expectedCA, _testCmdUpdate.execute());\n\n\t\texpectedTaskList = new ArrayList<Task>();\n\t\t// Test 3d: start time before end time\n\t\t_testCmdUpdate = new CmdUpdate();\n\t\tsetParameters(VALID_TASKID + \"\", TASK_NAME_1, VALID_START_TIME + \"\", VALID_END_TIME + \"\", null);\n\t\texpectedTask = ctf.createExpectedTask(TASK_NAME_1, VALID_START_TIME, VALID_END_TIME, PRIORITY_TYPE.NORMAL);\n\t\texpectedTaskList.add(expectedTask);\n\t\texpectedCA = new CommandAction(String.format(MSG_TASKUPDATED, VALID_TASKID), true, expectedTaskList);\n\t\tctf.assertCommandAction(expectedCA, _testCmdUpdate.execute());\n\t}", "public void setTime(String time) {\n }", "public static boolean isTime24HourFormat( Activity act ) {\r\n\t\tContentResolver cr = act.getContentResolver();\r\n\t\tString v = Settings.System.getString( cr, android.provider.Settings.System.TIME_12_24 );\r\n\t\tif ( v == null || v.isEmpty() || v.equals( \"12\" ) ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private boolean checkValidity(String startTime, String endTime) {\n\t\tDateFormat formatter = null;\n\t\tformatter = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\");\n\t\tDate startDate = null;\n\t\tDate endDate = null;\n\t\ttry {\n\t\t\tstartDate = (Date)formatter.parse(startTime);\n\t\t\tendDate = (Date)formatter.parse(endTime);\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\tif(startDate.getTime() >= endDate.getTime())\n\t\t\treturn false;\n\t\telse\n\t\t\treturn true;\n\t}", "public void setTime(int hour, int minute, int second){\r\n this.hour = hour ; /*when it was hour,minutes,second it was a new variable for this function bt as we used this.It gained access to the global ones. */\r\n this.minute = minute; \r\n this.second = second;\r\n }", "public void validateTestDuration(LocalTime duration, LocalDateTime startDate, LocalDateTime endDate)\n\t\t\tthrows UserException {\n\t\tlong hours = ChronoUnit.HOURS.between(startDate, endDate);\n\t\tif (duration.getHour() > hours) {\n\t\t\tthrow new UserException(\"Duration cannot be more than start time and end time\");\n\t\t\n\t}}", "private boolean isTimeKey(int keyCode) {\n\t\tif (keyCode >= 48 && keyCode <= 57) {\n\t\t\treturn true;\n\t\t}\n\t\t// 0 - 9 keys on number pad\n\t\tif (keyCode >= 96 && keyCode <= 105) {\n\t\t\treturn true;\n\t\t}\n\t\t// QWERTYUIOP keys\n\t\tif (keyCode == 81 || keyCode == 87 || keyCode == 69 || keyCode == 82\n\t\t\t\t|| keyCode == 84 || keyCode == 89 || keyCode == 85\n\t\t\t\t|| keyCode == 37 || keyCode == 79 || keyCode == 80) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public void setTime(String time) {\n this.time = time;\n }", "@java.lang.Override\n public boolean hasTime() {\n return instance.hasTime();\n }", "public static LocalTime time1(double maxMinutes)\n\t{\n\t\t//declare variables\n\t\tString str;\n\t\tlong newMaxMinutes;\n\t\t\n\t\t//create new scanner object\n\t\tScanner keyboard = new Scanner(System.in);\n\t\t\n\t\tSystem.out.print(\"Please enter your time of departure as hh:mm AM or PM: \");\n\t\tstr = keyboard.nextLine(); //gets user input\n\t\tString t = str.toString(); //converts user input\n\t\tDateTimeFormatter x = DateTimeFormatter.ofPattern(\"hh:mm a\"); //provides format for user input\n\t\tLocalTime time1 = LocalTime.parse(t, x); //parses converted input and format\n\t\tnewMaxMinutes = Math.round(maxMinutes); //converts maxMinutes to long with Math.round function\n\t\tLocalTime arrive = time1.plusMinutes(newMaxMinutes); //adds minutes of maxMinutes to time1 using time class\n\t\t\n\t\treturn arrive;\n\t\t\n\t}", "public void setTime(String newHour) { // setTime sets the appointment's hour in standard time\n \n // this divides the newHour string into the hour part and the 'am'/'pm' part\n int timeHour = Integer.parseInt(newHour.substring(0, newHour.length()-2)); // the number of the hour\n String timeAmPm = newHour.substring(newHour.length()-2); // whether it is 'am' or 'pm'\n\n // 4 possible cases exist and are handled in this order:\n // 1. after midnight/before noon\n // 2. midnight (12am)\n // 3. noon (12pm)\n // 4. afternoon\n if(timeAmPm.equalsIgnoreCase(\"am\") && timeHour != 12) {\n this.hour = timeHour;\n }\n else if(timeAmPm.equalsIgnoreCase(\"am\")) {\n this.hour = 0;\n }\n else if(timeHour == 12){\n this.hour = timeHour;\n }\n else {\n this.hour = timeHour + 12;\n }\n }", "private static boolean isTime(final Object obj) {\n return timeClass != null && timeClass.isAssignableFrom(obj.getClass());\n }", "@java.lang.Override\n public boolean hasTime() {\n return ((bitField0_ & 0x00000002) != 0);\n }", "public java.util.Date getValidTime() {\r\n return validTime;\r\n }", "public Time4 setHour( int hour ) \r\n { \r\n this.hour = ( hour >= 0 && hour < 24 ? hour : 0 ); \r\n\r\n return this; // enables chaining\r\n }", "@Test public void Time_len_6()\t\t\t\t\t\t\t\t\t{tst_time_(\"041526\"\t\t\t\t\t, \"04:15:26.000\");}", "public static void main(String[] args) {\n\t\tString n = \"수 10:00~18:30/목,토 09:00~13:00\";\n\t\t\n\t\tSystem.out.println(isTimePatternIn(n));\n\t}", "public boolean isMorning() {\r\n return hours >= 6 && hours <= 9;\r\n }", "@Test\n\tvoid testCheckDuration2() {\n\t\tassertFalse(DataChecker.checkDuration(Duration.ofMinutes(-11)));\n\t}", "public void testGetValue() throws Exception {\n Display display = Display.getDefault();\n Shell shell = new Shell(display, SWT.SHELL_TRIM);\n TimeProvider provider = new TimeProvider(shell, SWT.NONE);\n\n Text hourField = (Text)\n PrivateAccessor.getField(provider, \"hoursTextField\");\n Text minField = (Text)\n PrivateAccessor.getField(provider, \"minutesTextField\");\n Text secField = (Text)\n PrivateAccessor.getField(provider, \"secondsTextField\");\n\n hourField.setText(\"10\");\n minField.setText(\"15\");\n secField.setText(\"59\");\n assertEquals(\"Unexpected time value\", \"10:15:59\", provider.getValue());\n\n hourField.setText(\"\");\n minField.setText(\"\");\n secField.setText(\"5\");\n assertEquals(\"Unexpected time value\", \"5s\", provider.getValue());\n\n hourField.setText(\"\");\n minField.setText(\"2\");\n secField.setText(\"\");\n assertEquals(\"Unexpected time value\", \"2min\", provider.getValue());\n\n hourField.setText(\"1\");\n minField.setText(\"\");\n secField.setText(\"\");\n assertEquals(\"Unexpected time value\", \"1h\", provider.getValue());\n\n hourField.setText(\"1\");\n minField.setText(\"\");\n secField.setText(\"1\");\n assertEquals(\"Unexpected time value\", \"01:00:01\", provider.getValue());\n\n hourField.setText(\"\");\n minField.setText(\"\");\n secField.setText(\".1234\");\n assertEquals(\"Unexpected time value\", \"0.1234s\", provider.getValue());\n\n hourField.setText(\"2\");\n minField.setText(\"\");\n secField.setText(\".1234\");\n assertEquals(\"Unexpected time value\", \"02:00:00.1234\", provider.getValue());\n\n hourField.setText(\"\");\n minField.setText(\"2\");\n secField.setText(\"5\");\n assertEquals(\"Unexpected time value\", \"00:02:05\", provider.getValue());\n\n hourField.setText(\"3\");\n minField.setText(\"\");\n secField.setText(\"5\");\n assertEquals(\"Unexpected time value\", \"03:00:05\", provider.getValue());\n }", "boolean hasStartTime();", "public Time4( int hour, int minute ) \r\n { \r\n this.setTime( hour, minute, 0 ); \r\n }", "public static boolean isValidDate(String time, boolean hasTime) throws InvalidDateFormatException {\n String correctFormatNoDate = \"yyyy-MM-dd\";\n String correctFormatWithDate = \"yyyy-MM-dd HH:mm\";\n try {\n if (hasTime) {\n LocalDateTime.parse(time, DateTimeFormatter.ofPattern(correctFormatWithDate));\n } else {\n LocalDate.parse(time, DateTimeFormatter.ofPattern(correctFormatNoDate));\n }\n return true;\n } catch (DateTimeException err) {\n throw new InvalidDateFormatException(false);\n }\n }", "@Test\n @Override\n public void testTime(TestContext ctx) {\n testDecodeGeneric(ctx, \"test_time\", Duration.class, Duration.ofHours(18).plusMinutes(45).plusSeconds(2));\n }", "boolean hasEndTime();", "public Time( int hour, int minute, Meridiem meridiem ) {\n this(\n hour == Time.HALF_DAY_HRS ?\n meridiem == Meridiem.AM ?\n 0 :\n Time.HALF_DAY_HRS\n :\n meridiem == Meridiem.AM ?\n hour :\n hour + Time.HALF_DAY_HRS,\n minute\n );\n }", "public FilterByTimeCommand(Time time) throws ParseException {\n this.time = time;\n }", "public ClockTime(String s, String subtype) {\n super(Property.CLOCKTIME_PROPERTY,subtype);\n\n\n Date value = null;\n\n try {\n StringTokenizer tokens = new StringTokenizer(s, \":\");\n if (tokens.countTokens() == 1) {\n if (s.startsWith(\"24\")) {\n s = \"00\" + s.substring(2);\n }\n if (s.startsWith(\"00\")) {\n s = s.substring(2);\n if (s == null || s.equals(\"\"))\n s = \"00\";\n if (!s.equals(\"00\") && Integer.parseInt(s) >= 60) {\n calValue = null;\n return;\n //throw new Exception(\"Invalid clocktime: \" + s);\n }\n try {\n value = dfMedium.get().parse(\"00:\" + s + \":00\");\n }\n catch (Exception e) {\n calValue = null;\n return;\n }\n calValue = Calendar.getInstance();\n calValue.setTime(value);\n normalize();\n return;\n }\n if (s.length() > 0 && s.charAt(0) == '0')\n s = s.substring(1);\n int h = Integer.parseInt(s);\n if (h >= 0 && h <= 9)\n s = \"0\" + s + \":00:00\";\n else if (h < 24)\n s = s + \":00:00\";\n else if (h >= 100 && h <= 959) {\n int hh = Integer.parseInt(s.substring(0, 1));\n int mm = Integer.parseInt(s.substring(1, 3));\n if (mm >= 60) {\n calValue = null;\n return;\n //throw new Exception(\"Invalid clocktime: \" + s);\n }\n s = \"0\" + hh + \":\" + mm + \":00\";\n }\n else if (h >= 1000 && h <= 2359) {\n int hh = Integer.parseInt(s.substring(0, 2));\n int mm = Integer.parseInt(s.substring(2, 4));\n if (hh >= 24) {\n calValue = null;\n return;\n //throw new Exception(\"Invalid clocktime: \" + s);\n }\n if (mm >= 60) {\n calValue = null;\n return;\n //throw new Exception(\"Invalid clocktime: \" + s);\n }\n s = hh + \":\" + mm + \":00\";\n }\n else {\n calValue = null;\n return;\n //throw new Exception(\"Invalid clocktime: \" + s);\n }\n }\n else\n if (tokens.countTokens() == 2) {\n s += \":00\";\n }\n try {\n value = dfMedium.get().parse(s);\n calValue = Calendar.getInstance();\n calValue.setTime(value);\n normalize();\n if (getSubType(\"showseconds\") != null && getSubType(\"showseconds\").equalsIgnoreCase(\"false\")) {\n \tsetShortFormat(true);\n }\n }\n catch (Exception e) {\n //throw new Exception(e);\n calValue = null;\n }\n } catch (Throwable e1) {\n calValue = null;\n }\n }" ]
[ "0.8011656", "0.7886018", "0.7575459", "0.7365692", "0.734791", "0.69786066", "0.69724196", "0.6892564", "0.6872682", "0.6823736", "0.67990065", "0.6795869", "0.67899776", "0.64778024", "0.64664775", "0.6427323", "0.64241064", "0.64241064", "0.631447", "0.63097036", "0.6160363", "0.61549217", "0.6125661", "0.6100839", "0.6053618", "0.60500526", "0.6011772", "0.59958524", "0.5992618", "0.59861475", "0.59675926", "0.59643", "0.5946027", "0.5929557", "0.5928223", "0.59091747", "0.5889266", "0.586803", "0.58453345", "0.5836103", "0.5831306", "0.58307034", "0.5823924", "0.5736898", "0.5734876", "0.572195", "0.5719465", "0.5718934", "0.5704699", "0.56852484", "0.5673786", "0.5659688", "0.56484866", "0.5638629", "0.5636673", "0.5610997", "0.5595818", "0.5579582", "0.5571884", "0.5571529", "0.5570302", "0.5565822", "0.5564332", "0.55480886", "0.55410737", "0.5540376", "0.5528218", "0.5522031", "0.55128515", "0.5509678", "0.54970706", "0.5480233", "0.5471969", "0.5460258", "0.54557484", "0.5446004", "0.54369867", "0.5430331", "0.54267806", "0.54214984", "0.5417881", "0.5410825", "0.54023886", "0.54011047", "0.5394818", "0.538492", "0.5382777", "0.5379115", "0.53776944", "0.53595513", "0.53547776", "0.5354101", "0.5352187", "0.53438485", "0.53416175", "0.5340026", "0.5339125", "0.53325415", "0.5326209", "0.5324593" ]
0.60543346
24
TODO Autogenerated method stub
@Override public void onBannerClicked(MoPubView arg0) { }
{ "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 onBannerCollapsed(MoPubView arg0) { }
{ "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 onBannerExpanded(MoPubView arg0) { }
{ "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 onBannerFailed(MoPubView arg0, MoPubErrorCode arg1) { }
{ "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
This allows the implementation to fetch the db service ID from DB annotation
void modelType(Class<?> modelType);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getServiceID();", "java.lang.String getServiceId();", "String getService_id();", "String getServiceId();", "public ID getServiceID() {\n\treturn serviceID;\n }", "Long getDbId();", "@Override\n public ServiceID getServiceID() {\n\treturn servID;\n }", "public int getServiceID() {\n return serviceID;\n }", "public Integer getServiceid() {\r\n return serviceid;\r\n }", "@Transient\n\tpublic String getServiceId()\t{\n\t\treturn mServiceId;\n\t\t//else return \"N/A\";\n\t}", "public java.lang.Long getServiceId() {\n return serviceId;\n }", "java.lang.String getDatabaseId();", "public int dbId() { return dbId; }", "public java.lang.Long getServiceId() {\n return serviceId;\n }", "public java.lang.String getServiceId(){\r\n return localServiceId;\r\n }", "public ServiceID getServiceID() {\n\t\treturn null;\n\t}", "public abstract String getServiceId() throws RcsServiceException;", "@Override\n\tpublic java.lang.String getOSGiServiceIdentifier() {\n\t\treturn _autoDetailsService.getOSGiServiceIdentifier();\n\t}", "public ServiceID getServiceID() {\n return null;\n }", "public long getId() {\n return mServiceId;\n }", "public abstract long getSdiId();", "String serviceId(RequestContext ctx) {\n\n String serviceId = (String) ctx.get(SERVICE_ID);\n if (serviceId == null) {\n log.info(\"No service id found in request context {}\", ctx);\n }\n return serviceId;\n }", "protected abstract String getDatabaseID();", "public ID getMainService() { \r\n\t\tID retVal = this.getTypedField(46, 0);\r\n\t\treturn retVal;\r\n }", "public java.lang.String getOSGiServiceIdentifier();", "private MapDBLabelToId() {\n\t\tproperties = new ProjectProperties(this.getClass());\n\n\t\tmap = db.getCollection(COLLECTION_NAME);\n\t\t// commitFrequency = properties.getInt(\"mapdb.commit\");\n\t}", "public String getOSGiServiceIdentifier();", "public UUID getDbId() {\n return dbId;\n }", "public java.lang.String getServiceID()\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(SERVICEID$6, 0);\n if (target == null)\n {\n return null;\n }\n return target.getStringValue();\n }\n }", "public Service findById(int theId);", "public abstract String getConnectionId();", "public interface ISysIdtableService extends CommonService<SysIdtableEntity>{\n\n /**\n * 获取最大表序列值,不更新到数据库\n * @param code\n * @return\n */\n Long get(String code);\n\n /**\n * 获取一个当前最大序列后后,并跟新数据库\n * @param code\n * @return\n */\n Long increment(String code);\n\n}", "@Override\n public java.lang.String getBeanIdentifier() {\n return _marksService.getBeanIdentifier();\n }", "@Override \r\n protected Object determineCurrentLookupKey() {\n return DbContextHolder.getDbType(); \r\n }", "@Override\n\tpublic java.lang.String getOSGiServiceIdentifier() {\n\t\treturn _vcmsPortionLocalService.getOSGiServiceIdentifier();\n\t}", "@AutoEscape\n\tpublic String getIdPtoServicio();", "@Override\n\tpublic java.lang.String getOSGiServiceIdentifier() {\n\t\treturn _weatherLocalService.getOSGiServiceIdentifier();\n\t}", "public static String getOSGiServiceIdentifier() {\n\t\treturn getService().getOSGiServiceIdentifier();\n\t}", "public static String getOSGiServiceIdentifier() {\n\t\treturn getService().getOSGiServiceIdentifier();\n\t}", "public static String getOSGiServiceIdentifier() {\n\t\treturn getService().getOSGiServiceIdentifier();\n\t}", "@Override\n\tpublic java.lang.String getOSGiServiceIdentifier() {\n\t\treturn _clipLocalService.getOSGiServiceIdentifier();\n\t}", "public long getServiceTypeId() {\r\n\t\treturn serviceTypeId;\r\n\t}", "java.lang.String getBusinessId();", "CreateDatabase getService() {\n\t\t\t\t return CreateDatabase.this;\n\t\t\t\t }", "@Override\n public java.lang.String getBeanIdentifier() {\n return _balloonUserTrackingLocalService.getBeanIdentifier();\n }", "public void setId(int driverDBId);", "@Override\n\tpublic java.lang.String getBeanIdentifier() {\n\t\treturn _vanBanPhapQuyLocalService.getBeanIdentifier();\n\t}", "@java.lang.Override\n public java.lang.String getDatabaseId() {\n java.lang.Object ref = databaseId_;\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 databaseId_ = s;\n return s;\n }\n }", "public IDMLService getDMLService();", "@Override\n\tpublic String serviceTypeId() throws Exception{\n\t\treturn \"121\";\n\t}", "@Override\n\tpublic String getOSGiServiceIdentifier() {\n\t\treturn WFMS_Position_AuditLocalService.class.getName();\n\t}", "@Override\n\tpublic java.lang.String getBeanIdentifier() {\n\t\treturn _esfResultLocalService.getBeanIdentifier();\n\t}", "public String getInstanceIdentifier();", "com.microsoft.schemas._2003._10.serialization.Guid xgetServiceId();", "@Override\n\tpublic java.lang.String getBeanIdentifier() {\n\t\treturn _kpiEntryLocalService.getBeanIdentifier();\n\t}", "@Override\n\tpublic String getOSGiServiceIdentifier() {\n\t\treturn _participationLocalService.getOSGiServiceIdentifier();\n\t}", "ServiceEntity getService();", "public String getServiceInstanceId(GrpcOperation operation) {\n var serviceInstance =\n (ServiceInstance) operation.getRequiredProperty(OperationProperties.AAI_SERVICE,\n \"Target service instance\");\n return serviceInstance.getServiceInstanceId();\n }", "@Override\n\tpublic java.lang.String getBeanIdentifier() {\n\t\treturn _surveyLocalService.getBeanIdentifier();\n\t}", "public abstract String getApplicationId();", "@Override\r\n\tpublic sn.ucad.master.assurance.bo.Service findServiceById(int Idservice) {\n\t\treturn serviceRepository.findOne(Idservice);\r\n\t}", "@Override\n\tpublic String getOSGiServiceIdentifier() {\n\t\treturn MonthlyTradingLocalService.class.getName();\n\t}", "@Import(\"id\")\n\tint getId();", "private static void mapDbAsstIDs()\r\n {\r\n if (dbIdMap == null) {\r\n dbIdMap = new HashMap<String, Integer>();\r\n dbIdMap.put(\"repair\", 1);\r\n dbIdMap.put(\"fuel\", 2);\r\n dbIdMap.put(\"tuition\", 3);\r\n dbIdMap.put(\"clothing\", 4);\r\n dbIdMap.put(\"registration\", 5);\r\n dbIdMap.put(\"utilities\", 21);\r\n }\r\n }", "@Override\n public java.lang.String getBeanIdentifier() {\n return _muQuxianQujianLocalService.getBeanIdentifier();\n }", "public interface IGeneratorIdService {\n /**\n * @return \"unique\" long id\n */\n Long generateId();\n}", "@Query(\"SELECT d.idDatasetSchema from DatasetValue d where id=?1\")\n String findIdDatasetSchemaById(Long datasetId);", "int getServiceNum();", "public AppID getIdentifier () ;", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getConnectionId();", "java.lang.String getConnectionId();", "java.lang.String getConnectionId();", "@Id\n\t@Column(name = \"SERV_PROV_CODE\")\n\t@AccelaGenerator(env = Context.AGENCY_CODE)\n\tpublic String getServiceProviderCode()\n\t{\n\t\treturn serviceProviderCode;\n\t}", "@EntityProperty\npublic interface DoubanIdentifier {\n\n /**\n * Returns the identifier on douban.\n *\n * @return the identifier\n */\n Long getDbId();\n}", "public String getRepositoryDatabaseDriver(){\n \t\treturn getProperty(\"org.sagebionetworks.id.generator.database.driver\");\n \t}", "public java.lang.String getBeanIdentifier();", "public String toString() {\n return getServiceId();\n }", "public static java.lang.String getBeanIdentifier() {\n return getService().getBeanIdentifier();\n }", "public static java.lang.String getBeanIdentifier() {\n return getService().getBeanIdentifier();\n }", "public static java.lang.String getBeanIdentifier() {\n return getService().getBeanIdentifier();\n }", "public static java.lang.String getBeanIdentifier() {\n return getService().getBeanIdentifier();\n }", "public static java.lang.String getBeanIdentifier() {\n return getService().getBeanIdentifier();\n }" ]
[ "0.6914415", "0.6911271", "0.6883866", "0.6878061", "0.66054523", "0.64722407", "0.64449316", "0.6439221", "0.6425642", "0.635075", "0.6331459", "0.62984914", "0.62942064", "0.62872434", "0.62713283", "0.62102246", "0.62066317", "0.6200577", "0.6181303", "0.6170488", "0.616179", "0.60871065", "0.6038007", "0.60129315", "0.59953374", "0.59834", "0.59669226", "0.588617", "0.58410066", "0.5805351", "0.5749541", "0.57080877", "0.5705794", "0.5690529", "0.569011", "0.568774", "0.5675575", "0.5656384", "0.5656384", "0.5656384", "0.56149113", "0.5598208", "0.55921406", "0.55839247", "0.55825126", "0.5565562", "0.55643237", "0.55591476", "0.55535215", "0.5549909", "0.55472887", "0.5532364", "0.5529805", "0.5523675", "0.5480349", "0.5470934", "0.5454455", "0.54528093", "0.54382235", "0.5434451", "0.5431487", "0.54156405", "0.541129", "0.5408798", "0.5394917", "0.5389827", "0.5384191", "0.5384105", "0.53835", "0.5379852", "0.5379852", "0.5379852", "0.5379852", "0.5379852", "0.5379852", "0.5379852", "0.5379852", "0.5379852", "0.5379852", "0.5379852", "0.5379852", "0.5379852", "0.5379852", "0.5379852", "0.5379852", "0.5379852", "0.5379852", "0.5379852", "0.53746915", "0.53746915", "0.53746915", "0.5371256", "0.5369721", "0.536526", "0.53603685", "0.53202575", "0.53180665", "0.53180665", "0.53180665", "0.53180665", "0.53180665" ]
0.0
-1
Created by islam on 16/07/17.
public interface ViewMain { void showProvince(List<String> data); void showCity(List<String> data, String params); void onBtnClick(String kotaasal, String kotatujuan, String weight, String courier); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "public final void mo51373a() {\n }", "private stendhal() {\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "private void poetries() {\n\n\t}", "public void mo38117a() {\n }", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "private void m50366E() {\n }", "private static void cajas() {\n\t\t\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "public void mo4359a() {\n }", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "protected boolean func_70814_o() { return true; }", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "private void kk12() {\n\n\t}", "@Override\n public int describeContents() { return 0; }", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\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\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n\tpublic void gravarBd() {\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}", "private void init() {\n\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 public void init() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void getExras() {\n }", "@Override\n protected void initialize() {\n\n \n }", "@Override\n protected void init() {\n }", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "public void method_4270() {}", "public void mo6081a() {\n }", "@Override\r\n\tpublic void init() {}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "private void strin() {\n\n\t}", "public void mo21877s() {\n }", "@Override\n void init() {\n }", "@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}", "private Rekenhulp()\n\t{\n\t}", "@Override\n public void init() {}", "public abstract void mo70713b();", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\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}", "protected void mo6255a() {\n }", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n protected void initialize() \n {\n \n }", "public final void mo91715d() {\n }", "public void mo12628c() {\n }", "@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}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "public void mo12930a() {\n }", "protected MetadataUGWD() {/* intentionally empty block */}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n public int retroceder() {\n return 0;\n }", "public void skystonePos4() {\n }", "public void m23075a() {\n }", "public void mo21779D() {\n }", "public void mo55254a() {\n }", "private void m50367F() {\n }", "private void init() {\n\n\n\n }", "@Override public int describeContents() { return 0; }", "public abstract void mo56925d();" ]
[ "0.5973054", "0.58644456", "0.5863176", "0.58327246", "0.5773075", "0.5727939", "0.5723183", "0.5723183", "0.5695492", "0.5638718", "0.5629558", "0.5614277", "0.560897", "0.5603554", "0.55881643", "0.55810905", "0.5577479", "0.5577326", "0.557038", "0.5567801", "0.55595636", "0.55494404", "0.5543104", "0.5537821", "0.5526601", "0.5516365", "0.55072856", "0.5500656", "0.54924643", "0.54880184", "0.54880184", "0.54880184", "0.54880184", "0.54880184", "0.5485015", "0.54623866", "0.5449939", "0.5437703", "0.5437703", "0.54347724", "0.54265064", "0.54265064", "0.54265064", "0.54265064", "0.54265064", "0.54265064", "0.54265064", "0.5394886", "0.5392022", "0.5392022", "0.5392022", "0.5392022", "0.5392022", "0.5392022", "0.5389207", "0.53844714", "0.5380391", "0.53775764", "0.53772205", "0.5375977", "0.5373097", "0.5370693", "0.53591186", "0.5356336", "0.5352241", "0.5352233", "0.5352233", "0.5352233", "0.53456074", "0.5341317", "0.53393686", "0.53355634", "0.53352636", "0.5333589", "0.5333589", "0.5333589", "0.5332724", "0.53303045", "0.53297544", "0.53297544", "0.5324302", "0.5323431", "0.53212506", "0.53191394", "0.53191394", "0.53191394", "0.53180367", "0.5313439", "0.5307151", "0.52919567", "0.52919567", "0.52917695", "0.5288384", "0.528493", "0.52742827", "0.5273595", "0.5264829", "0.5263926", "0.526386", "0.5262126", "0.5261729" ]
0.0
-1
Imports Constructor & Deconstructor
public Content(String directoryRoot) { JPanel panel = this; panel.setLayout(new BorderLayout()); contentTableModel = new ContentTableModel(directoryRoot); contentTableModel.addTableModelListener(this); contentTable = new JTable(contentTableModel); contentTableSorter = new TableRowSorter<ContentTableModel>(contentTableModel); contentTable.setRowSorter(contentTableSorter); // Note: Fix this so when an item is selected, it uses the Name and not // contentTableHider.hideColumn("System Type"); contentTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS); contentTable.getColumnModel().getColumn(0).setMaxWidth(25); contentTable.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent event) { if(event.getClickCount() == 2) { JTable table = (JTable) event.getSource(); int row = table.rowAtPoint(event.getPoint()); // int col = table.columnAtPoint(event.getPoint()); // contentTableModel.updatePath(table.getValueAt(row, // col).toString()); // Note: fix so it catches the column by name not index contentTableModel.updatePath(table.getValueAt(row, 2).toString(), false); } } }); JScrollPane scrollTable = new JScrollPane(contentTable); panel.add(scrollTable); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void __sep__Constructors__() {}", "private LOCFacade() {\r\n\r\n\t}", "private Instantiation(){}", "public ImportVo() {\r\n // nothing to do\r\n }", "private PropertiesLoader() {\r\n\t\t// not instantiable\r\n\t}", "public Import() {\n this(null, new Name(), null, null, false, false);\n }", "private SupplierLoaderUtil() {\n\t}", "private AcceleoLibrariesEclipseUtil() {\n \t\t// hides constructor\n \t}", "public TpImport(){\r\n\t\t\r\n\t}", "private ModuleLoader() {\r\n }", "private ClinicFileLoader() {\n\t}", "private SIModule(){}", "public Clade() {}", "Reproducible newInstance();", "private InstanceUtil() {\n }", "private OMUtil() { }", "protected DPlugin()\n\t{\n\t\t//Instantiate the DLogger object.\n\t\tlog \t\t = new DLogger();\n\t\t//Instantiate the DStorage object.\n\t\tstorageHandler = new DStorage();\n\t}", "private EagerlySinleton()\n\t{\n\t}", "public void init(){}", "protected abstract void construct();", "defaultConstructor(){}", "public ObjectUtils() {\n super();\n }", "private PluginUtils() {\n\t\t//\t\tthrow new IllegalAccessError(\"Don't instantiate me. I'm a utility class!\");\n\t}", "private ObjectFactory() { }", "protected void _init(){}", "private ModuleUtil()\n {\n }", "public void init() {}", "public void init() {}", "private FaceConversionUtil() {\n\n\t}", "private SingleObject(){\n }", "private MApi() {}", "private NaturePackage() {}", "private Utils() {}", "private Utils() {}", "private Utils() {}", "private Utils() {}", "private ClassUtil() {}", "public static void init() {}", "private SingletonObject() {\n\n\t}", "private SnapshotUtils() {\r\n\t}", "private JarUtils() {\n }", "private MetallicityUtils() {\n\t\t\n\t}", "private UtilityKlasse() {\n\n }", "private CompressionTools() {}", "private SerializationUtils() {\n\n }", "private SerializationUtils() {\n\t\tthrow new AssertionError();\n\t}", "private PluginsInternal() {}", "private SingleObject()\r\n {\r\n }", "private ClientLoader() {\r\n }", "private Topography()\n\t{\n\t\tthrow new IllegalStateException(\"This is an utility class, it can not be instantiated\");\n\t}", "private NativeLibraryLoader() {\n }", "private JacobUtils() {}", "public Activator() {\r\n\t}", "private GeoUtil()\n\t{\n\t}", "private MigrationInstantiationUtil() {\n\t\tthrow new IllegalAccessError();\n\t}", "private Utils() {\n\t}", "private Utils() {\n\t}", "public BasicLoader() {\n }", "public Importer() {\n this(new ImportOptions(), false, true);\n }", "private SolutionsPackage() {}", "private JarFileLoader() {\n }", "private MeshUtil() {}", "private SingleObject(){}", "public Libro() {\r\n }", "public void init() { }", "public void init() { }", "private Utils() {\n }", "private Utils() {\n }", "private Utils() {\n }", "private Utils() {\n }", "private Utils() {\n }", "private ZipUtils() {\n }", "private InterpreterDependencyChecks() {\r\n\t\t// Hides default constructor\r\n\t}", "void DefaultConstructor(){}", "public Utils() {}", "private PrefUtils() {\n }", "private PluginAPI() {\r\n\t\tsuper();\r\n\t}", "private Utils()\n {\n // Private constructor to prevent instantiation\n }", "public static void Init()\n {\n _compressor = new Compressor();\n }", "public void init() {\r\n\t\tlog.info(\"init()\");\r\n\t\tobjIncidencia = new IncidenciaSie();\r\n\t\tobjObsIncidencia = new ObservacionIncidenciaSie();\r\n\t\tobjCliente = new ClienteSie();\r\n\t\tobjTelefono = new TelefonoPersonaSie();\r\n\t}", "static void init() {}", "private WolUtil() {\n }", "private ATCres() {\r\n // prevent to instantiate this class\r\n }", "private RestUtil() {\n\t}", "public Constructor(){\n\t\t\n\t}", "private DBUtil() {\r\n\t}", "private Util() {\n }", "private Util() {\n }", "private BeanUtils() {\n\t\t\n\t}", "private Utility() {\n\t}", "private Util()\n {\n // Empty default ctor, defined to override access scope.\n }", "private BusquedaMaker() {\n\t\tinit();\n\t}", "public Destruir() {\r\n }", "private GmpLibInstance() {\n }", "private TetrisMain() {\r\n //ensure uninstantiability\r\n }", "private void init() {\n }", "public TopologyLib() {\n }", "private Infer() {\n\n }", "private LoadMethodMapper ()\n {}", "private SimpleRepository() {\n \t\t// private ct to disallow external object creation\n \t}", "private void init() {\n }" ]
[ "0.6494788", "0.64462966", "0.6384971", "0.6320132", "0.63007015", "0.62391806", "0.62387884", "0.6182355", "0.61295885", "0.611591", "0.6113473", "0.61105025", "0.6107368", "0.6064495", "0.5989336", "0.5982632", "0.5975876", "0.5969318", "0.59684634", "0.5963862", "0.5951269", "0.5929925", "0.592861", "0.59191835", "0.59156084", "0.59151137", "0.591074", "0.591074", "0.5908321", "0.5907683", "0.5906662", "0.5906314", "0.5890337", "0.5890337", "0.5890337", "0.5890337", "0.5886432", "0.58790874", "0.5877592", "0.5877367", "0.5862327", "0.5860859", "0.5858451", "0.5857424", "0.5850476", "0.5838323", "0.5835917", "0.5827162", "0.5826367", "0.58188593", "0.5816494", "0.5806614", "0.58059496", "0.58055985", "0.580143", "0.5800573", "0.5800573", "0.5794286", "0.5793435", "0.5777002", "0.57704645", "0.57664484", "0.575927", "0.5745105", "0.57351327", "0.57351327", "0.573303", "0.573303", "0.573303", "0.573303", "0.573303", "0.5730074", "0.5724367", "0.57230574", "0.5719374", "0.5717849", "0.57168734", "0.57141834", "0.5711611", "0.57072973", "0.57064426", "0.5704153", "0.57028437", "0.56983364", "0.5696653", "0.5692514", "0.5689243", "0.5689243", "0.568804", "0.5683677", "0.5678934", "0.56712", "0.56709373", "0.56655717", "0.5664171", "0.5648499", "0.56484914", "0.56437844", "0.5640308", "0.5637288", "0.5635463" ]
0.0
-1
Returns the mean of the 2D array mat
public static double mean(double[][] mat) { int counter = 0; double total = 0; for (int row = 0; row < mat.length; row++){ for (int column = 0; column < mat[0].length; column++){ total += mat[row][column]; } } return total/counter; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public MatOfDouble getMean()\r\n {\r\n \r\n MatOfDouble retVal = MatOfDouble.fromNativeAddr(getMean_0(nativeObj));\r\n \r\n return retVal;\r\n }", "public static double Average(int[][] matrix){\n double total = 0;\n double promedio =0;\n double divisor = 0;\n \n for(int i=0; i<matrix.length; i++){\n for (int j=0;j<matrix[i].length;j++ ) {\n \n total += matrix[i][j];\n } \n divisor = matrix[i].length * matrix.length; \n promedio = total / divisor; \n }\n \n return promedio;\n }", "public double mean()\n {\n double sum = 0.0;\n for(int t = 0; t<size; t++)\n sum += x[t];\n return sum/size;\n }", "public DMatrixRMaj getMean() {\n\t\treturn x;\n\t}", "public double arithmeticalMean(double[] arr) {\n return 0;\n }", "public double getMeanValuePixels() {\n\t\tdouble avg = 0;\n\n\t\tfor (int i = 0; i < width; i++) {\n\t\t\tfor (int j = 0; j < height; j++) {\n\t\t\t\tavg += this.image[i][j];\n\t\t\t}\n\t\t}\n\t\tavg /= this.getQtyPixels();\n\n\t\treturn avg;\n\t}", "public double mean() {\n double resultat = 0;\n for (int i = 0; i < tab.size(); i++) {\n for (int j = 0; j < tab.get(i).size(); j++) {\n resultat += Double.parseDouble(tab.get(i).get(j));\n }\n }\n resultat = (resultat / (tab.size() + tab.get(0).size() - 1));\n System.out.println(\"Mean colonne:\" + resultat);\n return resultat;\n }", "public static Matrix mean(Matrix m, boolean adjustment) {\n int rows_c = m.rows(), cols_c = m.cols(), den = rows_c;\n Matrix d;\n if (adjustment)\n den = den - 1;\n if (rows_c == 1) {\n return m;\n } else {\n d = MatrixFactory.getMatrix(1, cols_c, m);\n for (int col = 1; col <= cols_c; col++) {\n double sumCol = 0D;\n for (int row = 1; row <= rows_c; row++) {\n sumCol += m.get(row, col);\n }\n d.set(1, col, sumCol / den);\n }\n }\n return d;\n }", "public double mean(double data[]) {\r\n\t\tdouble mean = 0;\r\n\t\ttry {\r\n\t\t\tfor(int i=0;i<data.length;i++) {\r\n\t\t\t\tmean =mean+data[i];\r\n\t\t\t}\r\n\t\t\tmean = mean / data.length;\r\n\t\t}\r\n\t\tcatch(Exception e) {\r\n\t\t\tDataMaster.logger.warning(e.toString());\r\n\t\t\t//e.printStackTrace();\r\n\t\t}\r\n\t\treturn mean;\r\n\t}", "public double[] mean() {\n\t\tdouble[] mean = null;\n\t\tif(instances != null) {\n\t\t\tmean = new double[instances.get(0).length];\n\t\t\tfor(double[] instance : instances) {\n\t\t\t\tfor(int d=0; d<mean.length; d++) {\n\t\t\t\t\tmean[d] += instance[d];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdouble n = instances.size();\n\t\t\tfor(int d=0; d<mean.length; d++) {\n\t\t\t\tmean[d] /= n;\n\t\t\t}\n\t\t}\n\t\treturn mean;\n\t}", "public double mean() { \n return StdStats.mean(result);\n\n }", "double avg(){\n\t\tdouble sum = 0.0;\n\t\tfor(int i=0;i<num.length;i++)\n\t\t\tsum+=num[i].doubleValue();\n\t\treturn sum/num.length;\n\t}", "public final double getMean()\r\n\t{\r\n\t\treturn mean;\r\n\t}", "public double mean() {\r\n\t\treturn mean;\r\n\t}", "public double mean() {\n\t\tif (count() > 0) {\n\t\t\treturn _sum.get() / (double) count();\n\t\t}\n\t\treturn 0.0;\n\t}", "public double mean() {\n\t\treturn mean;\n\t}", "public double mean() {\n\t\treturn mean;\n\t}", "public double getMean() {\n return mean;\n }", "public double[] compute(Matrix matrix) {\r\n return this.compute(matrix, new RowReduce.Mean().compute(matrix));\r\n }", "public static double findMean(ArrayList<Integer> arr) {\n\t\tint length = arr.size();\n\t\tint sum = 0;\n\t\tfor(int i : arr) { sum += i; }\n\t\treturn (double)sum/length;\n\t}", "public double mean() {\n return mean;\n }", "public double mean() {\n return StdStats.mean(stats);\r\n }", "public static double getAverage(double[][] array)\r\n\t{\r\n\t\tint count = 0;\r\n\t\tList<Double> lineSumList = new ArrayList<Double>();\r\n\t\tfor( int i = 0; i < array.length; i++ ) {\r\n\t\t\tdouble lineSum = Σ(array[i]);\r\n\t\t\tlineSumList.add(lineSum);\r\n\t\t\tcount += array[i].length;\r\n\t\t}\r\n\t\tdouble sum = Σ(lineSumList);\r\n\t\t\r\n\t\tif (sum == 0 || array.length == 0)\r\n\t\t\treturn 0;\r\n\t\treturn sum / count;\r\n\t}", "public Double getMean() {\n return mean;\n }", "public double mean() {\n\t\tint n = this.getAttCount();\n\t\tif (n == 0) return Constants.UNUSED;\n\t\t\n\t\tdouble sum = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tdouble v = this.getValueAsReal(i);\n\t\t\tsum += v;\n\t\t}\n\t\t\n\t\treturn sum / (double)n;\n\t}", "public double[] compute(Matrix matrix, double[] mean) {\r\n \tThrow.when().isNull(() -> matrix, () -> \"No matrix to compute.\");\r\n if(matrix.getRowCount() == 0){\r\n return new double[0];\r\n }\r\n \r\n double[] var = this.serial(matrix, 0, matrix.getRowCount(), mean);\r\n for(int i = 0; i < var.length; i++){\r\n var[i] /= matrix.getRowCount();\r\n }\r\n return var;\r\n }", "public T mean();", "public double average(){\n double avg = 0;\n double sum = 0;\n for (T t : arr) {\n // sum += t.doubleValue();\n }\n\n return sum / arr.length;\n }", "public double getMean(){\n\t\treturn (double)sampleSize * type1Size / populationSize;\n\t}", "public double getAverage(){\n return getTotal()/array.length;\n }", "public double mean() {\n return mu;\n }", "public static int[][] average(int[][] pixels){\r\n\t\t\t\r\n\t\t\tint height = pixels.length;\r\n\t\t\tint width = pixels[0].length;\r\n\t\t\t\r\n\t\t\t//Apply Average Filter\r\n\t for (int v = 1; v < height; v++) {\r\n\t for (int u = 1; u < width; u++) {\r\n\t \r\n\t int sum = 0;\r\n\t for (int j = -1; j <=1; j++) {\r\n\t for (int i = -1; i <= 1; i++) {\r\n\t if((u + (j) >= 0 && v + (i) >= 0 && u+(j) < width && v + (i) < height)){\r\n\t \tint p = pixels[v+(i)][u+(j)];\r\n\t \tsum = sum + p;\r\n\t }\r\n\t }\r\n\t }\r\n\r\n\t int q = (int) (sum /9);\r\n\t aResult[v][u] = q;\r\n\t }\r\n\t }\r\n\t return aResult;\r\n\t\t}", "public double mean() {\n\t\treturn StdStats.mean(results); \n\t}", "public double getMean(){\n\t\treturn Math.exp(location + scale * scale / 2);\n\t}", "public double average(){\r\n\t\t//create variable to hold the values\r\n\t\tdouble average = 0;\r\n\t\t\r\n\t\tfor (int i = 0; i < this.data.length; i++){\r\n\t\t\t//add current index\r\n\t\t\taverage += this.data[i];\r\n\t\t\t}\r\n\t\treturn (average/this.data.length);\r\n\t}", "public double mean()\n {\n return StdStats.mean(open);\n// return StdStats.sum(open) / count;\n }", "public float getMean() {\r\n int sum = getSum(rbt.root);\r\n float mean = sum / rbt.size();\r\n return mean;\r\n }", "public double averageOfArray() {\n double sum = 0;\n double average = 0;\n int i;\n for (i = 0; i < sirDeLa1La100.length; i++) {\n sum = sum + sirDeLa1La100[i];\n }\n average = sum / sirDeLa1La100.length;\n return average;\n }", "public double cariMean(int[] mean) {\n\t\tint n = mean.length;\n\t\tdouble mea = 0.0;\n\t\tdouble jumlah = 0;\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tjumlah = jumlah + mean[i];\n\t\t}\n\t\tmea = jumlah / n;\n\t\treturn mea;\n\t}", "private static double meanVal(double[] arrayOfSamples){\n\t\tdouble total = 0;\n\t\t for (double i :arrayOfSamples){\n\t\t \ttotal += i;\n\t\t }\n\t return total/arrayOfSamples.length;\n\t}", "public double mean() {\n return StdStats.mean(results);\n }", "public double geoMean() {\n\t\tint product = 1;\n\t\tfor (Animal a : animals) {\n\t\t\tproduct *= a.getSize();\n\t\t}\n\t\treturn Math.pow(product, 1.0 / animals.size());\n\t}", "public static double meanVal(int[] sample){\n double total = 0;\n for (int i = 0; i < sample.length; i++){\n total = total + sample[i];\n }\n double mean = total/sample.length;\n return mean;\n }", "public double getMean() throws IMRException {\n\n\t\tString imt = im.getName();\n\t\tif (!imt.equals(MMI_Param.NAME)) {\n\t\t\tupdateCoefficients();\n\t\t\tdouble b_mean = getRockMean();\n\t\t\tif (imt.equals(PGA_Param.NAME)) {\n\t\t\t\treturn b_mean + Math.log(getAmpFactor(im.getName(), b_mean));\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn b_mean + Math.log(getAmpFactor(im.getName()));\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\treturn Math.log(getMMI()); // return the log for now (until I figure a better way)\n\t\t}\n\n\t}", "public double mean() {\n double total = 0;\n for (int i = 0; i < sites.length; i++) {\n total += sites[i];\n }\n sampleMean = total / size / times;\n return sampleMean;\n }", "private double[] mean(Population pop) {\n double[] value = new double[pop.getIndividual(0).getNumGenes()];\n //for all individuals\n Iterator<Individual> it = pop.getIterator();\n while (it.hasNext()) {\n Individual ind = it.next();\n //sum the value of the gene\n for (int i = 0; i < value.length; i++) {\n value[i] += ind.getGeneValue(i);\n }\n }\n //divide by the number of individuals\n double factor = 1.0 / pop.getNumGenotypes();\n for (int i = 0; i < value.length; i++) {\n value[i] *=factor;\n }\n return value;\n }", "public double average()\n\t{\n\t\tif (arraySize > 0)\n\t\t{\n\t\t\tdouble sum = this.sum();\n\t\t\treturn sum / arraySize;\n\t\t}\n\t\tSystem.out.println(\"Syntax error, array is empty.\");\n\t\treturn -1;\n\t}", "public static double getAverage(int arr[][], int row) {\t// 算陣列所有數平均值\n\t\t/* Overloading Method */\n\t\tint sum = 0, count = 0;\n\t\tdouble result;\n\t\t\t\n\t\t\tfor (int j = 0; j < arr[row].length; j++) {\n\t\t\t\tsum += arr[row][j];\n\t\t\t\tcount++;\n\t\t\t}\n\t\tresult = (double) sum / count;\n\t\treturn result;\n\t}", "public static Integer[][] averager(Integer[][] matrixIn) {\n\t\tInteger[][] extendedMatrixInteger = expandMatrix(matrixIn);\n\t\tInteger[][] resultIntegers = new Integer[matrixIn.length][matrixIn[0].length];\n\t\tfor (int i = 0; i < resultIntegers.length; i++) {\n\t\t\tfor (int j = 0; j < resultIntegers[0].length; j++) {\n\t\t\t\tresultIntegers[i][j] = pointAverage(i + 1, j + 1, extendedMatrixInteger);\n\t\t\t}\n\t\t}\n\t\treturn resultIntegers;\n\t}", "private double[] getMeanCenter(){\n double[] meanXY = new double[2];\n float[] trans = getTranslationVector(center.getX(),center.getY(),BITMAP_SIZE,BITMAP_SIZE,CONSTANT);\n // Plot points\n for (MeasurementService.DataPoint p: list) {\n meanXY[0] += (p.getX()*CONSTANT)+trans[0];\n meanXY[1] += (p.getY()*CONSTANT)+trans[1];\n }\n\n meanXY[0] = meanXY[0] / list.size();\n meanXY[1] = meanXY[1] / list.size();\n return meanXY;\n }", "public static double rootMeanSquare( double[] orig, double[] est ) {\r\n if ((orig == null) || (orig.length == 0) || (est == null) || \r\n (est.length == 0) || (orig.length != est.length)) {\r\n return -1;\r\n }\r\n int len = orig.length;\r\n double rms = 0.0;\r\n for (int i = 0; i < len; i++) {\r\n rms += Math.pow((orig[i]-est[i]), 2);\r\n }\r\n return Math.sqrt(rms / len);\r\n }", "public double getMeanSquare() {\n return sumQ / count;\n }", "private int getMean(int[] times) {\n\n\t\t//Initialise mean and sum to 0\n\t\tint mean = 0;\n\t\tint sum = 0;\n\n\t\t//Loop through all the times\n\t\tfor (int i = 0; i < times.length; i++) {\n\n\t\t\t//Add to the sum\n\t\t\tsum += times[i];\n\t\t}\n\n\t\t//Calculate and return the mean\n\t\tmean = sum/times.length;\n\t\treturn mean;\n\t}", "public double mean() {\n return StdStats.mean(perThreshold);\n }", "public double calcAvg() {\n\t\treturn (double)calcSum() / data.size();\n }", "public static Double[][] operationAvgPooling(Double[][] matrix, int w, int h) {\n int i, j;\n Double[][] output = new Double[i = matrix.length - h + 1][j = matrix[0].length - w + 1];\n for (int y = 0; y < i; y = y + 1) {\n for (int x = 0; x < j; x = x + 1) {\n double avg = 0;\n for (int yy = 0; yy < h; yy++) {\n for (int xx = 0; xx < w; xx++) {\n double l = matrix[y + yy][x + xx];\n avg += l;\n }\n }\n output[y][x] = avg / (h * w);\n }\n }\n return output;\n }", "public static double getAverage(int[][] numbers) {\n int totalNumberOfElements = 10; // (2 rows * 5 column)\n return getTotal(numbers) / totalNumberOfElements;\n }", "public static float getMean(float[] weatherArray){\n float mean = getTotal(weatherArray)/weatherArray.length;\n return mean;\n }", "public double varianceOfMean() {\n\t\treturn variance() * getWeight();\n\t}", "public Double computeAverage(){\n\t\tdouble total = 0; //double used to keep total value of elements in arr to determine average\n\t\t\n\t\tfor(int i = 0; i < arr.length; i++)//loop through array and add the total\n\t\t{\n\t\t\ttotal += arr[i].doubleValue(); //add current value of element in arr to total's value\n\t\t}\n\t\t\n\t\tDouble result = total/arr.length; //returns the average as a Double\n\t\t\n\t\treturn result;\n\t}", "public double getXMean() {\n\t\treturn xStats.mean();\n\t}", "public double mean(){\n return StdStats.mean(percentage);\n }", "@Override\n\tpublic double mean() {\n\t\treturn 0;\n\t}", "public double getAverage(){\n double total = 0;\n for(double s : scores)total += s;\n return total/scores.length;\n }", "public double mean() {\n\t\treturn StdStats.mean(threshold);\n\t}", "public static double avg(double[] array) {\r\n\t\tdouble ret = sum(array);\r\n\t\treturn ret / array.length;\r\n\t}", "public double mean() {\n/* 179 */ Preconditions.checkState((this.count != 0L));\n/* 180 */ return this.mean;\n/* */ }", "public double mean() {\n return StdStats.mean(thresholds);\n }", "public double mean() {\n return StdStats.mean(thresholds);\n }", "double average() { // used double b/c I want decimal places\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tsum = sum + array[i];\n\t\t}\n\t\tdouble average = (double) sum / array.length;\n\t\treturn average;\n\n\t}", "public double sampleVarianceOfMean() {\n\t\treturn sampleVariance() * getWeight();\n\t}", "public double getMeanAnamoly() {\n return meanAnamoly;\n }", "public static Integer pointAverage(int i, int j, Integer[][] matrix) {\n\t\tassert(i > 0 && i < matrix.length && j > 0 && j < matrix[0].length);\n\t\tint sum = 0;\n\t\tfor (int k = -1; k < 2; k++) {\n\t\t\tfor (int l = -1; l < 2; l++) {\n\t\t\t\tsum += matrix[i + k][j + l];\n\t\t\t}\n\t\t}\n\t\treturn (Integer)(int)Math.round((double)sum / 9);\n\t}", "public static double mean(double[] x){\n\n //Declares and intializes mean and total to 0;\n double mean = 0;\n double total = 0;\n\n //Takes the total of all the numbers in every index\n for(int i = 0; i < x.length; i++){\n total += x[i];\n }\n //Divides total by 10\n mean = total / 10;\n\n //returns mean\n return mean;\n\n }", "public static float[] returnMeanArray (float[] weatherArray){\n float[] meanArray = new float[12];\n for (int i = 0; i < 12; i++){\n meanArray[i] = weatherArray[i]/30;\n }\n return meanArray;\n }", "public void findAvg()\n {\n for(int i = 0; i <= scores.length-1; i++)\n {\n for (int j = 0; j <= scores[0].length-1; j++)\n {\n total += scores[i][j];\n }\n }\n System.out.println(\"The class average test score is \" + \n total/24 + \".\");\n }", "public double average() {\n return average(0.0);\n }", "public static double average(double[] array){\n double sum = 0;\n for (int i = 0; i < array.length; i++) {\n sum += array[i];\n }\n return sum/array.length;\n }", "public double mean (List<? extends Number> a){\n\t\tint sum = sum(a);\n\t\tdouble mean = 0;\n\t\tmean = sum / (a.size() * 1.0);\n\t\treturn mean;\n\t}", "public double getAverage(){\r\n\t\tdouble sum=0;\r\n\t\tfor(Iterator<T> it=this.iterator();it.hasNext();){\r\n\t\t\tsum+=it.next().doubleValue();\r\n\t\t}\r\n\t\treturn sum/this.size();\r\n\t}", "public String getMean()\n {\n return mean;\n }", "public int average()\n {\n int average = 0;\n int sum = 0;\n\n for ( int index = 0; index < data.length; index++ )\n {\n sum = sum + data[index];\n }\n average = sum / data.length;\n\n return average;\n }", "public double mean() {\n return StdStats.mean(fraction);\n }", "public static Double[][] operationAvgPooling(Double[][] matrix, int w, int h, int s) {\n if (s < 1) s = 1;\n int fSizeY = matrix.length;\n int kSizeY = h;\n int fSizeX = matrix[0].length;\n int kSizeX = w;\n int p = 0;\n int i, j;\n Double[][] output = new Double[i = ((matrix.length - h) / s) + 1][j = ((matrix[0].length - w) / s) + 1];\n for (int y = 0; y < i; y = y + 1) {\n for (int x = 0; x < j; x = x + 1) {\n double avg = 0;\n for (int yy = 0; yy < h; yy++) {\n for (int xx = 0; xx < w; xx++) {\n double l = matrix[y + yy][x + xx];\n avg += l;\n }\n }\n output[y][x] = avg / (h * w);\n }\n }\n return output;\n }", "private Double getMean(Double[] values) {\n double sum = 0;\n int count = 0;\n for (Double d: values) {\n if (d != null) {\n sum += d;\n ++count;\n }\n }\n return count == 0 ? null : (sum / count);\n }", "public double mean() {\n\t\tdouble totalPercolationThershold = 0d;\n\t\tfor(double openedSite : openedSites){\n\t\t\ttotalPercolationThershold+= (double)(openedSite);\n\t\t}\n\t\treturn (totalPercolationThershold/trails);\n\t}", "double average();", "@Override\n\tpublic double getMean() {\n\t\treturn 1/this.lambda;\n\t}", "@Override\n public Double average() {\n return (sum() / (double) count());\n }", "public static double geoMean(AnimalPack animals) {\n\t\tint product = 1;\n\t\tfor (Animal a : animals.getAnimals()) {\n\t\t\tproduct *= a.getSize();\n\t\t}\n\t\treturn Math.pow(product, 1.0 / animals.getAnimals().size());\n\t}", "public double getAverage()\n {\n return getSum() / 2.0;\n }", "public int[] mean_thresh(int[] src, int width, int height, int size,\n int con) {\n\n i_w = width;\n i_h = height;\n src_1d = new int[i_w * i_h];\n dest_1d = new int[i_w * i_h];\n int mean = 0;\n int count = 0;\n src_1d = src;\n int[][] tmp_2d = new int[i_w][i_h];\n\n //First convert input array from 1_d to 2_d for ease of processing\n for (int i = 0; i < i_w; i++) {\n for (int j = 0; j < i_h; j++) {\n tmp_2d[i][j] = src_1d[i + (j * i_w)] & 0x000000ff;\n }\n }\n\n final int HALF_SIZE = size / 2;\n //Now find the sum of values in the size X size neigbourhood\n for (int j = 0; j < i_h; j++) {\n for (int i = 0; i < i_w; i++) {\n mean = 0;\n count = 0;\n //Check the local neighbourhood\n for (int k = 0; k < size; k++) {\n for (int l = 0; l < size; l++) {\n\n int x = i - HALF_SIZE + k;\n int y = j - HALF_SIZE + l;\n //If out of bounds then ignore pixel\n if (x >= 0 && x < i_w && y >= 0 && y < i_h) {\n mean = mean + tmp_2d[x][y];\n count++;\n }\n }\n }\n //Find the mean value\n mean = (mean / count) - con;\n\n //Threshold below the mean\n if (tmp_2d[i][j] > mean) {\n dest_1d[i + (j * i_w)] = 0xffffffff;\n } else {\n dest_1d[i + (j * i_w)] = 0xff000000;\n }\n }\n }\n return dest_1d;\n }", "public double mean() {\n return StdStats.mean(this.openSites);\n }", "public double mean() {\n return StdStats.mean(openSites) / times;\n }", "static double average(double[] data){\n\n // Initializing total placeholder \n double total = 0;\n\n // Traversing data array and adding to total sum\n for (double d : data) {\n total += d;\n }\n\n // Computing average\n double average = (double) total / data.length;\n\n return average;\n }", "private float calculateMean()\n { \n int numberEmployees = employees.size();\n float total = 0, meanGrossPay = 0;\n // Create an array of all gross pays\n float[] allGrossPay = new float[numberEmployees];\n \n // Call method to return an array of float containing all gross pays\n allGrossPay = calculateAllGrossPay();\n // Find total gross pay\n for (int i = 0; i < numberEmployees; i++)\n {\n total += allGrossPay[i];\n }\n // Find mean and return it\n if (numberEmployees > 0)\n {\n meanGrossPay = total/numberEmployees;\n \n }\n return meanGrossPay;\n }", "public static Double computeMean(Double[] values) {\n\t\treturn computeMean(values, 0, values.length);\n\t}", "public double getMean(final int d) {\n double sum = 0;\n int numPoints = getNumPoints();\n\n for (int i = 0; i < numPoints; i++) {\n sum += getComponent(i, d);\n }\n\n return sum / numPoints;\n }", "public static double average(int[] arr)\n {\n // your code goes here\n\t\tdouble sum =0;\n int i;\n for(i=0;i< arr.length;i++)\n {\n sum+=arr[i];\n }\n\t\t\n\t\treturn sum/arr.length; \n\t}", "@Override\n\tpublic int avg() {\n\t\treturn (this.sum()/3);\n\t}" ]
[ "0.7322773", "0.6842545", "0.6752364", "0.6729308", "0.6699791", "0.6678253", "0.63596123", "0.63198483", "0.6292366", "0.62346286", "0.6181745", "0.6166165", "0.6147872", "0.61448485", "0.6138068", "0.6112639", "0.6112639", "0.61049277", "0.6092421", "0.6091156", "0.60824984", "0.6075756", "0.6048963", "0.60441434", "0.6038644", "0.60313976", "0.60172", "0.6016563", "0.60028845", "0.59796435", "0.5967236", "0.59579754", "0.59541273", "0.5946227", "0.5933625", "0.59061426", "0.5893695", "0.58603656", "0.58432406", "0.58389693", "0.58377403", "0.5805517", "0.57902396", "0.5780251", "0.57697433", "0.57691926", "0.57634133", "0.57613933", "0.5759794", "0.5759155", "0.57510173", "0.5748415", "0.57179654", "0.57137203", "0.56988424", "0.5664984", "0.56543636", "0.5618899", "0.5612098", "0.5609127", "0.5606296", "0.55935884", "0.5586995", "0.558394", "0.5572364", "0.55715203", "0.5558349", "0.55501145", "0.55501145", "0.55448276", "0.55409944", "0.55361766", "0.5534811", "0.5512998", "0.55111945", "0.55108505", "0.55097055", "0.55060375", "0.5496569", "0.5483684", "0.548301", "0.54714006", "0.54701895", "0.54384285", "0.5432459", "0.5430224", "0.54187894", "0.54182553", "0.5406697", "0.5404767", "0.5400092", "0.5378906", "0.5374474", "0.53740203", "0.536672", "0.5352569", "0.5343787", "0.5329937", "0.5324663", "0.53176653" ]
0.82919097
0
Returns the median of the 2D array mat
public static double median(double[][] mat) { int count = 0; double med = 0; int size = mat.length * mat[0].length; double [] arr = new double [size]; for (int row = 0; row < mat.length; row++) { for (int column = 0; column < mat[0].length; column++) { arr[count] = mat[row][column]; count = count + 1; } } if (arr.length % 2 != 0) { int l1 = arr.length/2; med = arr[l1]; } else { int l2 = arr.length/2; int l3 = l2 + 1; med = (arr[l2-1] + arr[l3-1]) / 2; } return med; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public T median();", "private static double median(double[] m) {\n\t\tint middle = m.length/2; // subscript of middle element\n\t\tif (m.length%2 == 1) {\n\t\t\t// Odd number of elements -- return the middle one.\n\t\t\treturn m[middle];\n\t\t} else {\n\t\t\t// Even number -- return average of middle two\n\t\t\t// Must cast the numbers to double before dividing.\n\t\t\treturn (m[middle-1] + m[middle]) / 2.0;\n\t\t}\n\t}", "double median(double[] a){\n int length = a.length;\n double temp;\n\n //sort array\n for( int i = 0; i < length; i++){\n for (int j = i+1; j < length; j++){\n if (a[j] < a[i]) {\n temp = a[i];\n a[i] = a[j];\n a[j] = temp;\n }\n }\n }\n double median = (a[length/2] + a[(length/2)+1])/2;\n return median;\n }", "public static double median(int[] arr){\n System.out.println(\"array\" + Arrays.toString(arr));\n if (arr.length % 2 != 1){//if array even\n return arr[arr.length/2];\n }\n else{\n double right = arr[arr.length / 2];\n double left = arr[arr.length / 2 - 1];\n return (right+left)/2;\n }\n }", "public static double median(double[] arr) {\n if (arr == null) return Double.NaN;\n int l = arr.length;\n if (l == 0) return Double.NaN;\n Arrays.sort(arr);\n return arr[(int)Math.floor(l/2.0)] / 2 + arr[(int)Math.ceil(l/2.0)] / 2;\n }", "public static Double calculateMedian(Double[] arr)\n {\n\n // Sort our array\n Double[] sortedArr = arr;// bubbleSort(arr);\n\n double median = 0;\n\n // If our array's length is even, then we need to find the average of the two centered values\n if (arr.length % 2 == 0)\n {\n int indexA = (arr.length - 1) / 2;\n int indexB = arr.length / 2;\n\n median = (sortedArr[indexA] + sortedArr[indexB]) / 2;\n }\n // Else if our array's length is odd, then we simply find the value at the center index\n else\n {\n int index = (sortedArr.length - 1) / 2;\n median = sortedArr[ index ];\n }\n\n // Print the values of the sorted array\n// for (double v : sortedArr)\n// {\n// System.out.println(v);\n// }\n\n return median;\n }", "int getMedian () {\n if (fillLength == 0)\n throw new IndexOutOfBoundsException(\"An error occurred in getMedian method of StepDArray class\");\n return array[fillLength / 2];\n }", "public static void main(String[] args) {\n int[][] A = {\n {1, 3, 5},\n {2, 6, 9},\n {3, 6, 9}\n };\n\n System.out.println(findMedian(A));\n\n }", "public static double getMedian(int[] arr) {\n int n = arr.length;\n if (n % 2 == 0) {\n return (arr[n / 2 - 1] + arr[n / 2]) / 2.0;\n } else {\n return arr[n / 2];\n }\n }", "public int getMedianFromGray(Mat gray) {\r\n\r\n\t\tArrayList<Mat> listOfMat = new ArrayList<>();\r\n\t\tlistOfMat.add(gray);\r\n\t\tMatOfInt channels = new MatOfInt(0);\r\n\t\tMat mask = new Mat();\r\n\t\tMat hist = new Mat(256, 1, CvType.CV_8UC1);\r\n\t\tMatOfInt histSize = new MatOfInt(256);\r\n\t\tMatOfFloat ranges = new MatOfFloat(0, 256);\r\n\r\n\t\tImgproc.calcHist(listOfMat, channels, mask, hist, histSize, ranges);\r\n\r\n\t\tdouble t = gray.rows() * gray.cols() / 2;\r\n\t\tdouble total = 0;\r\n\t\tint med = -1;\r\n\t\tfor (int row = 0; row < hist.rows(); row++) {\r\n\t\t\t\r\n\t\t\tdouble val = hist.get(row, 0)[0];\r\n\t\t\tif ((total <= t) && (total + val >= t)) {\r\n\t\t\t\t\r\n\t\t\t\tmed = row;\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\ttotal += val;\r\n\t\t}\r\n\t\treturn med;\r\n\t}", "public static int median(int[] arr) {\n int middle = arr.length / 2;\n int median = 0;\n if (arr.length % 2 == 1)\n median = arr[middle];\n else\n median = (arr[middle - 1] + arr[middle]) / 2;\n return median;\n }", "public double cariMedian(int[] median) {\n\t\tArray2 arr = new Array2();\n\t\tint[] cek = arr.bubleShort(median);\n\t\tint p = median.length;\n\t\tdouble me = 0.0;\n\n\t\tif (median.length % 2 == 1) {\n\t\t\tme = cek[p / 2];\n\t\t} else {\n\t\t\tme = ((double) (cek[p / 2] + cek[(p / 2) - 1])) / 2;\n\t\t}\n\t\treturn me;\n\t}", "public static int median(int[] A) {\n int rank = A.length / 2;\n if (A.length % 2 == 0) {\n rank--;\n }\n return quickSelect(A, rank);\n }", "public static double median(double[] a) {\n\t\tArrays.sort(a);\n\t\tif (a.length%2==1)\n\t\t\treturn a[a.length/2];\n\t\telse\n\t\t\treturn (a[a.length/2-1]+a[a.length/2])/2.0;\n\t}", "public static double getMedian(double[] data) {\n Objects.requireNonNull(data, \"The supplied array was null\");\n Arrays.sort(data);\n int size = data.length;\n double median = -1;\n if (size % 2 == 0) {//even\n int firstIndex = (size / 2) - 1;\n int secondIndex = firstIndex + 1;\n double firstValue = data[firstIndex];\n double secondValue = data[secondIndex];\n median = (firstValue + secondValue) / 2.0;\n } else {//odd\n int index = (int) Math.ceil(size / 2.0);\n median = data[index];\n }\n return median;\n }", "public static Mat acquireMedian(Mat[] buffert)\n {\n Mat average_image = new Mat(buffert[0].height(),buffert[0].width(), CvType.CV_8U);\n int l = 0;\n // Go through each pixel in in each image\n for(int i = 0; i < buffert[0].width();i++)\n for(int j = 0; j < buffert[0].height();j++)\n {\n int sum = 0;\n for(int k = 0; k < buffert.length;k++)\n {\n double[] value = buffert[k].get(j,i); //the value need to be stored in an array\n sum+=value[0]; //adds all the pixel values together at pixel position (i, j).\n }\n double[] average_value = {((sum)/(double)buffert.length)};\n average_image.put(j, i, average_value); // Put the calculated average pixel value in result image\n }\n return average_image;\n }", "public double cariMedian() {\n\t\tArray2 arr = new Array2();\n\t\tint[] cek = arr.bubleShort(Array3.arrayUmum);\n\t\tint p = Array3.arrayUmum.length;\n\t\tdouble me = 0.0;\n\n\t\tif (p % 2 == 1) {\n\t\t\tme = cek[p / 2];\n\t\t} else {\n\t\t\tme = ((double) (cek[p / 2] + cek[(p / 2) - 1])) / 2;\n\t\t}\n\t\treturn me;\n\t}", "public boolean areMedianIntensities();", "public static int findMedian(int[][] A) {\n\n if(A == null || A.length == 0) return -1;\n\n // find range : min and max values\n int min = Integer.MAX_VALUE;\n int max = Integer.MIN_VALUE;\n\n for (int i = 0; i < A.length; i++) {\n if(A[i][0] < min) min = A[i][0];\n if(A[i][A[i].length - 1] > max) max = A[i][A[i].length - 1];\n }\n\n // find target number of elements from which median val should be greater\n // M*N is number of element in Matrix\n int target = (A.length * A[0].length + 1) / 2;\n\n while (min < max) {\n int mid = min + (max - min) / 2;\n int count = 0;\n for (int i = 0; i < A.length; i++) {\n count += upperBound(A[i], mid);\n }\n if(count < target) min = mid + 1;\n else max = mid;\n }\n\n return min;\n\n }", "public int[] median_thresh(int[] src, int width, int height, int size,\n int con) {\n\n i_w = width;\n i_h = height;\n src_1d = new int[i_w * i_h];\n dest_1d = new int[i_w * i_h];\n int median = 0;\n int[] values = new int[size * size];\n int count = 0;\n src_1d = src;\n int[][] tmp_2d = new int[i_w][i_h];\n\n //First convert input array from 1_d to 2_d for ease of processing\n for (int i = 0; i < i_w; i++) {\n for (int j = 0; j < i_h; j++) {\n tmp_2d[i][j] = src_1d[i + (j * i_w)] & 0x000000ff;\n }\n }\n\n //Now find the values in the size X size neigbourhood\n for (int j = 0; j < i_h; j++) {\n for (int i = 0; i < i_w; i++) {\n median = 0;\n count = 0;\n values = new int[size * size];\n //Check the local neighbourhood\n for (int k = 0; k < size; k++) {\n for (int l = 0; l < size; l++) {\n try {\n values[count] = tmp_2d[(i - ((int) (size / 2)) + k)]\n [(j - ((int) (size / 2)) + l)];\n count++;\n }\n //If out of bounds then ignore pixel\n catch (ArrayIndexOutOfBoundsException e) {\n // TODO: eliminate this\n }\n }\n }\n //Find the median value\n\n //First Sort the array\n Arrays.sort(values);\n\n //Then select the median\n count = count / 2;\n median = values[count] - con;\n\n //Threshold below the median\n if (tmp_2d[i][j] >= median) {\n dest_1d[i + (j * i_w)] = 0xffffffff;\n } else {\n dest_1d[i + (j * i_w)] = 0xff000000;\n }\n }\n }\n return dest_1d;\n }", "private Color getMedianPixel(BufferedImage image){\n Color[] pixels = imageToArray(image);\n return orderStat.findColor(pixels, pixels.length/2);\n }", "public static double getMedian()\n {\n // add your code here\n if(s.size()==g.size()){\n return (double) ((s.peek()+g.peek())/2);\n }\n else if(s.size() > g.size()) {\n return (double) s.peek();\n }\n else {\n return (double) g.peek();\n }\n }", "@Override\r\n protected double getMedianDouble() {\r\n Grids_GridDouble g = getGrid();\r\n int scale = 20;\r\n double median = g.getNoDataValue(false);\r\n long n = getN();\r\n BigInteger nBI = BigInteger.valueOf(n);\r\n if (n > 0) {\r\n double[] array = toArrayNotIncludingNoDataValues();\r\n sort1(array, 0, array.length);\r\n BigInteger[] nDivideAndRemainder2 = nBI.divideAndRemainder(\r\n new BigInteger(\"2\"));\r\n if (nDivideAndRemainder2[1].compareTo(BigInteger.ZERO) == 0) {\r\n int index = nDivideAndRemainder2[0].intValue();\r\n //median = array[ index ];\r\n //median += array[ index - 1 ];\r\n //median /= 2.0d;\r\n //return median;\r\n BigDecimal medianBigDecimal = new BigDecimal(array[index - 1]);\r\n return (medianBigDecimal.add(new BigDecimal(array[index]))).\r\n divide(new BigDecimal(2.0d), scale, BigDecimal.ROUND_HALF_DOWN).doubleValue();\r\n //return ( medianBigDecimal.add( new BigDecimal( array[ index ] ) ) ).divide( new BigDecimal( 2.0d ), scale, BigDecimal.ROUND_HALF_EVEN ).doubleValue();\r\n } else {\r\n int index = nDivideAndRemainder2[0].intValue();\r\n return array[index];\r\n }\r\n } else {\r\n return median;\r\n }\r\n }", "public double findMedian(ArrayList<double[]> partition, int dim){\n\t\t\n\t\t// temporary hash set to store the different values in\n\t\tArrayList<Double> sortedValues = new ArrayList<Double>();\n\t\t\n\t\tfor(int i = 0; i < partition.size(); i++){\n\t\t\tsortedValues.add(partition.get(i)[dim]);\n\t\t}\n\t\t\n\t\t// sort the values in an ascending order\n\t\tCollections.sort(sortedValues);\n\t\t\n\t\t// calculate the median using the sorted array and under consideration \n\t\t// of the difference between uneven and even amount of numbers\n\t\tif(sortedValues.size() % 2 == 1){\n\t\t\treturn sortedValues.get(sortedValues.size() / 2);\n\t\t}else{\n\t\t\t// Calculating median if the number of values is even \n\t\t\treturn (sortedValues.get(sortedValues.size() / 2)\n\t\t\t+sortedValues.get((sortedValues.size() - 1) / 2)) / 2;\n\t\t}\n\t}", "public double findMedian() {\n int size=list.size();\n if(size % 2 ==1) return list.get(size/2);\n else{\n return ((double)list.get(size/2)+(double)list.get(size/2-1))/2;\n }\n }", "public static int medianPivot(int array[], int first, int last) {\n \n int mid = (last) / 2;\n\n int[] sortingArr = {array[first], array[mid], array[last]};\n Arrays.sort(sortingArr);\n\n //System.out.println(\"\\tMiddle of Arr at Index= \" + mid + \" : \" + array[mid]);\n int middleValue = sortingArr[1];\n\n //System.out.println(\"\\t\"+Arrays.toString(sortingArr));\n //Swap with the last for pivot\n \tint temp = array[last];\n \tarray[last] = middleValue;\n if (middleValue == array[first]) {\n array[first] = temp;\n } else if (middleValue == array[mid]) {\n array[mid] = temp;\n }\n return partition(array, first, last);\n }", "public double findMedian() {\n \treturn maxHeap.size() > minHeap.size() ? maxHeap.peek() : (maxHeap.peek() - minHeap.peek()) / 2.0; \n }", "public int findMedian(int[] array) {\r\n\t\tint i;\r\n\t\tint sumRight = 0;\r\n\t\tint sumLeft = 0;\r\n\t\tfloat differenceBetweenTheTwoSums = sum(array, 0, array.length);\r\n\t\tint index = 0;\r\n\t\tint medianIndex = 0;\r\n\t\tfloat absSubtraction = 0;\r\n\r\n\t\tfor (i = 0; i < array.length - 1; i++) {\r\n\t\t\tsumRight = sum(array, 0, index);\r\n\t\t\tsumLeft = sum(array, index + 1, array.length);\r\n\t\t\tabsSubtraction = Math.abs(sumLeft - sumRight);\r\n\t\t\tif (absSubtraction <= differenceBetweenTheTwoSums) {\r\n\t\t\t\tdifferenceBetweenTheTwoSums = absSubtraction;\r\n\t\t\t\tmedianIndex = index;\r\n\t\t\t}\r\n\t\t\tindex++;\r\n\t\t}\r\n\t\treturn medianIndex++;\r\n\t}", "public double findMedian() {\n\t\t\treturn minHeap.size() > maxHeap.size() ? minHeap.peek() : (minHeap.peek() + maxHeap.peek()) / 2.0d;\n\t\t}", "public Container getMedian(Boolean axis) {\n\t\tint Number = (this.size)/2 ;\n\t\tif (axis){\n\t\t\tthis.current = this.minx;\n\t\t\twhile (Number>0){\n\t\t\t\tthis.current=this.current.getNextX();\n\t\t\t\tNumber--;\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tthis.current = this.miny;\n\t\t\twhile (Number>0){\n\t\t\t\tthis.current=this.current.getNextY();\n\t\t\t\tNumber--;\n\t\t\t}\n\t\t}\n\t\treturn this.current;\n\t}", "public native MagickImage medianFilterImage(double radius)\n\t\t\tthrows MagickException;", "public static double median(double[] values)\n {\n int size = values.length;\n if (size < 1)\n return Double.NaN;\n double validationresult = validate(values);\n if (!Double.isFinite(validationresult))\n return validationresult;\n \n int middle = size / 2;\n if (size % 2 == 1)\n return values[middle];\n else\n return (values[middle - 1] + values[middle])/2;\n }", "static double[] runningMedian(int[] a) {\r\n int n = a.length;\r\n\r\n double[] medianArr = new double[n];\r\n int i = 0;\r\n\r\n // max-heap\r\n PriorityQueue<Integer> max = new PriorityQueue<Integer>(Collections.reverseOrder());\r\n \r\n // min-heap\r\n PriorityQueue<Integer> min = new PriorityQueue<Integer>();\r\n\r\n double median = 0.0;\r\n\r\n for(int j=0; j<n; j++) {\r\n int x = a[j];\r\n if(min.size() == max.size()) {\r\n if(x < median) {\r\n max.add(x);\r\n median = (double)max.peek();\r\n medianArr[i] = median;\r\n i += 1;\r\n } else {\r\n min.add(x);\r\n median = (double)min.peek();\r\n medianArr[i] = median;\r\n i += 1;\r\n }\r\n } else if (max.size() > min.size()) {\r\n if(x < median) {\r\n min.add(max.remove());\r\n max.add(x);\r\n } else {\r\n min.add(x);\r\n }\r\n median = (double)(max.peek() + min.peek())/2;\r\n medianArr[i] = median;\r\n i += 1;\r\n } else {\r\n if(x > median) {\r\n max.add(min.remove());\r\n min.add(x);\r\n } else {\r\n max.add(x);\r\n }\r\n median = (double)(max.peek() + min.peek())/2;\r\n medianArr[i] = median;\r\n i += 1;\r\n }\r\n }\r\n\r\n return medianArr;\r\n }", "private Double getMedian(List<Double> sortedDouble) {\n Double median;\n if (sortedDouble.size() % 2 != 0) {\n median = sortedDouble.get(sortedDouble.size() / 2);\n } else {\n median = (sortedDouble.get((sortedDouble.size() - 1) / 2) + sortedDouble.get((sortedDouble.size() / 2)));\n }\n return median;\n }", "public double findMedian() {\n int size = maxHeap.size() + minHeap.size();\n if (size ==0) {\n return Double.MIN_VALUE;\n }\n if (size%2 == 1) {\n return maxHeap.peek();\n } else {\n return (maxHeap.peek() + minHeap.peek())/2.0f;\n }\n }", "private static <AnyType extends Comparable<? super AnyType>> AnyType median3(AnyType[] a, int left, int right)\n {\n int center = (left + right) / 2;\n if(a[center].compareTo(a[left]) < 0)\n CommonFunc.swapReference(a, left, center);\n if(a[right].compareTo(a[left]) < 0)\n CommonFunc.swapReference(a, left, right);\n if(a[right].compareTo(a[center]) < 0)\n CommonFunc.swapReference(a, center, right);\n \n // Place pivot at position right - 1\n CommonFunc.swapReference(a, center, right - 1);\n return a[right - 1];\n }", "private void calcMedian(SimpleProtein.ProtChain chain) {\n\t\tList<List<Double>> falseValuesList = new LinkedList<>();\n\t\tList<List<Double>> trueValuesList = new LinkedList<>();\n\t\tList<List<Double>> allValuesList = new LinkedList<>();\n\t\t\n\t\tfor (int i = 0; i < chain.resIntensityValueMatrix.length; i++) {\n\t\t\tfalseValuesList.add(new LinkedList<>());\n\t\t\ttrueValuesList.add(new LinkedList<>());\n\t\t\tallValuesList.add(new LinkedList<>());\n\t\t\tfor (int j = 0; j < chain.resIntensityValueMatrix[i].length; j++) {\n\t\t\t\tif (chain.originalPositions[j] != i) {\n\t\t\t\t\tfalseValuesList.get(i).add(chain.resIntensityValueMatrix[i][j]);\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\ttrueValuesList.get(i).add(chain.resIntensityValueMatrix[i][j]);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tallValuesList.get(i).add(chain.resIntensityValueMatrix[i][j]);\n\t\t\t}\n\t\t\tCollections.sort(falseValuesList.get(i));\n\t\t\tCollections.sort(trueValuesList.get(i));\n\t\t\tCollections.sort(allValuesList.get(i));\n\t\t}\n\t\tdouble[] falseValuesMedian = new double[falseValuesList.size()];\n\t\tdouble[] trueValuesMedian = new double[trueValuesList.size()];\n\t\tdouble[] allValuesMedian = new double[allValuesList.size()];\n\t\t\n\t\t\n\t\tfor (int i = 0; i < falseValuesList.size(); i++) {\n\t\t\tif (falseValuesList.get(i).size() == 0) {\n\t\t\t\tfalseValuesMedian[i] = 0;\n\t\t\t} else {\n\t\t\t\tint middle = falseValuesList.get(i).size() / 2;\n\t\t\t\tif (falseValuesList.get(i).size() % 2 == 1) {\n\t\t\t\t\tfalseValuesMedian[i] = falseValuesList.get(i).get(middle);\n\t\t\t\t} else {\n\t\t\t\t\tfalseValuesMedian[i] = (falseValuesList.get(i).get(middle - 1) + falseValuesList.get(i).get(middle)) / 2.0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < allValuesList.size(); i++) {\n\t\t\tif (allValuesList.get(i).size() == 0) {\n\t\t\t\tallValuesMedian[i] = 0;\n\t\t\t} else {\n\t\t\t\tint middle = allValuesList.get(i).size() / 2;\n\t\t\t\tif (allValuesList.get(i).size() % 2 == 1) {\n\t\t\t\t\tallValuesMedian[i] = allValuesList.get(i).get(middle);\n\t\t\t\t} else {\n\t\t\t\t\tallValuesMedian[i] = (allValuesList.get(i).get(middle - 1) + allValuesList.get(i).get(middle)) / 2.0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < trueValuesList.size(); i++) {\n\t\t\tif (trueValuesList.get(i).size() == 0) {\n\t\t\t\ttrueValuesMedian[i] = 0;\n\t\t\t} else {\n\t\t\t\tint middle = trueValuesList.get(i).size() / 2;\n\t\t\t\tif (trueValuesList.get(i).size() % 2 == 1) {\n\t\t\t\t\ttrueValuesMedian[i] = trueValuesList.get(i).get(middle);\n\t\t\t\t} else {\n\t\t\t\t\ttrueValuesMedian[i] = (trueValuesList.get(i).get(middle - 1) + trueValuesList.get(i).get(middle)) / 2.0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tchain.medianTrue = trueValuesMedian;\n\t\tchain.medianFalse = falseValuesMedian;\n\t\tchain.allMedian = allValuesMedian;\n\t\t\n\t\tfor (int i = 0; i < chain.signalMaybe.length; i++) {\n\t\t\tchain.signalMaybe[i] = chain.medianTrue[i] - chain.medianFalse[i];\n\t\t}\n\t\t\n\t}", "public double getCurMedian(){\n\t\tdouble median; \n\t\tif(maxHeap.getHeapSize() == minHeap.getHeapSize()){\n\t\t\tmedian = 0.5*(maxHeap.getBestElement() + minHeap.getBestElement());\n\t\t}\n\t\telse if(maxHeap.getHeapSize() > minHeap.getHeapSize()){\n\t\t\tmedian = maxHeap.getBestElement();\n\t\t}\n\t\telse{\n\t\t\tmedian = minHeap.getBestElement();\n\t\t}\n\t\t\n\t\treturn median;\n\t}", "public double findMedian() {\n if (maxheap.size() == minheap.size()) {\n return (maxheap.peek() + minheap.peek()) * 0.5;\n } else {\n return maxheap.peek();\n }\n }", "private float calculateMedian()\n {\n int numberEmployees = employees.size();\n int position = 0; //kindex of where median is located\n float median = 0;\n \n // Create an array of all gross pays\n float[] allGrossPay = new float[numberEmployees];\n allGrossPay = calculateAllGrossPay();\n \n //Sort the array\n Arrays.sort(allGrossPay);\n // For even number of entries median is the mean of the two middle points\n if (numberEmployees % 2 == 0) \n {\n median = (allGrossPay[numberEmployees/2] + \n allGrossPay[numberEmployees/2 - 1])/2;\n }\n else\n {\n median = allGrossPay[numberEmployees/2];\n } \n return median;\n }", "public static void medianQuickSort(int arr[], int first, int last) {\n if (first >= last)\n return;\n\n if (first < last) {\n\n int pivot = medianPivot(arr, first, last);\n //System.out.println(pivot);\n QuickSort(arr, first, last);\n }\n }", "@Test\n public void testMedian() {\n System.out.println(\"median\");\n double[] values = new double[]{\n 8.927153515620000,\n 10.574811745900000,\n 8.894700141240000,\n 8.507551563150000,\n 9.014881630990000,\n 10.683879450300000,\n 10.142231294300000,\n 10.617826606000000,\n 10.387153749700000,\n 10.421390821500000,\n 10.415758910000000,\n 10.351636018900000,\n 8.875345257050000,\n 9.148679714420000,\n 10.349959416100000,\n 10.455234223700000,\n 10.295134872800000,\n 11.305933414200000,\n 10.511166224700000,\n 10.711717353900000,\n 10.212016243500000,\n 10.013806994600000,\n 10.474133712300000,\n 9.135694512270000,\n 9.755354878260000};\n\n double expResult = 10.3499594161;\n double result = Utilities.median(values);\n assertEquals(expResult, result, 0.0);\n\n }", "public double findMedian() {\n if (maxHeap.size() == 0) return 0;\n if (minHeap.size() == maxHeap.size())\n return (minHeap.peek() + maxHeap.peek()) / 2.0;\n else\n return maxHeap.peek();\n }", "public Double median() {\n if (minHeap.isEmpty() && maxHeap.isEmpty()) {\n return null;\n } else {\n if (minHeap.size() != maxHeap.size()) {\n return Double.valueOf(maxHeap.peek());\n } else {\n return Double.valueOf(minHeap.peek() + maxHeap.peek()) / 2;\n }\n }\n }", "@Test\n public void testMedian() {\n System.out.println(\"median\");\n ImageFilter instance = null;\n BufferedImage expResult = null;\n BufferedImage result = instance.median();\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "public static void main(String[] args) {\n\n\n int [][] array = {\n {1, 4, 3, 2, 5},\n {4, 5, 3, 2, 9},\n {4, 7, 8, 1, 4}};\n\n int sum = 0;\n int mean = 0;\n int median = 0;\n double variance = 0;\n double sdev = 0; //Standard deviation\n\n //Make 2d array into 1d array\n int [] list = new int [array.length * array[0].length];\n\n int listnum = 0;\n for (int i = 0; i < array.length; i++){\n for (int j = 0; j < array.length; j++){\n list[listnum++] = array [i][j];\n }\n }\n\n //This is used to find the SUM\n for (int i = 0; i < list.length; i++) {\n sum += list[i];\n }\n System.out.println(\"This is the sum: \" + sum);\n\n //MEAN\n mean = sum/list.length;\n System.out.println(\"Mean: \" + mean);\n\n //This is used to find the MEDIAN\n Arrays.sort(list);\n\n int middle = (list.length / 2);\n if (list.length % 2 == 0) {\n int medium1 = list[middle];\n int medium2 = list[middle - 1];\n median = (medium1 + medium2) / 2;\n } else {\n median = list[middle + 1];\n }\n System.out.println(\"The MEDIAN is: \" + median);\n\n\n //This is the mode\n int[] frequencies = new int[10]; // all zero\n for(int [] row : array){\n for(int val : row){\n frequencies[val]++;\n }\n }\n\n // scan for the largest value\n int largest = 0;\n int mode = -1;\n for (int i = 0; i < 10; ++i) {\n if (frequencies[i] > largest) {\n largest = frequencies[i];\n mode = i;\n }\n }System.out.println(\"Mode: \" + mode);\n\n\n\n //VARIANCE\n double temp = 0;\n for (double a : list) {\n temp += (a - mean) * (a - mean);\n }\n variance = temp / list.length;\n System.out.println(\"Variance:\" + variance);\n\n //Standard deviation\n sdev = Math.sqrt(variance);\n System.out.println(\"Standard Deviation: \" + sdev);\n }", "public static int medianOfThree(int[] arr, int left, int right) {\n int mid = (right + left) / 2;\n\n if (arr[right] < arr[left]) {\n swap(arr, left, right);\n }\n if (arr[mid] < arr[left]) {\n swap(arr, mid, left);\n }\n if (arr[right] < arr[mid]) {\n swap(arr, right, mid);\n }\n\n return mid;\n }", "public static double median(double[] mainArray2) {\r\n\t\t//finds the smallest number and moves it to the end of the array\r\n\t\tint min2 = 0;\r\n\t\tfor(int lessThan = 1; lessThan < mainArray2.length; lessThan ++) {\r\n\r\n\t\t\tif(mainArray2[lessThan]<mainArray2[min2]) {\r\n\t\t\t\tmin2 = lessThan;\r\n\t\t\t}\r\n\t\t}\r\n\t\tdouble replacement = mainArray2[0];\r\n\t\tmainArray2[0] = mainArray2[min2];\r\n\t\tmainArray2[min2] = replacement;\r\n\r\n\t\t//finds the biggest number and moves it to the end of the array\r\n\t\tint max2 = 0;\r\n\t\tfor(int greaterThan = 1; greaterThan < mainArray2.length; greaterThan ++) {\r\n\r\n\t\t\tif(mainArray2[greaterThan]>mainArray2[max2]) {\r\n\t\t\t\tmax2 = greaterThan;\r\n\t\t\t}\r\n\t\t}\r\n\t\tdouble replacement2 = mainArray2.length -1;\r\n\t\tmainArray2[mainArray2.length -1] = mainArray2[max2];\r\n\t\tmainArray2[max2] = replacement;\r\n\r\n\t\t//arranges the values from smallest to largest\r\n\t\tfor(int counter = 1; counter < mainArray2.length -1; counter++) {\r\n\t\t\tif (mainArray2[counter + 1] < mainArray2[counter]) {\r\n\t\t\t\tdouble mover = mainArray2[counter +1];\r\n\t\t\t\tmainArray2[counter + 1] = mainArray2[counter];\r\n\t\t\t\tmainArray2[counter] = mover;\r\n\t\t\t} \r\n\t\t}\r\n\r\n\t\t//determines the median of the array\r\n\t\tif (mainArray2.length%2 == 0) {\r\n\t\t\tdouble median = (mainArray2[mainArray2.length /2 - 1] + mainArray2[mainArray2.length /2]) / 2;\r\n\t\t\treturn median;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdouble median = mainArray2[mainArray2.length % 2 + 1];\r\n\t\t\treturn median;\r\n\t\t}\r\n\t}", "private static int partitionRandomMedian(double[] array, int p, int r) {\n\t\tint randomIndex[]= new int[3];\r\n\t\t\trandomIndex[0] = ThreadLocalRandom.current().nextInt(p, r + 1);\r\n\t\t\trandomIndex[1] = ThreadLocalRandom.current().nextInt(p, r + 1);\r\n\t\t\trandomIndex[2] = ThreadLocalRandom.current().nextInt(p, r + 1);\r\n\t\t\tArrays.sort(randomIndex);// SORTING THREE ELEMENTS IS CONSTANT TIME\r\n\t\t\tint median = (randomIndex[1]);\r\n\t\tcomplexityCount++;\r\n\t\tdouble temp = array[median];\r\n\t\tarray[median] = array[r];\r\n\t\tarray[r] = temp;\r\n\t\t//CALL TRADITIONAL PARTITION\r\n\t\treturn partition(array, p, r);\r\n\t}", "static double[] runningMedian(int[] a) {\n\n double[] doubles = new double[a.length];\n ArrayList<Integer> integers = new ArrayList<>();\n\n //Fila de prioridade\n PriorityQueue<Integer> maxHeap = new PriorityQueue<>(Collections.reverseOrder());\n PriorityQueue<Integer> minHeap = new PriorityQueue<>();\n\n double median = 0;\n\n for (int i = 0; i < a.length; i++) {\n if (a[i] <= median) {\n maxHeap.add(a[i]);\n } else {\n minHeap.add(a[i]);\n }\n\n if (minHeap.size() > maxHeap.size()+1) {\n maxHeap.add(minHeap.peek());\n minHeap.remove();\n }\n if (maxHeap.size() > minHeap.size()+1) {\n minHeap.add(maxHeap.peek());\n maxHeap.remove();\n }\n\n if (minHeap.size() == maxHeap.size()) {\n median = (maxHeap.peek() + minHeap.peek())/2.0;\n } else if(minHeap.size() > maxHeap.size()) {\n median = (double) minHeap.peek();\n } else if (minHeap.size() < maxHeap.size()) {\n median = (double) maxHeap.peek();\n }\n doubles[i] = median;\n }\n\n return doubles;\n }", "@SuppressWarnings(\"unchecked\")\r\n\tprivate static <E extends Comparable<? super E>> E median3(\r\n\t\t\tComparable<E>[] data, int left, int right) {\r\n\r\n\t\t// Put the left, middle and right values in their correct relative\r\n\t\t// positions\r\n\t\tint center = (left + right) / 2;\r\n\t\tif (data[left].compareTo((E) data[center]) > 0) {\r\n\t\t\tswap(data, left, center);\r\n\t\t}\r\n\t\tif (data[left].compareTo((E) data[right]) > 0) {\r\n\t\t\tswap(data, left, right);\r\n\t\t}\r\n\t\tif (data[center].compareTo((E) data[right]) > 0) {\r\n\t\t\tswap(data, center, right);\r\n\t\t}\r\n\r\n\t\t// Median is in the middle, put it at the right\r\n\t\tswap(data, center, right - 1);\r\n\t\treturn (E) data[right - 1];\r\n\t}", "public Set<String> median(List<Set<String>> inputData) {\n if (inputData == null || inputData.size() == 0) {\n return null; // Cannot do anything\n }\n Collections.sort(inputData, new Comparator<Set<String>>() {\n public int compare(Set<String> set1, Set<String> set2) {\n int size1 = set1.size();\n int size2 = set2.size();\n return size1 - size2;\n }\n });\n // Take the median\n int size = inputData.size();\n int index = size / 2;\n return inputData.get(index);\n }", "private int getMedian(int left, int right){\n int median = right - left + 1;\n median = (median + 1) / 2 - 1;\n return median + left;\n }", "public LeetCode_295_FindMedian() {\n largeQueue = new PriorityQueue<>();\n smallQueue = new PriorityQueue<>(new Comparator<Integer>() {\n @Override\n public int compare(Integer integer, Integer t1) {\n return t1 - integer;\n }\n });\n }", "void deleteMedian () {\n if (fillLength > 0) {\n for (int i = fillLength / 2; i < fillLength - 1; i++) {\n array[i] = array[i + 1];\n }\n array[fillLength - 1] = 0;\n fillLength--;\n }\n }", "public static double getMedian()\n {\n PriorityQueue<Integer> smallerHeap = (leftHeap.size() < rightHeap.size() ? leftHeap : rightHeap);\n PriorityQueue<Integer> biggerHeap = (rightHeap.size() > leftHeap.size()? rightHeap: leftHeap);\n\n if(smallerHeap.size() == biggerHeap.size())\n {\n return (double)((smallerHeap.peek() + biggerHeap.peek())/2.0);\n }\n \n return biggerHeap.peek();\n }", "public double[] medianSlidingWindow(int[] nums, int k) {\n Comparator<Integer> comparator = (a, b) -> nums[a] != nums[b] ? Integer.compare(nums[a], nums[b]) : a - b;\n \n minHeap = new TreeSet<>(comparator);\n \n maxHeap = new TreeSet<>(comparator.reversed());\n \n int n = nums.length;\n \n double output[] = new double[n - k + 1];\n \n int left = 0;\n \n //This works like a sliding window.\n //In each window we calculate the median using the above steps in comments\n for(int right = 0; right < n; right++){\n \n //Remove the indices of the element from the left as the window progresses\n if(right >= k){\n \n minHeap.remove(right - k);\n maxHeap.remove(right - k);\n }\n \n //Add the element to min heap first\n minHeap.add(right);\n \n //Remove the first element from the min heap and add that to maxHeap\n maxHeap.add(minHeap.pollFirst());\n \n //It will balance the sizes if maxHeap > minHeap\n balanceHeaps();\n \n if(right >= k - 1){\n \n output[left++] = getMedian(nums, k);\n } \n }\n \n return output;\n \n }", "private Integer chooseMedianPivot(Integer[] pivotChoices) {\n\t\tthis.qs.sort(pivotChoices);\n\t\tif ((pivotChoices.length % 2) == 0) {\n\t\t\treturn (pivotChoices[pivotChoices.length / 2 - 1]);\n\t\t} else {\n\t\t\treturn (pivotChoices[pivotChoices.length / 2]);\n\t\t}\n\t}", "private static int findMedian(int[] arr, int lo, int hi){\n\t\tfor(int i = lo + 1; i < hi; i++) {\n\t\t\tint temp = arr[i];\n\t\t\tint j = lo;\n\t\t\t\n\t\t\twhile((j >= lo) && (arr[j] > temp)) {\n\t\t\t\tarr[j+1] = arr[j];\n\t\t\t\tj--;\n\t\t\t}\n\t\t\tarr[j+1] = temp;\n\t\t}\n\t\t\n\t\tint median = (int)Math.ceil((hi - lo)/2);\n\t\treturn lo + median;\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\tprivate static <E extends Comparable<? super E>> E median3(\r\n\t\t\tComparable<E>[] data, int left, int right,\r\n\t\t\tComparator<Comparable<E>> comp) {\r\n\r\n\t\t// Put the left, middle and right values in their correct relative\r\n\t\t// positions\r\n\t\tint center = (left + right) / 2;\r\n\t\tif (comp.compare(data[left], data[center]) > 0) {\r\n\t\t\tswap(data, left, center);\r\n\t\t}\r\n\t\tif (comp.compare(data[left], data[right]) > 0) {\r\n\t\t\tswap(data, left, right);\r\n\t\t}\r\n\t\tif (comp.compare(data[center], data[right]) > 0) {\r\n\t\t\tswap(data, center, right);\r\n\t\t}\r\n\r\n\t\t// Median is in the middle, put it at the right\r\n\t\tswap(data, center, right - 1);\r\n\t\treturn (E) data[right - 1];\r\n\t}", "public void setMedianIntensities(boolean areMedians);", "static float getMedian(int ar1[], int ar2[], int n)\n\t{\n\t\t// If all elements of array 1 are smaller then\n\t\t // median is average of last element of ar1 and\n\t\t // first element of ar2\n\t\t if (ar1[n-1] < ar2[0])\n\t\t return (ar1[n-1]+ar2[0])/2;\n\n\t\t // If all elements of array 1 are smaller then\n\t\t // median is average of first element of ar1 and\n\t\t // last element of ar2\n\t\t if (ar2[n-1] < ar1[0])\n\t\t return (ar2[n-1]+ar1[0])/2;\n\n\t\t return getMedianRec(ar1, ar2, 0, n-1, n);\n\t}", "static float ver3Median(int a[], int aStart, int aEnd, int b[], int bStart, int bEnd) {\n\n\n if (aEnd == 0) return getMedian(b, bEnd);\n\n // If the smaller array has only one element\n if (aEnd == 1) {\n // Case 1: If the larger array also has one element,\n // simply call MO2()\n if (bEnd == 1) return getMedian(a[0], b[0]);\n\n // Case 2: If the larger array has odd number of elements,\n // then consider the middle 3 elements of larger array and\n // the only element of smaller array. Take few examples\n // like following\n // a = {9}, b[] = {5, 8, 10, 20, 30} and\n // a[] = {1}, b[] = {5, 8, 10, 20, 30}\n if ((bEnd - aStart) % 2 > 0)\n return getMedian(b[bEnd / 2], getMedian(a[0], b[bEnd / 2 - 1], b[bEnd / 2 + 1]));\n\n // Case 3: If the larger array has even number of element,\n // then median will be one of the following 3 elements\n // ... The middle two elements of larger array\n // ... The only element of smaller array\n return getMedian(b[bEnd / 2], b[bEnd / 2 - 1], a[0]);\n }\n\n // If the smaller array has two elements\n else if (aEnd == 2) {\n // Case 4: If the larger array also has two elements,\n // simply call MO4()\n if (bEnd == 2) return getMedian(a[aStart], a[aStart + 1], b[bStart], b[bStart + 1]);\n\n // Case 5: If the larger array has odd number of elements,\n // then median will be one of the following 3 elements\n // 1. Middle element of larger array\n // 2. Max of first element of smaller array and element\n // just before the middle in bigger array\n // 3. Min of second element of smaller array and element\n // just after the middle in bigger array\n //if ((bEnd & 1) == 1)\n if ((bEnd - aStart) % 2 > 0)\n return getMedian(b[bEnd / 2],\n max(a[0], b[bEnd / 2 - 1]),\n min(a[1], b[bEnd / 2 + 1])\n );\n\n // Case 6: If the larger array has even number of elements,\n // then median will be one of the following 4 elements\n // 1) & 2) The middle two elements of larger array\n // 3) Max of first element of smaller array and element\n // just before the first middle element in bigger array\n // 4. Min of second element of smaller array and element\n // just after the second middle in bigger array\n return getMedian(b[bEnd / 2],\n b[bEnd / 2 - 1],\n max(a[0], b[bEnd / 2 - 2]),\n min(a[1], b[bEnd / 2 + 1])\n );\n }\n\n int idxA = (aEnd - 1) / 2;\n int idxB = (bEnd - 1) / 2;\n\n Out.pln();\n Out.plnRange(\"a\", a, aStart, aEnd - 1, aStart + idxA);\n Out.plnRange(\"b\", b, bStart, bEnd - 1, bStart + idxB);\n Out.pln();\n\n if (a[aStart + idxA] <= b[bStart + idxB])\n return ver3Median(a, aStart + idxA, aEnd / 2 + 1, b, bStart, bEnd - idxA);\n else\n return ver3Median(a, aStart, aEnd / 2 + 1, b, bStart + idxA, bEnd - idxA);\n }", "public static Double median(List<Double> list) {\r\n if (list == null || list.size() == 0) {\r\n throw new Error(\"Mean of an empty list is undefined\");\r\n }\r\n int size = list.size();\r\n Collections.sort(list);\r\n double median = 0.0;\r\n if (size % 2 == 0) {\r\n median = (list.get(size / 2) + list.get((size / 2) - 1)) / 2.0;\r\n } else {\r\n median = list.get(size / 2);\r\n }\r\n return median;\r\n }", "private static int getMedian(ArrayList<Integer> inList) \n\t{\n\t\tCollections.sort(inList);\n\t\tint median = 0;\n\t\t\n\t\tif (inList.size()%2 == 0)\n\t\t{\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tint position = inList.size()/2;\n\t\t\tmedian = inList.get(position);\n\t\t}\n\t\t\n\t\treturn median; \n\t\t\n\t\t\n\t}", "public static int[][] meDian(int[][] pixels){\r\n\t\t\t\r\n\t\t\tArrayList<Integer> a = new ArrayList<>();\r\n\t\t\tint[][] temp = new int[3][3];\r\n\t\t int height = pixels.length;\r\n\t\t int width = pixels[0].length;\r\n\t\t\t\r\n\t\t\tfor(int col = 0; col < pixels.length; col++){\r\n\t\t\t\tmResult[0][col] = pixels[0][col];\r\n\t\t\t\tmResult[width -1][col] = pixels[width - 1][col];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor (int row = 0 ; row < pixels.length ; row++) {\r\n\t\t mResult[row][0] = pixels[0][row];\r\n\t\t mResult[row][height - 1] = pixels[row][height - 1];\r\n\t\t }\r\n\t\t\t\r\n\t\t\tfor (int row = 1 ; row < height - 1 ; row++) {\r\n\t\t for (int col = 1 ; col < width - 1 ; col++) {\r\n\t\t \tfor(int i = -1; i <= 1; i++){\r\n\t\t \t\tfor(int j = -1; j <= 1; j++){\r\n\t\t \t\t\ta.add(pixels[row+i][col+j]);\r\n\t\t \t\t}\r\n\t\t \t}\r\n\t\t \tCollections.sort(a);\r\n \t\tmResult[row][col] = a.get(4);\r\n \t\ta.clear();\r\n\t\t }\r\n\t\t}\r\n\t\t\treturn mResult;\r\n\t}", "public static void main(String[] args) {\n\n int nums[] = {1, 2};\n int nums2[] = {3, 4};\n System.out.println(Medianof2SortedArrays.findMedianSortedArraysSol(nums, nums2));\n\n }", "public double findMedianSortedArrays(int A[], int B[]) {\n\t\tif(A.length == 0 && B.length == 0)\n\t\t\treturn (double) 0;\n\t\t\n\t\tif((A.length + B.length)%2 == 0)\n\t\t{\n\t\t\t//EVEN case\n\t\t\tint target = (A.length + B.length)/2;\n\t\t\tdouble rs1 = getMedian(A, B, target);\n\t\t\tSystem.out.println(\"ANS1 => \"+rs1);\n\t\t\ttarget = target + 1;\n\t\t\tdouble rs2 = getMedian(A, B, target);\n\t\t\tSystem.out.println(\"ANS2 => \"+rs2);\n\t\t\treturn (rs1+rs2)/2;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//ODD case\n\t\t\tint target = (A.length + B.length + 1)/2;\n\t\t\tdouble rs = getMedian(A, B, target);\n\t\t\treturn rs;\n\t\t}\n\t\t\n }", "public static int getMedian(int[] A, int[] B) {\n\t\tint i = 0;\n\t\tint j = 0;\n\t\tint count;\n\t\tint m1 = 0;\n\t\tint m2 = 0;\n\t\tint n = A.length;\n\t\t\n\t\t// For different size case\n//\t\tint n = A.length + B.length;\n//\t\tif (n % 2 == 0) {\n//\t\t\tn = n/2;\n//\t\t}\n//\t\telse\n//\t\t\tn = (n/2 + 1);\n\t\t\n\t\tfor (count = 0; count <= n; count++) {\n\t\t\tif (i == n) {\n\t\t\t\tm1 = m2;\n\t\t\t\tm2 = B[0];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if (j == n) \n\t\t\t{\n\t\t\t\tm1 = m2;\n\t\t\t\tm2 = A[0];\n\t\t\t}\n\t\t\t\n\t\t\tif (A[i] < B[j]) {\n\t\t\t\tm1 = m2;\n\t\t\t\tm2 = A[i];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tm1 = m2;\n\t\t\t\tm2 = B[j];\n\t\t\t}\n\t\t}\n\t\treturn ((m1+m2)/2);\n\t}", "public static <T extends Number & Comparable> double computeMedian(ArrayList<T> nData) {\r\n if (nData.isEmpty()) // check data is empty or not\r\n throw new IllegalArgumentException(\"Size of array must be greater than 0\"); // throw exception if data is empty\r\n\r\n Collections.sort(nData); // sort ndata in ascending order.\r\n\r\n double median = nData.get(nData.size() / 2).doubleValue(); // declare median varibale and store median value of nData list\r\n if (nData.size() % 2 == 0) // check nData size even or not\r\n median = (nData.get(nData.size() / 2).doubleValue() + nData.get(nData.size() / 2 - 1).doubleValue()) / 2; // if condition is true than median value is update according expression\r\n\r\n return median; //return double type median value of ndata list\r\n }", "public static double findMedian(double weight[], int n) \n { \n \tSystem.out.println(\" Calculate median : \");\n \t//System.out.println(\" weight[] size : \"+ weight.length);\n \t//System.out.println(\" n : \"+ n);\n \tdouble a[] = new double[n];\n \t\n \t//weight array > 0.0\n\t\tfor(int i=0; i < weight.length; i++ ) {\n\t\t\tif(weight[i] > 0.0) {\n\t\t\t\ta[i] = weight[i];\n\t\t\t}\n\t\t}\n\t\t//System.out.println(\" a[] size : \"+ a.length);\n\t\t\n // First we sort the array \n Arrays.sort(a); \n \n // check for even case \n if (n % 2 != 0) \n return (double)a[n / 2]; \n \n return Double.valueOf(df.format((double)(a[(n - 1) / 2] + a[n / 2]) / 2.0)); \n }", "private static double MedianofTwoSortedArraysTest(int[] nums1, int[] nums2) {\n\t\tint m = nums1.length;\r\n\t\tint n = nums2.length;\r\n\t\t\r\n\t\tif(m<n){\r\n\t\t\treturn MedianofTwoSortedArraysTest(nums2,nums1);\r\n\t\t}\r\n\t\t\r\n\t\tif(n==0){\r\n\t\t\treturn ((double)nums1[(m-1)/2]+(double)nums1[m/2])/2;\r\n\t\t}\r\n\t\t\r\n\t\tint lo = 0, hi = n*2;\r\n\t\twhile(lo<=hi){\r\n\t\t\tint mid2 = (lo+hi)/2;\r\n\t\t\tint mid1 = m+n-mid2;\r\n\t\t\t\r\n\t double L1 = (mid1 == 0) ? Integer.MIN_VALUE: nums1[(mid1-1)/2];\r\n\t double L2 = (mid2 == 0) ? Integer.MIN_VALUE : nums2[(mid2-1)/2];\r\n\t double R1 = (mid1 == m * 2) ? Integer.MAX_VALUE : nums1[(mid1)/2];\r\n\t double R2 = (mid2 == n * 2) ? Integer.MAX_VALUE : nums2[(mid2)/2];\r\n\t \r\n\t if(L1>R2) lo = mid2+1;\r\n\t else if(L2>R1) hi = mid2-1;\r\n\t else return (Math.max(L1, L2)+Math.min(R1, R2))/2;\r\n\t\t}\r\n\t\t\r\n\t\treturn -1;\r\n\t}", "private static native void weightedMedianFilter_0(long joint_nativeObj, long src_nativeObj, long dst_nativeObj, int r, double sigma, int weightType, long mask_nativeObj);", "public static int findMedianInt (Scanner scn)\n {\n ArrayList<Integer> lines = new ArrayList<Integer>();\n while (scn.hasNext())\n {\n lines.add(scn.nextInt());\n }\n if (lines.size() > 0)\n {\n Collections.sort(lines);\n return lines.get(lines.size() / 2);\n }\n else\n {\n throw new NoSuchElementException();\n }\n }", "public void MedianFinder() {\n lowerPart = new PriorityQueue<>((a, b) -> (b - a));\n higherPart = new PriorityQueue<>();\n count = 0;\n }", "public static int solution(int[] A) {\n\n TreeSet<Integer> sortedInput = new TreeSet<Integer>();\n\n for(int i = 0; i < A.length; ++i){\n //System.out.println(A[i]);\n sortedInput.add(A[i]);\n }\n\n int index;\n if(A.length % 2 == 0){\n index = A.length /2;\n } else {\n index = (A.length - 1) / 2;\n }\n\n Iterator<Integer> iter = sortedInput.iterator();\n int currIdx = 0;\n Integer median = new Integer(-1);\n\n while(iter.hasNext() && currIdx < index){\n median = iter.next();\n ++currIdx;\n }\n\n return median;\n }", "public static double getMedianofTwoSortedArraysOfEqualLength(Integer[] array1,Integer[] array2) {\n\t\treturn getMedianofTwoSortedArraysOfEqualLength(array1, array2,0,array1.length-1,0,array1.length-1);\n\t}", "public static double medVal(int[] sample) {\n //sorting array of sample times\n Sorting.quickSort(sample);\n int middle = sample.length/2;\n if (sample.length % 2 == 1){\n return sample[middle];\n } \n else{\n return (sample[middle-1] + sample[middle]) / 2.0;\n }\n }", "public int BruteForceMedian(int[] A) {\n\t\tint numsmaller;;\n\t\tint numequal;;\n\t\t\n\t\tint n = A.length; //Need to plus 1 as count from 1 not 0\n\t\tint k = n/2;\n\t\t\n\t\tfor (int i = 0; i < n-1; i++) {\n\t\t\t\n\t\t\tnumsmaller = 0;\n\t\t\tnumequal = 0;\n\t\t\t\n\t\t\tfor (int j = 0; j < n-1; j++) {\n\t\t\t\tif (A[j] < A[i]) {\n\t\t\t\t\tnumsmaller++;\n\t\t\t\t\tboCount++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse {\n\t\t\t\t\tif (A[j] == A[i]) {\n\t\t\t\t\t\tnumequal++; \n\t\t\t\t\t\tboCount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\tif (numsmaller < k && k <= (numsmaller + numequal)) {\n\t\t\t\treturn A[i];\n\t\t\t}\n\t\t}\n\t\treturn A[0]; //If there is only one element.\n\t}", "public MedianFinder() {\n large=new PriorityQueue();\n small=new PriorityQueue(new Comparator<Integer>(){\n @Override\n public int compare(Integer i1,Integer i2){\n return i2-i1;\n }\n });\n }", "@Test\n\tpublic void testExecute_doubleArr_int()\n\t{\n\t\tSystem.out.println(\"Test of MedianValue.execute()\");\n\t\tSystem.out.println(\"execute\");\n\t\tdouble[] waveforms = new double[] {1.0, 5.0, 3.0, 2.0, 2.2, -1.0, 4.4, 10.0, -9.0, 5.0};\n\t\tint recordLength = 5;\n\t\tdouble[] expResult = new double[] {2.2, 4.4};\n\t\tdouble[] result = MedianValue.execute(waveforms, recordLength);\n\t\tassertArrayEquals(expResult, result, 0.0);\n\t}", "private static void quickSort(int[] array, int begin, int end, boolean useMedian) {\n int i = begin;\n int j = end;\n if (array.length==0 || array == null) {\n return;\n }\n int pivot = array[begin];\n if (useMedian) { \n pivot = array[begin + (end - begin) / 2];\n }\n\n while (i <= j) { \n while (array[i] < pivot) { \n i++;\n }\n while (array[j] > pivot) { \n j--; r\n }\n if (i <= j) { \n swap(array, i, j); \n i++;\n j--;\n }\n }\n\n if (begin < j) { \n quickSort(array, begin, j, useMedian);\n }\n if (i < end) { \n quickSort(array, i, end, useMedian);\n }\n }", "public MedianFinder() {\n datas = new ArrayList<>();\n }", "public static double mean(double[][] mat) { \n int counter = 0;\n double total = 0;\n for (int row = 0; row < mat.length; row++){\n for (int column = 0; column < mat[0].length; column++){\n total += mat[row][column];\n }\n }\n return total/counter;\n }", "public MedianDatasource() {\n super(generateStacks(calculateStackCount(5, 100, 200), 15, 30,\n new double[]{50, 40, 35, 30, 20, 10, 7, 5, 2}, 3));\n }", "private static void medianOfThree(int[] a, int low, int middle, int high) {\n\n if (a[middle] < a[low]) {\n swap(a, low, middle);\n }\n if (a[high] < a[low]) {\n swap(a, low, high);\n }\n\n if (a[high] < a[middle]) {\n swap(a, middle, high);\n }\n }", "@Test\n public void testGetMedian() throws IOException, ParseException {\n System.out.println(\"getMedian\");\n OrganizationsRegister ro = info(\"c\", \"d\");\n String id = \"12\";\n double expResult = 3.0;\n double result = ro.getMean(id);\n assertEquals(expResult, result);\n\n }", "public int getMedian (int[] a, int[] b,int aLength,int bLength) {\n\n\tint left = (aLength+bLength+1) >>>1; //3,2, left = 3\n\tint right =(aLength+bLength+2) >>>1;//3,2 right =3.(3.5 =>3)\n\t//average of kth smallest, from left and right. \n\treturn (findKthSmallest(a,b,aLength,bLength,left) + findKthSmallest(a,b,aLength,bLength,right))/2;\n}", "public static void weightedMedianFilter(Mat joint, Mat src, Mat dst, int r)\r\n {\r\n \r\n weightedMedianFilter_2(joint.nativeObj, src.nativeObj, dst.nativeObj, r);\r\n \r\n return;\r\n }", "public MatOfDouble getMean()\r\n {\r\n \r\n MatOfDouble retVal = MatOfDouble.fromNativeAddr(getMean_0(nativeObj));\r\n \r\n return retVal;\r\n }", "@Test\n public void test13() {\n Assert.assertEquals(1, MedianOfThreeNumbers.median(1, 1, 1));\n }", "public MedianFinder() {\n\t maxHeap=new TreeSet<>((i1, i2) ->{\n\t \t int diff=Integer.compare(i1,i2);\n\t \t return diff==0? 1: diff;\n\t });// forward order but keeping duplicate keys\n\t minHeap=new TreeSet<>((i1,i2) ->{\n\t \t int diff=Integer.compare(i2,i1);\n\t \t return diff==0? 1: diff;\n\t });// reverse order but keeping duplicate keys\n\t }", "public MedianFinder() {\n maxHeap = new PriorityQueue<Integer>((x, y) -> (y - x));\n minHeap = new PriorityQueue<Integer>();\n size = 0;\n }", "public double findMedianSortedArrays(int[] A, int[] B) {\n\t\tint m = A.length;\n\t\tint n = B.length;\n\t\tif (m > n) { // to ensure m<=n\n\t\t\tint[] temp = A;\n\t\t\tA = B;\n\t\t\tB = temp;\n\t\t\tint tmp = m;\n\t\t\tm = n;\n\t\t\tn = tmp;\n\t\t}\n\t\tint iMin = 0, iMax = m, halfLen = (m + n + 1) / 2;\n\t\twhile (iMin <= iMax) {\n\t\t\tint i = (iMin + iMax) / 2;\n\t\t\tint j = halfLen - i;\n\t\t\tif (i < iMax && B[j - 1] > A[i]) {\n\t\t\t\tiMin = iMin + 1; // i is too small\n\t\t\t} else if (i > iMin && A[i - 1] > B[j]) {\n\t\t\t\tiMax = iMax - 1; // i is too big\n\t\t\t} else { // i is perfect\n\t\t\t\tint maxLeft = 0;\n\t\t\t\tif (i == 0) {\n\t\t\t\t\tmaxLeft = B[j - 1];\n\t\t\t\t} else if (j == 0) {\n\t\t\t\t\tmaxLeft = A[i - 1];\n\t\t\t\t} else {\n\t\t\t\t\tmaxLeft = Math.max(A[i - 1], B[j - 1]);\n\t\t\t\t}\n\t\t\t\tif ((m + n) % 2 == 1) {\n\t\t\t\t\treturn maxLeft;\n\t\t\t\t}\n\n\t\t\t\tint minRight = 0;\n\t\t\t\tif (i == m) {\n\t\t\t\t\tminRight = B[j];\n\t\t\t\t} else if (j == n) {\n\t\t\t\t\tminRight = A[i];\n\t\t\t\t} else {\n\t\t\t\t\tminRight = Math.min(B[j], A[i]);\n\t\t\t\t}\n\n\t\t\t\treturn (maxLeft + minRight) / 2.0;\n\t\t\t}\n\t\t}\n\t\treturn 0.0;\n\t}", "public static double findMedianSortedArrays(int[] nums1, int[] nums2) {\r\n boolean isOdd = true;\r\n double result=0;\r\n int middle = 0;\r\n \r\n int nums1Len = nums1.length;\r\n int nums2Len = nums2.length;\r\n int fullLen = nums1Len + nums2Len;\r\n \r\n int nums1Cnt = 0;\r\n int nums2Cnt = 0;\r\n \r\n boolean nums1Cut = false;\r\n boolean nums2Cut = false;\r\n \r\n HashMap<Integer, Integer> hm = new HashMap<> ();\r\n \r\n if(fullLen % 2 == 0) {\r\n isOdd = false;\r\n }\r\n \r\n middle = fullLen / 2;\r\n \r\n if(fullLen != 1){\r\n for(int i =0; i <= middle; i++) {\r\n if(nums1Cnt == nums1Len) {\r\n hm.put(i, nums2[nums2Cnt]);\r\n nums2Cnt++;\r\n }else if(nums2Cnt == nums2Len) {\r\n hm.put(i, nums1[nums1Cnt]);\r\n nums1Cnt++;\r\n }else if(nums1[nums1Cnt] > nums2[nums2Cnt]) {\r\n hm.put(i, nums2[nums2Cnt]);\r\n nums2Cnt++;\r\n } else {\r\n hm.put(i, nums1[nums1Cnt]);\r\n nums1Cnt++;\r\n }\r\n }\r\n }\r\n \r\n if(fullLen == 1) {\r\n if(nums1Len > nums2Len) {\r\n result = nums1[0];\r\n } else {\r\n result = nums2[0];\r\n }\r\n } else if(isOdd) {\r\n result = hm.get(middle);\r\n } else {\r\n result = (hm.get(middle) + hm.get(middle-1)) / 2.0;\r\n }\r\n return result;\r\n }", "private static double middleValueElementInArray(int[] arr) {\n double sum = sumElementArray(arr);\n return sum /arr.length;\n }", "double findMedianSortedArrays3(int A[], int B[]) {\n\t int N1 = A.length;\n\t int N2 = B.length;\n\t if (N1 < N2) return findMedianSortedArrays3(B, A); // Make sure A2 is the shorter one.\n\n\t\tif (N2 == 0)\n\t\t\treturn ((double) A[(N1 - 1) / 2] + (double) A[N1 / 2]) / 2; // If A2 is empty\n\n\t int lo = 0, hi = N2 * 2;\n\t while (lo <= hi) {\n\t int mid2 = (lo + hi) / 2; // Try Cut 2 \n\t int mid1 = N1 + N2 - mid2; // Calculate Cut 1 accordingly\n\n\t double L1 = (mid1 == 0) ? Integer.MIN_VALUE : A[(mid1-1)/2]; // Get L1, R1, L2, R2 respectively\n\t double L2 = (mid2 == 0) ? Integer.MIN_VALUE : B[(mid2-1)/2];\n\t double R1 = (mid1 == N1 * 2) ? Integer.MAX_VALUE : A[(mid1)/2];\n\t double R2 = (mid2 == N2 * 2) ? Integer.MAX_VALUE : B[(mid2)/2];\n\n\t if (L1 > R2) lo = mid2 + 1; // A1's lower half is too big; need to move C1 left (C2 right)\n\t else if (L2 > R1) hi = mid2 - 1; // A2's lower half too big; need to move C2 left.\n\t else return (Math.max(L1,L2) + Math.min(R1, R2)) / 2; // Otherwise, that's the right cut.\n\t }\n\t return -1;\n\t}", "private void reduceMatrix( final double[][] matrix )\n\t{\n\n\t\tfor ( int i = 0; i < matrix.length; i++ )\n\t\t{\n\n\t\t\t// find the min value in the row\n\t\t\tdouble minValInRow = Double.MAX_VALUE;\n\t\t\tfor ( int j = 0; j < matrix[ i ].length; j++ )\n\t\t\t{\n\t\t\t\tif ( minValInRow > matrix[ i ][ j ] )\n\t\t\t\t{\n\t\t\t\t\tminValInRow = matrix[ i ][ j ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// subtract it from all values in the row\n\t\t\tfor ( int j = 0; j < matrix[ i ].length; j++ )\n\t\t\t{\n\t\t\t\tmatrix[ i ][ j ] -= minValInRow;\n\t\t\t}\n\t\t}\n\n\t\tfor ( int i = 0; i < matrix[ 0 ].length; i++ )\n\t\t{\n\t\t\tdouble minValInCol = Double.MAX_VALUE;\n\t\t\tfor ( int j = 0; j < matrix.length; j++ )\n\t\t\t{\n\t\t\t\tif ( minValInCol > matrix[ j ][ i ] )\n\t\t\t\t{\n\t\t\t\t\tminValInCol = matrix[ j ][ i ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor ( int j = 0; j < matrix.length; j++ )\n\t\t\t{\n\t\t\t\tmatrix[ j ][ i ] -= minValInCol;\n\t\t\t}\n\n\t\t}\n\n\t}", "public static void weightedMedianFilter(Mat joint, Mat src, Mat dst, int r, double sigma, int weightType, Mat mask)\r\n {\r\n \r\n weightedMedianFilter_0(joint.nativeObj, src.nativeObj, dst.nativeObj, r, sigma, weightType, mask.nativeObj);\r\n \r\n return;\r\n }", "@Test\n public void test7() {\n Assert.assertEquals(3, MedianOfThreeNumbers.median(1, 3, 3));\n }" ]
[ "0.68368125", "0.6726681", "0.67041516", "0.6666493", "0.6583675", "0.6413305", "0.6376389", "0.6344249", "0.62959266", "0.6287059", "0.6285659", "0.6272891", "0.6267234", "0.6259473", "0.6254984", "0.6215204", "0.6195702", "0.61765116", "0.6169774", "0.6130673", "0.6121545", "0.6082026", "0.60808855", "0.6078837", "0.5994929", "0.59766287", "0.5933847", "0.59251326", "0.5909087", "0.5907434", "0.5893917", "0.5884363", "0.58629936", "0.5857546", "0.5844429", "0.58258504", "0.57937413", "0.57685435", "0.5757507", "0.5708904", "0.5683112", "0.56691635", "0.5622296", "0.55966586", "0.55538905", "0.55444133", "0.553929", "0.55194885", "0.55169904", "0.54986435", "0.5465389", "0.5442451", "0.54209924", "0.54182255", "0.54154336", "0.5352674", "0.5277768", "0.5276309", "0.5233911", "0.5233715", "0.518927", "0.5124619", "0.5117739", "0.51177293", "0.5111908", "0.5100747", "0.50999403", "0.508388", "0.5072203", "0.5044717", "0.50011086", "0.499133", "0.4988799", "0.49878392", "0.49623483", "0.49411732", "0.4923794", "0.49222246", "0.48736155", "0.48437843", "0.4832052", "0.47887886", "0.47784656", "0.47434777", "0.473018", "0.4721464", "0.47139055", "0.46931717", "0.46839997", "0.46483058", "0.46211314", "0.4614718", "0.45900124", "0.45509052", "0.45468816", "0.45359567", "0.45346278", "0.4523455", "0.4523308", "0.45077357" ]
0.78369635
0
Returns the mode of the 2D array mat
public static double mode(double[][] mat) { int value = 0; int [] x = new int[100]; for (int row=0;row<mat.length;row++){ for (int col = 0;col<mat[0].length;col++){ value = (int)mat[row][col]; x[value]++; } } int big = 0; int mode = -1; for (int i = 0; i < 100; i++){ if (x[i] > big){ big = x[i]; mode = i; } } ArrayList<Double> l1 = new ArrayList<Double>(); double maxc = 0; double maxv = 0; for (int i = 0;i<l1.size();i++){ double count = 0; for (int j = 0; j < l1.size();j++){ if (l1.get(j) == l1.get(i)){ count++; } if (count > maxc){ maxc = count; maxv = l1.get(j); } } } return mode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public double mode(){\r\n\t\t\r\n\t\t//make a double to return the mode\r\n\t\tdouble mode = 0.0;\r\n\t\t\r\n\t\t//make 2 possible mode doubles\r\n\t\tdouble maybeMode;\r\n\t\t\r\n\t\t//make 2 mode count integers\r\n\t\tint modeCount1= 0;\r\n\t\tint modeCount= 0;\r\n\t\t\r\n\t\t//outer loop to go through the array\r\n\t\tfor (int i = 0; i < this.data.length; i++)\r\n\t\t{\r\n\t\t\t//assign maybeMode in order to \r\n\t\t\tmaybeMode = this.data[i];\r\n\t\t\t\r\n\t\t\tfor (int j = 0; j < this.data.length; j++)\r\n\t\t\t{\r\n\t\t\t\tif (maybeMode == this.data[j]){\r\n\t\t\t\t\tmodeCount1++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//if the new number (at index i) occurs more \r\n\t\t\t//often than the old number (or is the first one)\r\n\t\t\t//assign the new number to mode\r\n\t\t\t//and its count to modeCount\r\n\t\t\tif (modeCount1 > modeCount)\r\n\t\t\t{\r\n\t\t\t\tmode = maybeMode;\r\n\t\t\t\tmodeCount = modeCount1;\r\n\t\t\t}\r\n\t\t\t//reset mode count\r\n\t\t\tmodeCount1 = 0;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t//outer loop to go through the array again\r\n\t\tfor (int i = 0; i < this.data.length; i++)\r\n\t\t{\r\n\t\t\t//assign maybeMode in order to \r\n\t\t\tmaybeMode = this.data[i];\r\n\t\t\t\r\n\t\t\tfor (int j = 0; j < this.data.length; j++)\r\n\t\t\t{\r\n\t\t\t\tif (maybeMode == this.data[j]){\r\n\t\t\t\t\tmodeCount1++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ((maybeMode != mode) && (modeCount1 == modeCount)){\r\n\t\t\t\treturn Double.NaN;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//if the mode actually occurs more than once, return it\r\n\t\tif (modeCount > 1)\r\n\t\t{ return mode; }\r\n\t\t//if not, there is no mode and return NaN\r\n\t\telse\r\n\t\t{ return Double.NaN; }\r\n\t\t\r\n\t}", "public CamMode getCamMode() {\n NetworkTableEntry camMode = m_table.getEntry(\"camMode\");\n double cam = camMode.getDouble(0.0);\n CamMode mode = CamMode.getByValue(cam);\n return mode;\n }", "public void getMode(){\n for (int i = 0; i < nums.length; i++){\n int a = nums[i];\n mode[a] += 1;\n }\n \n // find max of occurences\n int max = 0;\n for (int i = 0; i < mode.length; i++){\n if (max < mode[i]){\n max = mode[i];\n }\n }\n \n // find amount of numbers that are equal to max\n int maxes = 0;\n for (int i = 1; i < mode.length; i++){\n if (mode[i] == max){\n maxes += 1;\n }\n }\n \n // print out mode(s)\n System.out.print(\"Mode(s): \");\n for (int i = 0; i < mode.length; i++){\n if (mode[i] == max){\n System.out.print(i + \", \");\n }\n }\n }", "public int getMode() {\n\t\treturn this.mode;\n\t}", "public int getMode()\r\n {\r\n Bundle b = getArguments();\r\n return b.getInt(PARAM_MODE);\r\n }", "public int getMode() {\r\n List<Integer> rbtList = createArray(rbt.root);\r\n int n = rbtList.size();\r\n int max = 0;\r\n int maxCount = 0;\r\n\r\n for (int i = 0; i < n; i++) {\r\n int count = 0;\r\n for (int j = 0; j < n; j++) {\r\n if (rbtList.get(j) == rbtList.get(i)) {\r\n count++;\r\n }\r\n }\r\n if (count > maxCount) {\r\n maxCount = count;\r\n max = rbtList.get(i);\r\n }\r\n }\r\n return max;\r\n }", "public int getMode() {\n return this.mode;\n }", "public double mode(int dimension) {\n return 0.0;\n }", "public int getMode() {\n return mode;\n }", "public MatrixType getType() {\n return mat.getType();\n }", "public final Modes getMode() {\n return mode;\n }", "public Integer getMM_Factor(int mode) {\n for (int[] res : getMM_Factors())\n {\n if (res[0] == mode)\n return res[1];\n }\n return null;\n }", "public T mode();", "public Mode getMode();", "public Mode getMode() {\n return mode;\n }", "public int getMode() {\n\t\treturn currentMode;\n\t}", "public static int mode()\r\n\t{\r\n\t\tint mode;\r\n\t\tdo {\r\n\t\t\tSystem.out.println(\"Veuillez entrer 1 pour allez en mode Joueur1 contre Joueur2\");\r\n\t\t\tSystem.out.println(\"Veuillez entrer 2 pour aller en mode Joueur1 contre IA\");\r\n\t\t\tSystem.out.println(\"Veuillez entrer 3 pour allez en mode spectateur d'une partie IA contre IA\");\r\n\t\t\tmode = Saisie.litentier();\r\n\t\t} while (mode > 4);\r\n\t\treturn mode;\r\n\t}", "public String getMode()\n {\n return mode.toString();\n }", "public short getMode() {\n\t\treturn mMode;\n\t}", "public String getMode(){\r\n\t\treturn mode;\r\n\t}", "public boolean getMode() {\n\t\t\treturn this.mode;\n\t\t}", "public String getMode() {\n return mode;\n }", "public String getMode() {\n return mode;\n }", "public abstract int getMode();", "public int getNumElements() {\n return mat.getNumCols()*mat.getNumRows();\n }", "public String getMode() {\n\n return mode;\n\n }", "public Mode getMode() {\n\t\tPointer mode_ptr = binding_tv.get_type_mode(ptr);\n\t\tif (mode_ptr == null)\n\t\t\treturn null;\n\t\treturn new Mode(mode_ptr);\n\t}", "public int value() { return mode; }", "java.lang.String getMode();", "public Integer getModeId() {\n return modeId;\n }", "public String getMode()\n {\n return mode;\n }", "public String getMode() {\n if (_avTable.get(ATTR_MODE) == null\n || _avTable.get(ATTR_MODE).equals(\"\")) {\n _avTable.noNotifySet(ATTR_MODE, \"ssb\", 0);\n }\n\n return _avTable.get(ATTR_MODE);\n }", "public int evalMode() {\n return this.uidState.evalMode(this.op, this.mode);\n }", "public int getModeValue(){\r\n\t\treturn modeValue;\r\n\t}", "public boolean isMode() {\n return mode;\n }", "public int sizeOfImeModeArray()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().count_elements(IMEMODE$0);\r\n }\r\n }", "public UI_MODE mode() { \n if (filter_rbmi.isSelected()) return UI_MODE.FILTER;\n else if (edgelens_rbmi.isSelected()) return UI_MODE.EDGELENS;\n else if (timeline_rbmi.isSelected()) return UI_MODE.TIMELINE;\n else return UI_MODE.EDIT;\n }", "int dimensionality();", "public IoMode getMode() {\r\n\t\treturn this.mode;\r\n\t}", "public int switchMode() {\r\n int mode = GameInfo.getInstance().switchMode();\r\n MazeMap.getInstance().updateMaze(mode);\r\n return mode;\r\n }", "public int getMode()\r\n { \r\n return this.mode; // used at the beginning to check if the game has started yet\r\n }", "public final EnumModesBase getMode() {\r\n\t\treturn this.mode;\r\n\t}", "public Map<String, ArrayList<Integer>> modes() {\n return this.modes;\n }", "public @ColorMode int getColorModes() {\n return mColorModes;\n }", "protected HashSet<Double> getMode() {\r\n boolean handleOutOfMemoryError = false;\r\n HashSet<Double> mode = new HashSet<>();\r\n long n = getN();\r\n if (n > 0) {\r\n //TDoubleObjectHashMap modes = new TDoubleObjectHashMap();\r\n Grids_GridDouble g = getGrid();\r\n int nrows = g.getChunkNRows(ChunkID, handleOutOfMemoryError);\r\n int ncols = g.getChunkNCols(ChunkID, handleOutOfMemoryError);\r\n double noDataValue = g.getNoDataValue(false);\r\n boolean calculated = false;\r\n int row = 0;\r\n int col = 0;\r\n int p;\r\n int q;\r\n Object[] tmode = initMode(nrows, ncols, noDataValue);\r\n if (tmode[0] == null) {\r\n return mode;\r\n } else {\r\n double value;\r\n long count;\r\n long modeCount = (Long) tmode[0];\r\n mode.add((Double) tmode[1]);\r\n Grids_2D_ID_int chunkCellID = (Grids_2D_ID_int) tmode[2];\r\n // Do remainder of the row\r\n p = chunkCellID.getRow();\r\n for (q = chunkCellID.getCol() + 1; q < ncols; q++) {\r\n value = getCell(p, q);\r\n if (value != noDataValue) {\r\n count = count(p, q, nrows, ncols, value);\r\n if (count > modeCount) {\r\n mode.clear();\r\n mode.add(value);\r\n modeCount = count;\r\n } else {\r\n if (count == modeCount) {\r\n mode.add(value);\r\n }\r\n }\r\n }\r\n }\r\n // Do remainder of the grid\r\n for (p++; p < nrows; p++) {\r\n for (q = 0; q < ncols; q++) {\r\n value = getCell(p, q);\r\n if (value != noDataValue) {\r\n count = count(p, q, nrows, ncols, value);\r\n if (count > modeCount) {\r\n mode.clear();\r\n mode.add(value);\r\n modeCount = count;\r\n } else {\r\n if (count == modeCount) {\r\n mode.add(value);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return mode;\r\n }", "public String getModeByArrayTypeRandom(int...type){\n\t\tArrayList<String> array = new ArrayList<String>();\n\t\tRandom randomGenerator = new Random();\n\t\tfor (int j = 0; j<type.length; j++){\n\t\t\tfor(int i = 0; i<this.type.size(); i++)\n\t\t\t{\t\n\t\t\t\tif(this.type.get(i) == type[j]) {\n\t\t\t\t\tarray.add(this.mode.get(i));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tint index = randomGenerator.nextInt(array.size());\n\t\tString mode = array.get(index);\n\t\tinfo(\"Mode is: \"+mode);\n\t\treturn mode;\n\t}", "public int getSettingsMode() {\n SQLiteDatabase database = getReadableDatabase();\n SQLiteQueryBuilder queryBuilder = new SQLiteQueryBuilder();\n\n String[] sqlSelect = {\"Mode\"};\n String sqlTable =\"Setting\";\n\n //queryBuilder.setTables(SETTINGS_TABLE_NAME);\n queryBuilder.setTables(sqlTable);\n Cursor cursor = queryBuilder.query(database, sqlSelect, null, null, null, null, null);\n cursor.moveToFirst();\n\n return cursor.getInt(cursor.getColumnIndex(\"Mode\"));\n }", "@Override\n\tpublic String getMode() {\n\t\treturn this.mode;\n\t}", "public static double mode(double[] mainArray2) {\r\n\r\n\t\tdouble[] data = new double[mainArray2.length]; //creates a new array for storage of how many times each number appears in the mainArray2\r\n\n\t\tfor(int counter1 = 0; counter1 < mainArray2.length -1; counter1++) { //this code from 230-233 counts how many times each number appears\n\t\t\tfor(int counter2 = 0; counter2 < mainArray2.length -1; counter2++) {\r\n\t\t\t\tif (mainArray2[counter1] == mainArray2[counter2] && counter2 != counter1) {\r\n\t\t\t\t\tdata [counter1] += 1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//determines the largest tally of the integers in the data array\r\n\t\tint max3 = 0;\r\n\t\tfor(int greaterThan = 1; greaterThan < data.length; greaterThan ++) {\r\n\r\n\t\t\tif(data[greaterThan]>data[max3]) {\r\n\t\t\t\tmax3 = greaterThan;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn mainArray2[max3];\n\t}", "@Override\n public int getMC() {\n return this.modeCount;\n }", "public int generateMode() {\n\t\tif(up && !down && !left && !right)\n\t\t\treturn UP;\n\t\telse if(!up && down && !left && !right)\n\t\t\treturn DOWN;\n\t\telse if(!up && !down && left && !right)\n\t\t\treturn LEFT;\n\t\telse if(!up && !down && !left && right)\n\t\t\treturn RIGHT;\n\t\telse return -1;\n\t}", "public com.google.protobuf.ByteString\n getModeBytes() {\n java.lang.Object ref = mode_;\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 mode_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getModeBytes() {\n java.lang.Object ref = mode_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n mode_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public String getModeName() {\n return modeName;\n }", "public int numCols() {\n return mat.getNumCols();\n }", "public Type getType() {\n\t\treturn BaseType.LONG_MATRIX;\n\t}", "public int largestConnectedIceland(int[][] arr) {\n\t\tint maxCount = 0;\n\t\tfor (int row=0; row<arr.length; row++) {\n\t\t\tfor (int column=0; column<arr[0].length; column++) {\n\t\t\t\tif (arr[row][column] == 1) maxCount = Math.max(maxCount, largestConnectedIcelandUtil(arr,row,column));\n\t\t\t}\n\t\t}\n\t\treturn maxCount;\n\t}", "public int getClumns() {\n return this.matrix[0].length;\n }", "public BlendMode getMode() {\n return mMode;\n }", "public String getMode() {\n\t\treturn (String) getStateHelper().eval(OutputSourceCodePropertyKeys.mode, null);\n\t}", "public PropertyMode getMode() {\n\t\treturn mode;\n\t}", "public int getMatrix(int i, int j) {\n\t\treturn matrix[i][j];\r\n\t}", "public static void print2D(char mat[][]) {\n System.out.println(\"printing matrix\");\n for (int i = 0; i < mat.length; i++) {\n for (int j = 0; j < mat[i].length; j++) {\n System.out.print(mat[i][j] + \" \");\n }\n System.out.println(\"\");\n }\n\n }", "public final String getModeEntity() {\n\t\treturn modeEntity;\n\t}", "public int bits() {\n return mat.getType().getBits();\n }", "com.google.protobuf.ByteString\n getModeBytes();", "public int[][] getMatriceAdjacence()\n {\n return matriceAdjacence;\n }", "public int[] findMode(TreeNode root) {\n dfs(root);\n Set<Integer> ans = new HashSet<>();\n int max = 0;\n List<Integer> set = new ArrayList<>(map.keySet());\n for (int i = 0; i < set.size(); i++) {\n if (max < map.get(set.get(i))) {\n max = map.get(set.get(i));\n ans.clear();\n ans.add(set.get(i));\n } else if (max == map.get(set.get(i))) {\n ans.add(set.get(i));\n }\n }\n return ans.stream().mapToInt(i -> i).toArray();\n }", "public java.lang.String getMode() {\n java.lang.Object ref = mode_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n mode_ = s;\n }\n return s;\n }\n }", "public DistributionModeInternal getMode() {\n return this.mode;\n }", "public int getScreenModeValue() {\n return screenMode_;\n }", "@Override\r\n\tpublic String getModeName()\r\n\t{\r\n\t\treturn MODE_NAME;\r\n\t}", "public int obtenerNumeroFilas() {\n\t\treturn matriz.size();\n\t}", "public static int calculateOpjectiveFunction(char[][] matrix ) {\n\n\n\n return (int)countNumberOfEmptyPosition(matrix)+countNmberOfCameras( matrix); \n\n}", "public int getScreenModeValue() {\n return screenMode_;\n }", "public char[][] getMatriz() {\r\n\t\treturn matriz;\r\n\t}", "public int[][] getMat() {\n // Note: java has no return read-only so we won't return matrix;\n // b\\c that would expose internal representation. Instead we will\n // copy each row into a new matrix, and return that.\n return Helper.cloneMatrix(matrix);\n }", "public java.lang.String getMode() {\n java.lang.Object ref = mode_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n mode_ = s;\n }\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public int[][] MatrizPesos(){\n return this.mat;\n }", "public DisplayMode findFirstCompatibleMode(DisplayMode[] modes){\n DisplayMode[] goodModes = getCompatibleDisplayModes();\n for(int i = 0; i < modes.length; i++){\n for(int j = 0; j < goodModes.length; j++){\n if(displayModesMatch(modes[i], goodModes[j])){\n System.out.println(\"Found compatible Display Mode!\");\n return modes[i];\n }\n }\n }\n System.out.println(\"Error: Could not find compatible Display Mode\");\n return null;\n }", "public int matrixScore(int[][] A) {\n int n = A.length, m = A[0].length, ans = 0;\n for (int i = 0; i < n; ++i) {\n if (A[i][0] == 0) {\n flipRow(A, i);\n }\n }\n for (int j = 1; j < m; ++j) {\n int cnt = 0;\n for (int i = 0; i < n; ++i) {\n cnt += A[i][j];\n }\n if (cnt * 2 < n) {\n flipCol(A, j);\n }\n }\n for (int i = 0; i < n; ++i) {\n int cur = 0;\n for (int j = 0; j < m; ++j) {\n cur = (cur << 1) + A[i][j];\n }\n ans += cur;\n }\n return ans;\n}", "public int size() {\n return matrix.length;\n }", "int getACMode();", "public int evalMode(int op, int mode) {\n if (mode == 4) {\n return this.state <= AppOpsManager.resolveFirstUnrestrictedUidState(op) ? 0 : 1;\n }\n return mode;\n }", "public double[][] convert_img_mat()\n\t{\n\t\tif(orderflag)\n\t\t{\n\t\t\tputpixel_1();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//rotate the image and get the pixels as usual form\t\n \t\tputpixel_2();\n\t\t}\n\treturn matrix;\n\t}", "@JsonProperty(\"mode\")\n public String getMode() {\n return mode;\n }", "public int getDisplayMode() {\n return this.displayMode;\n }", "public String getModeCombinationValue() {\n\t\treturn Formater.arrayToString(combination.getValue());\n\t}", "public LedMode getLEDMode() {\n NetworkTableEntry ledMode = m_table.getEntry(\"ledMode\");\n double led = ledMode.getDouble(0.0);\n LedMode mode = LedMode.getByValue(led);\n return mode;\n }", "public long dimCount()\n\t{\n\t\treturn (long)multimemory.dims.length;\n\t}", "public int[][] getAdjacencyMatrix();", "GameMode mode();", "boolean comprovaColumna(int j, int num) {\r\n //System.out.println(\"comprovacolumna\"+j+\"Numero:\"+num);\r\n for (int i = 0; i < N; i++) {\r\n if (mat[i][j] == num) {\r\n \r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }", "public int size() {\n return _matrix.length;\n }", "public boolean ident() {\n clear();\n for (int i = 0; i < 4; i++) {\n double[] toAdd = new double[4];\n for (int j = 0; j < 4; j++) {\n if (j == i) {\n toAdd[j] = 1;\n } else {\n toAdd[j] = 0;\n }\n }\n mat.add(toAdd);\n }\n maxCols = mat.size();\n return true;\n }", "public final long get_mode_timestamp () {\n\t\treturn mode_timestamp;\n\t}", "public int[][] getMatrix(){\n\t\treturn matrix;\n\t}", "public ColorMode getColorMode() {\n\t\treturn getValue(Property.COLOR_MODE, ColorMode.values(), ColorMode.GRADIENT);\n\t}", "public char getGameMode() {\n return gameMode;\n }", "Mode(int height, int width, int mines)\n {\n this.height = height;\n this.width = width;\n this.mines = mines;\n }" ]
[ "0.61744654", "0.5918086", "0.587149", "0.5778795", "0.57656336", "0.5744124", "0.5705067", "0.5703641", "0.5641878", "0.56414086", "0.56017613", "0.55797863", "0.55021966", "0.5494107", "0.5453372", "0.5448337", "0.5403695", "0.5400954", "0.5400271", "0.53964484", "0.53848916", "0.5358599", "0.5358599", "0.5337824", "0.53362614", "0.53345627", "0.5330809", "0.52845347", "0.5281465", "0.52775514", "0.52679855", "0.5244441", "0.5203486", "0.51944727", "0.51942414", "0.5181805", "0.51809186", "0.5179924", "0.5157748", "0.5147035", "0.5139047", "0.50964016", "0.5092163", "0.50746995", "0.5060145", "0.50423545", "0.50390303", "0.50118244", "0.5007117", "0.5005017", "0.50011843", "0.49988878", "0.49948072", "0.49942252", "0.49901593", "0.49659923", "0.49609527", "0.49603185", "0.49557367", "0.49475837", "0.4897228", "0.48644775", "0.48527128", "0.48507398", "0.48501194", "0.48484847", "0.4845218", "0.4827481", "0.48126337", "0.4811687", "0.48080373", "0.48048747", "0.47568628", "0.47567627", "0.47493422", "0.47468787", "0.47167954", "0.47117865", "0.46984667", "0.4691666", "0.4689414", "0.46687785", "0.46631947", "0.4661514", "0.4659297", "0.46588898", "0.46582425", "0.4657701", "0.46576962", "0.46541694", "0.46391955", "0.46086365", "0.4598085", "0.45922092", "0.4582435", "0.45702606", "0.45664847", "0.45649773", "0.4564819", "0.4560948" ]
0.69894606
0
Write some code here to test your methods!
public static void main(String[] args) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void test() {\n\n\t}", "@Override\r\n\t\t\tpublic void test() {\n\t\t\t}", "@Override\n public void test() {\n \n }", "@Override\n\tpublic void test() {\n\t\t\n\t}", "public void test() {\n\t}", "private test5() {\r\n\t\r\n\t}", "public void test(){\n }", "public void test() {\n }", "public void test() {\n }", "public void test() {\n\n }", "private void someUtilityMethod() {\n }", "private void someUtilityMethod() {\n }", "private void Nice(){\n }", "public void testOperation();", "public void test5() {\n\t\t\n\t}", "public static void main(String[] args) {\r\n // 2. Call your method in various ways to test it here.\r\n }", "@Test\r\n\tpublic void test() {\r\n\t}", "public void testBidu(){\n\t}", "@Test\n\tpublic void something() {\n\t}", "@Test\n public void simpleUse(){\n }", "public void method_199() {}", "public void method_201() {}", "@Test\n\tpublic void test() {\n\t}", "@Test\n\tpublic void test() {\n\t}", "@Test\r\n\tpublic void testSanity() {\n\t}", "public void smell() {\n\t\t\n\t}", "@Test\n public void Tester_UI_when_find_contact_not_added() throws Exception{System.out.println(\"TODO\") ;}", "public int testmethod1()\n\t{\n\t\treturn 0;\n\t\t\n\t}", "public void testAltaVehiculo(){\r\n\t}", "@Test\n\tvoid test() {\n\t\t\n\t}", "public void method_200() {}", "@Test\r\n\tpublic void acreditar() {\r\n\t}", "public void test();", "public void test();", "public void testGetBasedata() {\n }", "public void method(){}", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "static void testCaculator(){\n }", "public void woke(){\n\n //TODO\n\n }", "public static void dummyTest(){}", "public static void dummyTest(){}", "public void doSomething() {\n \n }", "public void mo38850q() {\n }", "@Test\r\n public void testRent() {\r\n }", "public void testaReclamacao() {\n\t}", "public void testDummy()\n {\n }", "@Override\n public void runTest() {\n }", "@Test\n public void testMethod() {\n }", "@Test\n public void trimsBidAndAsk() {\n }", "@Test\n\tpublic void test(){\n\t}", "@Test\n public void getStuff() {\n \n Assert.assertEquals(wService.work(), \"Parker\");\n Assert.assertEquals(aService.age(), 25);\n }", "@Test\r\n public void dummyCanGiveXP() {\n\r\n dummy.giveExperience();\r\n\r\n assertEquals(DUMMY_EXPERIENCE, dummy.giveExperience());\r\n }", "public void testLizard(){\n }", "@Test\n public void request() throws Exception {\n\n\n }", "@Test\r\n public void testRentOut() {\r\n }", "public void method_115() {}", "@Test\n public void testAddACopy() {\n }", "private void testMethod(){jnkkjnknk\n //Jocke\n //jocke2\n //pew\n //testcommit\n\n }", "@Test\n public void sustainMassiveDamage() {\n }", "@Override\n public void tests() {\n System.out.println(\"222222222222222222\"); \n }", "@Override\r\n\tpublic void method() {\n\t\r\n\t}", "@Test\r\n public void elCerdoNoSePuedeAtender() {\n }", "public void testSpock(){\n }", "public void testBlah() {\n // nothing\n }", "public void testDummy() {\n }", "public void testDummy() {\n }", "@Test\n void questionAnswered() {\n }", "@org.junit.Test\r\n\tpublic void test() {\n\t\t\t\t\r\n\t}", "public void method_202() {}", "@Test\n public void solve1() {\n }", "@Test\r\n public void testGreeting02(){\r\n\r\n assertEquals(\"Hello SQS\", greets.greet(\"SQS\"));\r\n assertEquals(\"Hello TDD\", greets.greet(\"TDD\"));\r\n }", "public void method_4270() {}", "@Test\n public void testingTheTwoPlane2016Order() {\n }", "public void mock(){\n\n }", "public void working()\n {\n \n \n }", "public void logic(){\r\n\r\n\t}", "@Test\r\n\tpublic void client() {\n\t}", "static void test(){\n\t }", "@Test\n public void should_return_() {\n }", "@Test\n public void testCheckPositive() {\n Helper.checkPositive(1, \"obj\", \"method\", LogManager.getLog());\n }", "void test02(){\n\t}", "@Test\n void get() {\n }", "private void test2(){\n\t}", "@Test\n public void testQuery(){\n }", "@Test\n public void RecentBookClick() {\n }", "@Test\n public void updateContact() {\n }", "public void mo55254a() {\n }", "@Test\n public void testSomeMethod() {\n }", "@Test\n public void testSomeMethod() {\n }", "@Test\n public void addition() {\n\n }", "@Test\r\n public void testGetPaymentDetails() {\r\n }", "@Test\n\tfinal void test() {\n\t}", "@BeforeMethod\n\tpublic void beforeMethod() {\n\t}", "@Test\n public void defineShippingmethod()\n {\n library.agreeCheckbox();\n library.isAlertPresent1();\n library.enterCountryToCheckout(country);\n //Verify product added to shopping cart successfully\n library.verifyBillingAddressWindow();\n library.definingTheAddress(country,city,address1,postalCode,phone);\n library.shippingAddressSelect();\n library.verifyShippingMethodWindow();\n\n\n }", "void testMethod() {\n f();\n }", "public void mo56167c() {\n }", "public void testGitHub() {\n\t}", "@Test\n public void test() {\n\n testBookExample();\n // testK5();\n // testK3_3();\n }", "public void objectTest() {\n }", "@Test\n public void updatePage() {\n }", "@Test\n public void accuseSuccesTest() throws Exception {\n }" ]
[ "0.7378997", "0.7258302", "0.70578414", "0.6978207", "0.6920755", "0.6879419", "0.68365663", "0.6804099", "0.6804099", "0.6802146", "0.6761128", "0.6761128", "0.67413056", "0.6684006", "0.6636884", "0.65446866", "0.653701", "0.6530732", "0.65302247", "0.6520512", "0.6510683", "0.65022165", "0.6461585", "0.6461585", "0.6460062", "0.64481694", "0.6445324", "0.6444612", "0.6434909", "0.6405447", "0.6383449", "0.63803995", "0.63741314", "0.63741314", "0.6373901", "0.6366559", "0.6362146", "0.63615304", "0.6358086", "0.6351273", "0.6351273", "0.6348154", "0.6347892", "0.63467884", "0.6346257", "0.63443327", "0.6343812", "0.6333101", "0.63222057", "0.6312847", "0.6310569", "0.63080627", "0.63054883", "0.6304918", "0.63043046", "0.6286378", "0.6285618", "0.6284504", "0.62807167", "0.62718165", "0.62689716", "0.6268608", "0.6268548", "0.6262543", "0.6260253", "0.625262", "0.62521696", "0.6236352", "0.62340885", "0.6233635", "0.6233393", "0.6230767", "0.6230705", "0.62302816", "0.6219999", "0.6215285", "0.6205345", "0.6200841", "0.6182484", "0.61797357", "0.61776906", "0.6172862", "0.61715263", "0.6168797", "0.6168099", "0.61659974", "0.61632156", "0.6162257", "0.6162257", "0.6157267", "0.61566234", "0.6156173", "0.61535716", "0.6151629", "0.6149453", "0.6148546", "0.61473745", "0.6142944", "0.6140516", "0.6138117", "0.6137912" ]
0.0
-1
Description of the method addColumn.
public void addColumn(Column column) { // Start of user code for method addColumn // End of user code }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract void addColumn(Column c);", "public void addColumn(String columnName);", "IColumnBinding addColumn(String spec);", "IColumnBinding addColumn(SpecialBinding columnType, int width);", "IColumnBinding addColumn(IColumnBinding baseColumn, EStructuralFeature feature, int width);", "IColumnBinding addColumn(EStructuralFeature feature, int width);", "public void addColumn(Column e){\n\t\t\n\t\tif(clist == null){\n\t\t\tthis.clist = new ArrayList<Column>();\n\t\t}\n\t\t\n\t\tthis.clist.add(e);\n\t\t\n\t}", "public void addColumn(DatabaseColumn column) {\n addColumn(-1, column);\n }", "public void addColumn(String name) {\n\t\tcolNames.add(name);\n\t\tfireTableStructureChanged();\n\t\t/*\n\t\t At present, TableModelListener does not have a more specific\n\t\t notification for changing the number of columns.\n\t\t*/\n\t}", "public void addColumn(String column) {\n tableModel.addColumn(column);\n this.setModel(tableModel);\n\n }", "public void addColumn(final PgColumn column) {\n columns.add(column);\n }", "public com.guidewire.datamodel.ColumnDocument.Column addNewColumn()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n com.guidewire.datamodel.ColumnDocument.Column target = null;\r\n target = (com.guidewire.datamodel.ColumnDocument.Column)get_store().add_element_user(COLUMN$0);\r\n return target;\r\n }\r\n }", "@Override\n\tpublic void addCol() {\n\t\tif(this.numRows == 0){\n\t\t\tthis.numRows++;\n\t\t}\n\t\tthis.numCols++;\n\t}", "public IColumn addColumn(String name) throws ETLException {\r\n\t\treturn addColumn(name, -1);\r\n\t}", "public void addColumn(ColumnDefinition cd) {\n this.columns.put(cd.getColumnName()\n .toLowerCase(), cd);\n }", "public void addColumn(Expression value) {\n myInfoExposer.addColumn(value);\n }", "public abstract void newColumn();", "public void addColumn(int index, DatabaseColumn column) {\n if (columns == null) {\n columns = new ArrayList();\n }\n if (index > -1) {\n columns.add(index, column);\n } else {\n columns.add(column);\n }\n }", "Column createColumn();", "public String getAddColumnString() {\n \t\tthrow new UnsupportedOperationException( \"No add column syntax supported by \" + getClass().getName() );\n \t}", "public void addColumn(final String tableName, DBColumnDescriptor column)\n throws IOException {\n addColumn(Bytes.toBytes(tableName), column);\n }", "Get<K, C> addColumn(C column);", "public void addColumn (RColumn rc, int index)\n\t{\n\t\tm_data.cols.add(index, rc);\n\t}", "public void addColumn(final byte [] tableName, DBColumnDescriptor column)\n throws IOException {\n if (this.master == null) \n throw new MasterNotRunningException(\"master has been shut down\");\n \n DBTableDescriptor.isLegalTableName(tableName);\n try {\n this.master.addColumn(tableName, column);\n } catch (RemoteException e) {\n throw RemoteExceptionHandler.decodeRemoteException(e);\n }\n }", "public void addColumn(String name, String type, boolean primaryKey) {\n if (mColumnCreationStr.length() != 0) {\n mColumnCreationStr += \", \";\n }\n\n // Adding column\n mColumnCreationStr += name + \" \";\n mColumnCreationStr += type + \" \";\n if (primaryKey) {\n mColumnCreationStr += \"PRIMARY KEY \";\n }\n }", "public boolean addColumn(String columnName, DataType valueType) {\n boolean added = false;\n\n if (!columns.containsKey(columnName)) {\n\n columns.put(columnName, valueType);\n added = true;\n }\n\n return added;\n }", "private boolean addColumnToTable(String server, String database, String table, String columnName,\n\t\t\tString dataType) {\n\n\t\tcolumnName = getNormalisedColumnName(columnName);\n\n\t\tString sql = String.format(\"alter table \\\"%s\\\" add column \\\"%s\\\" %s\",\n\t\t\t\ttable, columnName.trim(), dataType);\n\t\ttry {\n\t\t\treturn (new QueryRunner(server, database)\n\t\t\t\t\t.runDBQuery(sql, 0, 0, false));\n\t\t} catch (ClassNotFoundException | SQLException e) {\n\t\t\tlog.debug(\"Error creating table column\", e);\n\t\t\treturn false;\n\t\t}\n\t}", "public void addColumn(TableColumn aColumn) {\n\t\tObject id = aColumn.getIdentifier();\n\t\tJCheckBoxMenuItem item = new JCheckBoxMenuItem(\n\t\t\t\t(String) aColumn.getHeaderValue(), true);\n\t\titem.addActionListener(actionListener);\n\t\tidMap.put(item, id);\n\t\titemMap.put(id, item);\n\t\tpopup.add(item);\n\t\tsuper.addColumn(aColumn);\n\t}", "@Override\r\n\tpublic void columnAdded(TableColumnModelEvent e) {\n\t\t\r\n\t}", "public IColumn addColumn(String name, int idx) throws ETLException {\r\n\t\tif (name == null) {\r\n\t\t\tString baseName = \"Col-\" + columns.size();\r\n\t\t\tname = baseName;\r\n\t\t\tint i = 0;\r\n\t\t\twhile (columnMap.containsKey(name)) {\r\n\t\t\t\tname = baseName + \".\" + (i++);\r\n\t\t\t}\r\n\t\t}\r\n\t\tIColumn column = new Column(name, idx); \r\n\t\taddColumn(column);\r\n\t\treturn column;\r\n\t}", "public void addColumn(Column col) {\n\t\t// Allocate a new array.\n\t\tColumn[] newColumns = new Column[columns.length + 1];\n\n\t\t// copy current columns if any\n\t\tSystem.arraycopy(columns, 0, newColumns, 0, columns.length);\n\n\t\t//ANCA: need to expand the column\n\t\t// old:\t\tnewColumns[newColumns.length - 1] = col;\n\n\t\tString columnClass = (col.getClass()).getName();\n\t\tColumn expandedColumn = null;\n\t\ttry {\n\t\t\texpandedColumn = (Column) Class.forName(columnClass).newInstance();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e);\n\t\t}\n\n\t\t//if col is the first column in the table add it as is and initialize subset\n\t\tint numRows = super.getNumRows();\n\t\tif (columns.length == 0) {\n\t\t\tif (subset.length == 0) {\n\t\t\t\tnumRows = col.getNumRows();\n\t\t\t\tsubset = new int[numRows];\n\t\t\t\tfor (int i = 0; i < this.getNumRows(); i++) {\n\t\t\t\t\tsubset[i] = i;\n\t\t\t\t}\n\t\t\t\texpandedColumn = col;\n\t\t\t}\n\t\t} else if (numRows == col.getNumRows()) {\n expandedColumn = col;\n } else {\n\t\t\texpandedColumn.addRows(numRows);\n\t\t\texpandedColumn.setLabel(col.getLabel());\n\t\t\texpandedColumn.setComment(col.getComment());\n\t\t\texpandedColumn.setIsScalar(col.getIsScalar());\n\t\t\texpandedColumn.setIsNominal(col.getIsNominal());\n\n\t\t\t//initialize all values as missing for the beginning\n\t\t\tfor (int j = 0; j < numRows; j++)\n\t\t\t\texpandedColumn.setValueToMissing(true, j);\n\n\t\t\t//set the elements of the column where appropriate as determined by subset\n\t\t\tObject el;\n\t\t\tfor (int i = 0; i < subset.length; i++) {\n if (col.isValueMissing(i)) {\n expandedColumn.setValueToMissing(true, i);\n } else {\n\t\t\t\t el = col.getObject(i);\n\t\t\t\t expandedColumn.setObject(el, subset[i]);\n\t\t\t\t expandedColumn.setValueToMissing(false, subset[i]);\n }\n\t\t\t}\n\t\t}\n\t\tnewColumns[newColumns.length - 1] = expandedColumn;\n\t\tcolumns = newColumns;\n\t}", "public void addColumn(IColumn column) throws ETLException {\r\n\t\tif (column == null) {\r\n\t\t\tthrow new NullPointerException(\"Column must be not null\");\r\n\t\t}\r\n\t\tif (columnMap.containsKey(column.getName())) {\r\n\t\t\tthrow new ETLException(\"A column with name '\" + column + \"' already exists in this dataset.\");\r\n\t\t}\r\n\r\n\t\tupdateColumn(column);\r\n\t\t\r\n\t\tcolumns.add(column);\r\n\t\tcolumnMap.put(column.getName(), column);\r\n\t}", "public void addColumn(final IColumn column, Component component, final IRenderable renderable)\n\t{\n\t\taddColumn(column, component, renderable, Position.APPEND);\n\t}", "public void addColumn (String colName) {\n nbOfColumns++;\n header.add(colName);\n for (CSVRow row : rows) {\n row.addElement(\"\");\n }\n }", "public void addColumn(PdfPCell cell)\n {\n table.addCell(cell);\n }", "Get<K, C> addColumn(String family, C column);", "public static void addColumn(Element anyMapping, Column column) {\n\t\taddColumn(\n\t\t\t\tanyMapping,\n\t\t\t\tcolumn.getName(),\n\t\t\t\tcolumn.getLength(),\n\t\t\t\tcolumn.getScale(),\n\t\t\t\tcolumn.getPrecision(),\n\t\t\t\tcolumn.getSqlType(),\n\t\t\t\tcolumn.getCustomRead(),\n\t\t\t\tcolumn.getCustomWrite(),\n\t\t\t\tcolumn.isQuoted()\n\t\t);\n\t}", "public void addUpdateColumn(String columnName, String columnValue, String dataType) throws Exception {\n\t\tupdateColumnsDataSet.addRow();\n\t\tupdateColumnsDataSet.setValue(updateColumnsDataSet.getRowCnt()-1, \"COLUMN_NAME\", columnName);\n\t\tupdateColumnsDataSet.setValue(updateColumnsDataSet.getRowCnt()-1, \"COLUMN_VALUE\", columnValue);\n\t\tupdateColumnsDataSet.setValue(updateColumnsDataSet.getRowCnt()-1, \"DATA_TYPE\", CommonUtil.nvl(dataType, \"String\"));\n\t}", "public void addColumn(ResultViewerColumnInfo columnInfo){\n\t\t\n\t\tTree tree = wrapedViewer.getTree();\n\t\tTreeColumn treeColumn = new TreeColumn(tree, SWT.LEFT);\n\t\ttreeColumn.setText(columnInfo.getColumnName());\n\t\ttreeColumn.setWidth(columnInfo.getWidth());\n\t\ttreeColumn.addSelectionListener(new SelectionAdapter(){\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tTreeColumn[] columns = wrapedViewer.getTree().getColumns();\n\t\t\t\tfor(int i=0; i<columns.length; i++){\n\t\t\t\t\tif(columns[i].equals(e.widget)){\n\t\t\t\t\t\tResultViewerColumnInfo colInf = (ResultViewerColumnInfo)ResultViewer.this.columns.get(i);\n\t\t\t\t\t\tint previousCol = sorter.getSortedColumnIndex();\n\t\t\t\t\t\tif(previousCol == i){\n\t\t\t\t\t\t\tsorter.setSortedColumn(-1, null);\n\t\t\t\t\t\t\tcolumns[i].setText(colInf.getColumnName());\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\tsorter.setSortedColumn(i, colInf.getColumnType());\n\t\t\t\t\t\t\tcolumns[i].setText(colInf.getColumnName() + \" *\");\n\t\t\t\t\t\t\tif(previousCol >= 0){\n\t\t\t\t\t\t\t\tResultViewerColumnInfo previousColInf = (ResultViewerColumnInfo)ResultViewer.this.columns.get(previousCol);\n\t\t\t\t\t\t\t\tcolumns[previousCol].setText(previousColInf.getColumnName());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\twrapedViewer.refresh();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\ttreeColumn.addControlListener(columnInfo);\n\t\tcolumns.add(columnInfo);\n\t\tSetColumnVisibleAction action = (SetColumnVisibleAction)contextMenuActions.get(columnInfo.getColumnType());\n\t\tif(action != null)\n\t\t\taction.setChecked(true);\n\t\tif (tree.isVisible()) {\n\t\t\twrapedViewer.refresh();\n\t\t}\n\t}", "public void addColumn(Expression value, ObjectTransformer transform) {\n myInfoExposer.addColumn(value, transform);\n }", "public void addColumn(final Column<?> column) {\n Preconditions.checkState(!readOnly, \"Cannot add more data to a read only concat column\");\n Preconditions.checkArgument(column.getType() == getType(), \"cannot append a type %s to a column of type %s\", column\n .getType(), getType());\n if (column instanceof ConcatColumn) {\n for (Column<?> c : ((ConcatColumn<?>) column).columnIds.values()) {\n addColumn(c);\n }\n } else {\n columnIds.put(numTuples, column);\n numTuples += column.size();\n }\n }", "private void addColumn(String col, int width, int dec, int align) {\r\n column_names.add(col);\r\n renderers.add(new FractionCellRenderer(width, dec, align));\r\n }", "@Override\n public void addTableColumn(final Connection _con,\n final String _tableName,\n final String _columnName,\n final ColumnType _columnType,\n final String _defaultValue,\n final int _length,\n final int _scale,\n final boolean _isNotNull)\n throws SQLException {\n\n String defaultValue = _defaultValue;\n\n if (_isNotNull && (defaultValue == null)) {\n switch (_columnType) {\n case INTEGER:\n case REAL:\n defaultValue = \"0\";\n break;\n case DATETIME:\n case STRING_LONG:\n case STRING_SHORT:\n defaultValue = \"''\";\n break;\n }\n }\n\n super.addTableColumn(_con, _tableName, _columnName, _columnType,\n defaultValue, _length, _scale, _isNotNull);\n }", "public void addCol(String colName, DataColumn newCol) throws DataTableException {\n\t\tif (containsColumn(colName)) {\n\t\t\tthrow new DataTableException(\"addCol: The column already exists\");\n\t\t}\n\n\t\tint curNumCol = getNumCol();\n\t\tif (curNumCol == 0) {\n\t\t\tdc.put(colName, newCol); // add the column\n\t\t\treturn; // exit the method\n\t\t}\n\n\t\t// If there is more than one column,\n\t\t// we need to ensure that all columns having the same size\n\n\t\tint curNumRow = getNumRow();\n\t\tif (newCol.getSize() != curNumRow) {\n\t\t\tthrow new DataTableException(String.format(\n\t\t\t\t\t\"addCol: The row size does not match: newCol(%d) and curNumRow(%d)\", newCol.getSize(), curNumRow));\n\t\t}\n\n\t\tdc.put(colName, newCol); // add the mapping\n\t}", "public void onAddNewReq() {\n dbConn.logUIMsg(RLogger.MSG_TYPE_INFO, RLogger.LOGGING_LEVEL_DEBUG, \"TableManagerBean.class :: onAddNew() :: Adding new Column\");\n ColList newCol = new ColList();\n newCol.setCol_name(\"COL\");\n newCol.setCol_value(\"VAL\");\n this.getReqColumnList().add(newCol);\n }", "public void createColumn(String columnName){\n addColumnBtn.click();\n wait.until(ExpectedConditions.visibilityOf(columnNameLbl));\n columnNameLbl.click();\n columnNameInput.sendKeys(columnName);\n columnNameInput.sendKeys(Keys.ENTER);\n }", "public boolean addColumn(String columnName, ArrayList<String> columnValues) {\r\n\t\tif(columnValues.size() != this.df.size()) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif(this.columnMapping.containsKey(columnName)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tint nsize = this.fieldNames.length;\r\n\t\tthis.columnMapping.put(columnName, nsize);\r\n\t\tString[] newFieldNames = new String[nsize+1];\r\n\t\tfor(int i = 0; i < this.fieldNames.length; i++) {\r\n\t\t\tnewFieldNames[i] = this.fieldNames[i];\r\n\t\t}\r\n\t\tnewFieldNames[nsize] = columnName;\r\n\t\tthis.fieldNames = newFieldNames;\r\n\t\t\r\n\t\tfor(int i = 0; i < this.nrow(); i++) {\r\n\t\t\tString[] newRow = new String[nsize+1];\r\n\t\t\tfor(int k = 0; k < this.get(i).length; k++) {\r\n\t\t\t\tnewRow[k] = this.get(i, k);\r\n\t\t\t}\r\n\t\t\tnewRow[nsize] = columnValues.get(i);\r\n\t\t\tthis.df.set(i, newRow);\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "public void addColumn(Tile[] Column) {\r\n\t\tlayout.add(Column);\r\n\t\tthis.WIDTH = layout.size();\r\n\t\tthis.HEIGHT = Column.length;\r\n\t\tthis.countCoins();\r\n\t}", "Column(String column) {\n this.column = column;\n }", "Column(String column) {\n this.column = column;\n }", "public Builder addColumns(Column value) {\n if (columnsBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureColumnsIsMutable();\n columns_.add(value);\n onChanged();\n } else {\n columnsBuilder_.addMessage(value);\n }\n return this;\n }", "public void add(String data) {\n columns.add(data);\n }", "public void addColumn (String header)\n\t{\n\t\tWListItemRenderer renderer = (WListItemRenderer)getItemRenderer();\n\t\trenderer.addColumn(Util.cleanAmp(header));\n\t\tgetModel().addColumn();\n\n\t\treturn;\n\t}", "public void AgregarColumna(String Tabla, String newColumna, String TipoDato) {\n try {\n db = new SQLHelper(mcontext).getWritableDatabase();\n db.execSQL(\"ALTER TABLE \" + Tabla + \" ADD COLUMN \" + newColumna + \" \" + TipoDato);\n db.close();\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "void addColumn(String tableName, LinkedHashMap<String, String> columns)\n\t\t\tthrows SQLException {\n\t\tIterator<String> it = columns.keySet().iterator();\n\t\tString sql = (new StringBuilder(\"alter table \")).append(tableName)\n\t\t\t\t.append(\" add (\").toString();\n\t\twhile (it.hasNext()) {\n\t\t\tString columnName = it.next();\n\t\t\tif (it.hasNext())\n\t\t\t\tsql = (new StringBuilder(String.valueOf(sql)))\n\t\t\t\t\t\t.append(columnName).append(\" \")\n\t\t\t\t\t\t.append(columns.get(columnName)).append(\", \")\n\t\t\t\t\t\t.toString();\n\t\t\telse\n\t\t\t\tsql = (new StringBuilder(String.valueOf(sql)))\n\t\t\t\t\t\t.append(columnName).append(\" \")\n\t\t\t\t\t\t.append(columns.get(columnName)).toString();\n\t\t}\n\t\tsql = (new StringBuilder(String.valueOf(sql))).append(\")\").toString();\n\t\tstmt = con.createStatement();\n\t\tstmt.executeUpdate(sql);\n\t\tstmt.close();\n\t}", "public Column.Builder addColumnsBuilder() {\n return getColumnsFieldBuilder().addBuilder(\n Column.getDefaultInstance());\n }", "@Override\r\n\tpublic String getType() {\n\t\treturn \"column\";\r\n\t}", "public com.factset.protobuf.stach.v2.table.ColumnDefinitionProto.ColumnDefinition.Builder addColumnsBuilder() {\n return getColumnsFieldBuilder().addBuilder(\n com.factset.protobuf.stach.v2.table.ColumnDefinitionProto.ColumnDefinition.getDefaultInstance());\n }", "private <C> void addColumn(Cell<C> cell, String headerText, final GetValue<C> getter, FieldUpdater<AnswerProxy, C> fieldUpdater) {\n\t Column<AnswerProxy, C> column = new Column<AnswerProxy, C>(cell) {\n\t @Override\n\t public C getValue(AnswerProxy object) {\n\t return getter.getValue(object);\n\t }\n\t };\n\t column.setFieldUpdater(fieldUpdater);\n\t if (cell instanceof AbstractEditableCell<?, ?>) {\n\t editableCells.add((AbstractEditableCell<?, ?>) cell);\n\t }\n\t tableAnswer.addColumn(column, headerText);\n\t }", "public void addColumns(IfcTableColumn Columns)\n\t{\n\t\tif(this.Columns == null)\n\t\t\tthis.Columns = new LIST<IfcTableColumn>();\n\t\tthis.Columns.add(Columns);\n\t\tfireChangeEvent();\n\t}", "Col createCol();", "SqlColumns(String columnName){\n\t\t\t this.columnName = columnName; \n\t\t}", "public com.google.devtools.kythe.proto.Filecontext.ContextDependentVersion.Column.Builder addColumnBuilder() {\n return getColumnFieldBuilder().addBuilder(\n com.google.devtools.kythe.proto.Filecontext.ContextDependentVersion.Column.getDefaultInstance());\n }", "public com.walgreens.rxit.ch.cda.StrucDocCol addNewCol()\n {\n synchronized (monitor())\n {\n check_orphaned();\n com.walgreens.rxit.ch.cda.StrucDocCol target = null;\n target = (com.walgreens.rxit.ch.cda.StrucDocCol)get_store().add_element_user(COL$2);\n return target;\n }\n }", "private CellTable<CQLFunctionArgument> addColumnToTable(CellTable<CQLFunctionArgument> table,\n\t\t\tListHandler<CQLFunctionArgument> sortHandler) {\n\t\tif (table.getColumnCount() != TABLE_ROW_COUNT) {\n\t\t\tcom.google.gwt.user.client.ui.Label searchHeader = new com.google.gwt.user.client.ui.Label(\n\t\t\t\t\t\"Added Arguments List\");\n\t\t\tsearchHeader.getElement().setId(\"searchHeader_Label\");\n\t\t\tsearchHeader.setStyleName(\"measureGroupingTableHeader\");\n\t\t\tsearchHeader.getElement().setAttribute(\"tabIndex\", \"0\");\n\t\t\tcom.google.gwt.dom.client.TableElement elem = table.getElement().cast();\n\t\t\tTableCaptionElement caption = elem.createCaption();\n\t\t\tcaption.appendChild(searchHeader.getElement());\n\t\t\t\n\t\t\tMultiSelectionModel<CQLFunctionArgument> selectionModel = new MultiSelectionModel<CQLFunctionArgument>();\n\t\t\ttable.setSelectionModel(selectionModel);\n\t\t\tColumn<CQLFunctionArgument, SafeHtml> nameColumn = new Column<CQLFunctionArgument, SafeHtml>(\n\t\t\t\t\tnew SafeHtmlCell()) {\n\t\t\t\t\n\t\t\t\t@Override\n\t\t\t\tpublic SafeHtml getValue(CQLFunctionArgument object) {\n\t\t\t\t\tStringBuilder title = new StringBuilder();\n\t\t\t\t\tStringBuilder value = new StringBuilder(object.getArgumentName());\n\t\t\t\t\t\n\t\t\t\t\ttitle = title.append(\"Name : \").append(value);\n\t\t\t\t\t/*\n\t\t\t\t\t * return\n\t\t\t\t\t * CellTableUtility.getColumnToolTip(value.toString(),\n\t\t\t\t\t * title.toString());\n\t\t\t\t\t */\n\t\t\t\t\treturn getDataTypeColumnToolTip(value.toString(), title, object.isValid());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t};\n\t\t\ttable.addColumn(nameColumn, SafeHtmlUtils.fromSafeConstant(\"<span title=\\\"Name\\\">\" + \"Name\" + \"</span>\"));\n\t\t\t\n\t\t\tColumn<CQLFunctionArgument, SafeHtml> dataTypeColumn = new Column<CQLFunctionArgument, SafeHtml>(\n\t\t\t\t\tnew SafeHtmlCell()) {\n\t\t\t\t@Override\n\t\t\t\tpublic SafeHtml getValue(CQLFunctionArgument object) {\n\t\t\t\t\tStringBuilder title = new StringBuilder();\n\t\t\t\t\tStringBuilder value = new StringBuilder(object.getArgumentType());\n\t\t\t\t\tif (value.toString().equalsIgnoreCase(CQLWorkSpaceConstants.CQL_MODEL_DATA_TYPE)) {\n\t\t\t\t\t\tvalue = value.append(\":\").append(object.getQdmDataType());\n\t\t\t\t\t\tif (object.getAttributeName() != null) {\n\t\t\t\t\t\t\tvalue = value.append(\".\").append(object.getAttributeName());\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (value.toString().equalsIgnoreCase(CQLWorkSpaceConstants.CQL_OTHER_DATA_TYPE)) {\n\t\t\t\t\t\tvalue = value.append(\":\").append(object.getOtherType());\n\t\t\t\t\t}\n\t\t\t\t\ttitle = title.append(\"Datatype : \").append(value);\n\t\t\t\t\treturn CellTableUtility.getColumnToolTip(value.toString(), title.toString());\n\t\t\t\t}\n\t\t\t};\n\t\t\ttable.addColumn(dataTypeColumn,\n\t\t\t\t\tSafeHtmlUtils.fromSafeConstant(\"<span title=\\\"Datatype\\\">\" + \"Datatype\" + \"</span>\"));\n\t\t\t\n\t\t\tString colName = \"Modify\";\n\t\t\t\n\t\t\t// Modify by Delete Column\n\t\t\ttable.addColumn(\n\t\t\t\t\tnew Column<CQLFunctionArgument, CQLFunctionArgument>(getCompositeCellForQDMModifyAndDelete()) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic CQLFunctionArgument getValue(CQLFunctionArgument object) {\n\t\t\t\t\t\t\treturn object;\n\t\t\t\t\t\t}\n\t\t\t\t\t}, SafeHtmlUtils.fromSafeConstant(\"<span title='\" + colName + \"'> \" + colName + \"</span>\"));\n\t\t\t\n\t\t\ttable.setColumnWidth(0, 25.0, Unit.PCT);\n\t\t\ttable.setColumnWidth(1, 35.0, Unit.PCT);\n\t\t\ttable.setColumnWidth(2, 10.0, Unit.PCT);\n\t\t}\n\t\treturn table;\n\t}", "public void addQueryDependendColumn(Column col) {\n queryDependendCollumns.add(col);\n\n }", "private void checkAddColumn(Table t, Column c) throws HsqlException {\n\n boolean canAdd = true;\n\n if (t.findColumn(c.columnName.name) != -1) {\n throw Trace.error(Trace.COLUMN_ALREADY_EXISTS, c.columnName.name);\n }\n\n if (c.isPrimaryKey() && t.hasPrimaryKey()) {\n canAdd = false;\n }\n\n if (canAdd && !t.isEmpty(session)) {\n canAdd = c.isNullable() || c.getDefaultExpression() != null;\n }\n\n if (!canAdd) {\n throw Trace.error(Trace.BAD_ADD_COLUMN_DEFINITION);\n }\n }", "java.lang.String getColumn();", "public void addColumn(boolean start)\r\n\t{\r\n\t\t//definicion del tamaņo\r\n\t\tint width = 100;\r\n\t\tint height = 50 + rand.nextInt(300);\r\n\r\n\t\tif (start)\r\n\t\t{\r\n\t\t\tcolumns.add(new Rectangle(WIDTH + width + columns.size() * 300, HEIGHT - height - 120, width, height));\r\n\t\t\tcolumns.add(new Rectangle(WIDTH + width + (columns.size() - 1) * 300, 0, width, HEIGHT - height - space));\r\n\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tcolumns.add(new Rectangle(columns.get(columns.size() - 1).x + 600, HEIGHT - height - 120, width, height));\r\n\t\t\tcolumns.add(new Rectangle(columns.get(columns.size() - 1).x, 0, width, HEIGHT - height - space));\r\n\t\t}\r\n\t}", "public void addColumn(boolean start) {\n\t\t// size variables for columns\n\t\tint space = 300;\n\t\tint width = 100;\n\t\tint height = 50 + r.nextInt(300);\n\t\t\n\t\t// adds columns at beginning of the game\n\t\tif (start) {\n\t\t\tcolumns.add(new Rectangle(WIDTH + width + columns.size() *300, HEIGHT - height -120,\n\t\t\t\t\twidth, height));\n\t\t\t\n\t\t\tcolumns.add(new Rectangle(WIDTH + width + (columns.size() -1) * 300, 0, \n\t\t\t\t\twidth, HEIGHT - height - space));\n\t\t}\n\t\t\n\t\t// adds columns throughout the game\n\t\telse {\n\t\t\tcolumns.add(new Rectangle(columns.get(columns.size() -1).x+600, HEIGHT - height -120,\n\t\t\t\t\twidth, height));\n\t\t\t\n\t\t\tcolumns.add(new Rectangle(columns.get(columns.size() -1).x, 0, \n\t\t\t\t\twidth, HEIGHT - height - space));\n\t\t}\n\t}", "public void addColumnSpec(ColumnSpec columnSpec) {\n\t\tif (columnSpec == null) {\n\t\t\tthrow new SqlException(\"The columnSpec cannot be null\");\n\t\t}\n\t\tthis.getColumnSpecs().add(columnSpec);\n\t}", "public static void addColumn(Database adapter, String tableName, DbField field) {\r\n DbTable table = new DbTable();\r\n table.setT(tableName);\r\n adapter.addColumn(table, field);\r\n }", "public void add(int column){\n\t\tif(turn == \"blue\"){\n\t\t\tboard.AddBlue(column);\n\t\t\t\n\t\t}else{\n\t\t\tboard.AddRed(column);\n\t\t}\n\t\tthis.changeTurn();\n\t}", "public void onAddNewCond() {\n dbConn.logUIMsg(RLogger.MSG_TYPE_INFO, RLogger.LOGGING_LEVEL_DEBUG, \"TableManagerBean.class :: onAddNew() :: Adding new Column\");\n ColList newCol = new ColList();\n newCol.setCol_name(\"COL\");\n newCol.setCol_value(\"VAL\");\n this.getCondColumnList().add(newCol);\n }", "public boolean addColumn(String colName) {\n\t\tif (!Strings.isNullOrEmpty(colName)) {\n\t\t\tif (!mColIdxByNameMap.containsKey(colName)) {\n\t\t\t\tmColIdxByNameMap.put(colName, mNumCols);\n\n\t\t\t\tmNumCols++;\n\n\t\t\t\tfor (List<String> colDataList : mDataByID.values()) {\n\t\t\t\t\tcolDataList.add(null);\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (LOGGER.isDebugEnabled()) {\n\t\t\t\t\tLOGGER.debug(\"Column name \\\"\" + colName + \"\\\" already exists.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif (LOGGER.isDebugEnabled()) {\n\t\t\t\tLOGGER.debug(\"Must provide a column name.\");\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public int getColumn()\t \t\t{ return column; \t}", "public final MF addColumnDefinition(String column, ColumnDefinition<K, ?> columnDefinition) {\n\t\tcolumnDefinitions.addColumnDefinition(column, columnDefinition);\n\t\treturn (MF) this;\n\t}", "public Builder addColumn(\n int index, com.google.devtools.kythe.proto.Filecontext.ContextDependentVersion.Column value) {\n if (columnBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureColumnIsMutable();\n column_.add(index, value);\n onChanged();\n } else {\n columnBuilder_.addMessage(index, value);\n }\n return this;\n }", "public void addColumn(double value)\n {\n addColumn(getDetailCell(value));\n }", "@SuppressWarnings(\"null\")\r\n\tpublic void addColumnValue(Column column, Object value)\r\n\t{\r\n\t\tint type = ZConstant.UNKNOWN;\r\n\t\tif(value == null)\r\n\t\t\ttype = ZConstant.NULL;\r\n\t\telse if(value instanceof Number)\r\n\t\t\ttype = ZConstant.NUMBER;\r\n\t\telse if(value instanceof String)\r\n\t\t\ttype = ZConstant.STRING;\r\n\t\tZConstant right = new ZConstant(value.toString(), type);\r\n\t\t\r\n\t\tcolumnValues.put(column.getName(), right);\r\n\t}", "private void addColumns() {\n\n List<Integer> colIds = new ArrayList<>();\n List<String> colNames = new ArrayList<>();\n List<ColumnDescriptor> tupleDescription = context.getTupleDescription();\n for (int i = 0; i < tupleDescription.size(); i++) {\n ColumnDescriptor col = tupleDescription.get(i);\n if (col.isProjected() && hiveIndexes.get(i) != null) {\n colIds.add(hiveIndexes.get(i));\n colNames.add(col.columnName());\n }\n }\n jobConf.set(READ_ALL_COLUMNS, \"false\");\n jobConf.set(READ_COLUMN_IDS_CONF_STR, StringUtils.join(colIds, \",\"));\n jobConf.set(READ_COLUMN_NAMES_CONF_STR, StringUtils.join(colNames, \",\"));\n }", "public void addColumn(Column column) {\r\n\t\tIterator<Column> it = columns.iterator();\r\n\t\t\r\n\t\twhile(it.hasNext()) {\r\n\t\t\tColumn col = it.next();\r\n\t\t\tif(col.getRuleName().equals(column.getRuleName()))\r\n\t\t\t\t\tit.remove();\r\n\t\t}\r\n\t\tcolumns.add(column);\r\n\t}", "void addField(\n JavaSymbolName propertyName,\n JavaType propertyType,\n String columnName,\n String columnType,\n JavaType className\n );", "public String[] addColumn(String date) {\r\n\t\tdateColCount++;\r\n\r\n\t\t//initailizing variables\r\n\t\tint newSize = headerRow.length + 1;\r\n\t\tString[] temp = new String[newSize];\r\n\r\n\t\t//for loop to copy info from column and add date to temp\r\n\t\tfor(int i = 0; i < newSize; i++) {\r\n\t\t\tif( i < headerRow.length) {\r\n\t\t\t\ttemp[i] = headerRow[i];\r\n\t\t\t}else {\r\n\t\t\t\ttemp[i] = date;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//save new column info\r\n\t\tsetColumninfo(temp);\r\n\t\treturn temp;\r\n\t}", "@Override\r\n\tprotected String defineColumn(ColumnDefinition columnDefinition) {\n\t\treturn null;\r\n\t}", "public void addColumn(final IColumn column, Component component, final IRenderable renderable,\n\t\tPosition position)\n\t{\n\t\tif (component != null)\n\t\t{\n\t\t\tadd(component);\n\t\t}\n\n\t\tif (column.isVisible())\n\t\t{\n\t\t\tif (position == Position.APPEND)\n\t\t\t{\n\t\t\t\tcolumns.add(column);\n\t\t\t\tcomponents.add(component);\n\t\t\t\trenderables.add(renderable);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcolumns.add(0, column);\n\t\t\t\tcomponents.add(0, component);\n\t\t\t\trenderables.add(0, renderable);\n\t\t\t}\n\t\t}\n\t}", "public void addColumn(boolean value)\n {\n addColumn(value ? \"X\" : \"\", Element.ALIGN_CENTER, Color.WHITE);\n }", "public void addColumn(Class classType, boolean readOnly, String header)\n\t{\n\t\tm_modelHeaderClass.add(classType);\n\n\t\tsetColumnReadOnly(m_modelHeaderClass.size() - 1, readOnly);\n\n\t\taddColumn(header);\n\n\t\tWListItemRenderer renderer = (WListItemRenderer)getItemRenderer();\n\t\trenderer.setColumnClass((renderer.getNoColumns() - 1), classType);\n\n \t\treturn;\n\t}", "@Override\n\tpublic int getColumnCount() {\n\t\treturn columns.length;\n\t}", "public Builder addColumns(com.factset.protobuf.stach.v2.table.ColumnDefinitionProto.ColumnDefinition value) {\n if (columnsBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureColumnsIsMutable();\n columns_.add(value);\n onChanged();\n } else {\n columnsBuilder_.addMessage(value);\n }\n return this;\n }", "public int getColumn()\n {\n return col;\n }", "@Override\n\tpublic int getColumnCount() {\n\t\treturn this.columnName.size();\n\t}", "@Override\n public int getColumnCount() {\n return colName.length;\n }", "@Override\n public int getColumnCount() {\n return columname.length;\n \n }", "@Override\r\n\tpublic int getColumnCount() {\n\t\treturn columnName.length;\r\n\t}", "public final MF addColumnDefinition(Predicate<? super K> predicate, ColumnDefinition<K, ?> columnDefinition) {\n\t\tcolumnDefinitions.addColumnDefinition(predicate, columnDefinition);\n\t\treturn (MF) this;\n\t}", "public int addColumns(DBField cols[], int ndx)\n throws DBException\n {\n try {\n return this._addColumns(cols, ndx);\n } catch (SQLException sqe) {\n throw new DBException(\"Adding/Altering column\", sqe);\n }\n }", "public void addColumns(Column[] cols) {\n\n\t\t//\t\t\tAllocate a new array.\n\t\tint number = cols.length;\n\t\tint cnt = columns.length + number;\n\t\tColumn[] newColumns = new Column[cnt];\n\n\t\t// copy current columns.\n\t\tSystem.arraycopy(columns, 0, newColumns, 0, columns.length);\n\n\t\t//\t\t\tANCA: need to expand the Column[] cols\n\n\t\tfor (int k = 0; k < cols.length; k++) {\n\n\t\t\tString columnClass = (cols[k].getClass()).getName();\n\t\t\tColumn expandedColumn = null;\n\n\t\t\t//if col is the first column in the table add it as is and initialize subset\n\t\t\tint numRows = super.getNumRows();\n\t\t\tif (columns.length == 0) {\n\t\t\t\tif (subset.length == 0) {\n\t\t\t\t\tnumRows = cols[k].getNumRows();\n\t\t\t\t\tsubset = new int[numRows];\n\t\t\t\t\tfor (int i = 0; i < this.getNumRows(); i++) {\n\t\t\t\t\t\tsubset[i] = i;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// LAM-tlr, I moved this down from inside the above condition. If it is\n\t\t\t\t// inside the condition above, after the first column is added, the rest of\n\t\t\t\t// the columns are empty.\n\t\t\t\texpandedColumn = cols[k];\n\t\t\t} else {\n\t\t\t\t// LAM-tlr, I moved this down from above. If we are to use the column\n\t\t\t\t// as is, we don't need to reallocate it.\n\t\t\t\ttry {\n\t\t\t\t\texpandedColumn =\n\t\t\t\t\t\t(Column) Class.forName(columnClass).newInstance();\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tSystem.out.println(e);\n\t\t\t\t}\n\t\t\t\texpandedColumn.addRows(numRows);\n\t\t\t\texpandedColumn.setLabel(cols[k].getLabel());\n\t\t\t\texpandedColumn.setComment(cols[k].getComment());\n\t\t\t\texpandedColumn.setIsScalar(cols[k].getIsScalar());\n\t\t\t\texpandedColumn.setIsNominal(cols[k].getIsNominal());\n\n\t\t\t\t//initialize all values as missing for the beginning\n\t\t\t\tfor (int j = 0; j < numRows; j++)\n\t\t\t\t\texpandedColumn.setValueToMissing(true, j);\n\n\t\t\t\t//set the elements of the column where appropriate as determined by subset\n\t\t\t\tObject el;\n\t\t\t\tfor (int i = 0; i < subset.length; i++) {\n\t\t\t\t\tel = cols[k].getObject(i);\n\t\t\t\t\texpandedColumn.setObject(el, subset[i]);\n\t\t\t\t\texpandedColumn.setValueToMissing(false, subset[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tnewColumns[columns.length + k] = expandedColumn;\n\t\t}\n\t\tcolumns = newColumns;\n\n\t}", "String getColumn();", "public void addFileColNumber (int colnum){\n file_column_numbers.add(colnum);\n }" ]
[ "0.8677819", "0.8555853", "0.81253237", "0.7861406", "0.78356594", "0.77474177", "0.7672448", "0.76142406", "0.76005113", "0.7568359", "0.7482872", "0.7353109", "0.7336485", "0.73363936", "0.73177344", "0.7274911", "0.721509", "0.7175108", "0.7152567", "0.71420324", "0.7052906", "0.70404285", "0.6931257", "0.6913279", "0.6832821", "0.6815732", "0.6798375", "0.6768603", "0.67685115", "0.6752914", "0.67459685", "0.67434263", "0.67396677", "0.6725936", "0.6723379", "0.66914576", "0.6677293", "0.66766405", "0.66663224", "0.66567725", "0.6649605", "0.6612239", "0.66005343", "0.65959305", "0.6564258", "0.6557551", "0.65415376", "0.65119064", "0.64917374", "0.64917374", "0.6477375", "0.6459437", "0.64486706", "0.6436171", "0.64012104", "0.6342033", "0.6336818", "0.6311048", "0.6302117", "0.6295544", "0.62820506", "0.62600315", "0.623991", "0.6236146", "0.62313944", "0.6228859", "0.62190276", "0.62012887", "0.6198174", "0.61920184", "0.61902076", "0.61833006", "0.6181789", "0.61797947", "0.6175794", "0.6157645", "0.6151838", "0.61427414", "0.6140829", "0.6132911", "0.6120925", "0.61173105", "0.61118394", "0.61118144", "0.6109301", "0.6080585", "0.60722464", "0.6069503", "0.6026846", "0.6017124", "0.6013065", "0.60049796", "0.599997", "0.5994601", "0.5988965", "0.59851706", "0.5959911", "0.59419525", "0.5939654", "0.5936611" ]
0.80574566
3
Description of the method deleteColumn.
public void deleteColumn(Column column) { // Start of user code for method deleteColumn // End of user code }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void removeColumn(String columnName);", "public void onDelete(Statement delete, Connection cx, SimpleFeatureType featureType) throws SQLException {\r\n }", "handy.storage.api.ColumnCondition<DeleteOperation<T>> where(String column);", "public void deleteColumn(final byte [] tableName, final byte [] columnName)\n throws IOException {\n if (this.master == null) \n throw new MasterNotRunningException(\"master has been shut down\");\n \n DBTableDescriptor.isLegalTableName(tableName);\n try {\n this.master.deleteColumn(tableName, columnName);\n } catch (RemoteException e) {\n throw RemoteExceptionHandler.decodeRemoteException(e);\n }\n }", "@FXML\n public void deleteColumn() {\n try {\n foreignCarCompareController.getMainHbox().getChildren().remove(nextGridPane);\n //nextGridPane.getChildren().clear();\n foreignMainController.getListOfGridPaneColumns().remove(nextGridPane);\n //System.out.println(\"size after removing: \" + foreignMainController.getListOfGridPaneColumns().size());\n setIdentifyColumnForDelete(1);\n } catch (Exception e) {\n DialogWindows.errorDialog(e.getMessage());\n }\n }", "void deleteColumns(String columnFamily, String key, String... columns);", "@Override\n\tpublic void delete(String... args) throws SQLException {\n\t\t\n\t}", "public void deleteColumn(final String tableName, final String columnName)\n throws IOException {\n deleteColumn(Bytes.toBytes(tableName), Bytes.toBytes(columnName));\n }", "@Override\n\tpublic void delete(String key) throws SQLException {\n\t\t\n\t}", "@Override\n\tpublic boolean delete(String sql) {\n\t\treturn false;\n\t}", "public void deleteColumn(int column)\n throws JPARSECException {\n \tif (column >= n || column < 0)\n \t\tthrow new JPARSECException(\"invalid column.\");\n double newData[][] = new double[m][n-1];\n\n for (int i=0; i<m; i++)\n {\n \tint jindex = -1;\n for (int j=0; j<n; j++)\n {\n \tif (j != column) {\n \t\tjindex ++;\n \tnewData[i][jindex] = this.data[i][j];\n \t}\n }\n }\n Matrix m = new Matrix(newData);\n this.n = m.n;\n this.data = m.data;\n }", "public void removeColumn(Column c) {\n\t this.columns.remove(c);\n\t }", "@Override\r\n\tpublic void columnRemoved(TableColumnModelEvent e) {\n\t\t\r\n\t}", "@Test\n public void testDeleteColumn() throws Exception {\n RowKeyFormat2 format = makeHashPrefixedRowKeyFormat();\n // Reference layout with a single column : \"family_name:column_name\"\n final TableLayoutDesc refDesc = TableLayoutDesc.newBuilder()\n .setName(\"table_name\")\n .setKeysFormat(format)\n .setVersion(TABLE_LAYOUT_VERSION)\n .setLocalityGroups(Lists.newArrayList(\n makeMinimalLocalityGroup()))\n .build();\n final FijiTableLayout refLayout = FijiTableLayout.newLayout(refDesc);\n\n {\n // Target layout deleting the column\n final TableLayoutDesc desc = TableLayoutDesc.newBuilder()\n .setName(\"table_name\")\n .setKeysFormat(format)\n .setVersion(TABLE_LAYOUT_VERSION)\n .setLocalityGroups(Lists.newArrayList(\n LocalityGroupDesc.newBuilder()\n .setName(\"locality_group_name\")\n .setInMemory(false)\n .setTtlSeconds(84600)\n .setMaxVersions(1)\n .setCompressionType(CompressionType.GZ)\n .setFamilies(Lists.newArrayList(\n FamilyDesc.newBuilder()\n .setName(\"family_name\")\n .setColumns(Lists.newArrayList(\n ColumnDesc.newBuilder()\n .setName(\"column_name\")\n .setColumnSchema(CellSchema.newBuilder()\n .setStorage(SchemaStorage.UID)\n .setType(SchemaType.INLINE)\n .setValue(\"\\\"string\\\"\")\n .build())\n .setDelete(true)\n .build()))\n .build()))\n .build()))\n .build();\n final FijiTableLayout layout = FijiTableLayout.createUpdatedLayout(desc, refLayout);\n final FijiTableLayout.LocalityGroupLayout.FamilyLayout fLayout =\n layout.getFamilyMap().get(\"family_name\");\n assertNotNull(fLayout);\n assertTrue(fLayout.getColumns().isEmpty());\n assertTrue(fLayout.getColumnMap().isEmpty());\n }\n\n {\n // Target layout with an invalid column deletion\n final TableLayoutDesc desc = TableLayoutDesc.newBuilder()\n .setName(\"table_name\")\n .setKeysFormat(format)\n .setVersion(TABLE_LAYOUT_VERSION)\n .setLocalityGroups(Lists.newArrayList(\n LocalityGroupDesc.newBuilder()\n .setName(\"locality_group_name\")\n .setInMemory(false)\n .setTtlSeconds(84600)\n .setMaxVersions(1)\n .setCompressionType(CompressionType.GZ)\n .setFamilies(Lists.newArrayList(\n FamilyDesc.newBuilder()\n .setName(\"family_name\")\n .build()))\n .build()))\n .build();\n try {\n FijiTableLayout.createUpdatedLayout(desc, refLayout);\n Assert.fail(\"Layout update with missing column did not fail.\");\n } catch (InvalidLayoutException ile) {\n // Exception is expected!\n }\n }\n\n {\n // Target layout with an invalid column rename\n final TableLayoutDesc desc = TableLayoutDesc.newBuilder()\n .setName(\"table_name\")\n .setKeysFormat(format)\n .setVersion(TABLE_LAYOUT_VERSION)\n .setLocalityGroups(Lists.newArrayList(\n LocalityGroupDesc.newBuilder()\n .setName(\"locality_group_name\")\n .setInMemory(false)\n .setTtlSeconds(84600)\n .setMaxVersions(1)\n .setCompressionType(CompressionType.GZ)\n .setFamilies(Lists.newArrayList(\n FamilyDesc.newBuilder()\n .setName(\"family_name\")\n .setColumns(Lists.newArrayList(\n ColumnDesc.newBuilder()\n .setName(\"column-renamed\")\n .setColumnSchema(CellSchema.newBuilder()\n .setStorage(SchemaStorage.UID)\n .setType(SchemaType.INLINE)\n .setValue(\"\\\"string\\\"\")\n .build())\n .build()))\n .build()))\n .build()))\n .build();\n try {\n FijiTableLayout.createUpdatedLayout(desc, refLayout);\n Assert.fail(\"Invalid layout update with bad column renaming did not throw.\");\n } catch (InvalidLayoutException ile) {\n // Expected\n }\n }\n }", "@Override\r\n\tpublic String delete() {\n\t\treturn \"delete\";\r\n\t}", "int delete(String tableName, String selectionCriteria, String[] selectionArgs);", "@Override\n public void delete(Integer key) throws SQLException {\n //Ei toteutettu\n }", "public void delete()\n\t{\n\t\t_Status = DBRowStatus.Deleted;\n\t}", "public void delete() throws SQLException {\r\n\t\t//SQL Statement\r\n\r\n\t\tString sql = \"DELETE FROM \" + table+ \" WHERE \" + col_genreID + \" = ?\";\r\n\t\tPreparedStatement stmt = DBConnection.getConnection().prepareStatement(sql);\r\n\t\tstmt.setInt(1, this.getGenreID());\r\n\r\n\t\tint rowsDeleted = stmt.executeUpdate();\r\n\t\tSystem.out.println(\"Es wurden \"+rowsDeleted+ \"Zeilen gelöscht\");\r\n\t\tstmt.close();\r\n\t}", "@Override\n\tpublic Long deleteUnreferenced(String fileType, RelationalPathBase<?> relationalPathBase, NumberPath<Long> column) {\n\t\t\n\t\treturn transactionManagerQuerydsl\n\t\t\t\t.delete(QFile.file)\n\t\t\t\t.where(QFile.file.fileType.eq(fileType))\n\t\t\t\t.where(QFile.file.id.notIn(\n\t\t\t\t\tJPAExpressions\n\t\t\t\t\t\t.select(column)\n\t\t\t\t\t\t.from(relationalPathBase)\n\t\t\t\t))\n\t\t\t\t.execute();\n\t}", "@Override\n public String[] getDropColumnSQL(Column column) {\n return new String[] { \"ALTER TABLE \"\n + getFullName(column.getTable(), false) + \" DROP \" + getColumnDBName(column) };\n }", "@DELETE\n public void delete() {\n }", "@DELETE\n public void delete() {\n }", "@Override\n\tpublic int delete(int id) throws SQLException {\n\t\treturn 0;\n\t}", "@Override\r\n\tpublic void delete(int no) {\n\t\tsqlSession.delete(namespace + \".delete\", no);\r\n\t}", "@Override\r\n\tpublic void delete(int no) {\n\t\tsqlSession.delete(namespace + \".delete\", no);\r\n\t}", "@Override\n\tpublic void delete(String arg0) {\n\t\t\n\t}", "@Override\r\n\tpublic void delete(TQssql sql) {\n\r\n\t}", "@Override\n\tpublic void delete(Integer id) throws SQLException {\n\t\t\n\t}", "@DeleteProvider(type = CsvFileSqlProvider.class, method = \"deleteByExample\")\n\tint deleteByExample(CsvFileExample example);", "public void removeColumn(int columnIndex) throws IndexOutOfBoundsException {\n\t\tResultViewerColumnInfo columnInfo = null;\n\t\tSetColumnVisibleAction action = null;\n\t\t//--Remove column info\n\t\tif(columnIndex <= columns.size())\n\t\t\tcolumnInfo = (ResultViewerColumnInfo)columns.remove(columnIndex);\n\t\t//--Set context menu action unchecked\n\t\tif(columnInfo != null){\n\t\t\taction = (SetColumnVisibleAction)contextMenuActions.get(columnInfo.getColumnType());\n\t\t\tif(action != null){\n\t\t\t\taction.setChecked(false);\n\t\t\t}\n\t\t}\n\t\t//--Disable sorting when sorted column was removed\n\t\tif(sorter != null && sorter.isSorterProperty(null, columnInfo.getColumnType()))\n\t\t\tsorter.setSortedColumn(-1, null);\n\t\t//--Change columns of underlying table\n\t\t//Table table = wrapedViewer.getTree().getTable();\n\t\t\n\t\tTree table = wrapedViewer.getTree();\n\t\tif(table.getColumnCount() > 0){\n\t\t\t//--Dispose last column\n\t\t\tTreeColumn tableColumn = table.getColumn(table.getColumnCount()-1);\n\t\t\ttableColumn.dispose();\n\t\t\t//--Set columns' info and change sorting\n\t\t\tfor(int i=0; i<columns.size(); i++){\n\t\t\t\tResultViewerColumnInfo colInf = (ResultViewerColumnInfo)columns.get(i);\n\t\t\t\tif(sorter.isSorterProperty(null, colInf.getColumnType())){\n\t\t\t\t\tsorter.setSortedColumn(i, colInf.getColumnType());\n\t\t\t\t\ttable.getColumn(i).setText(colInf.getColumnName() + \" *\");\n\t\t\t\t}else{\n\t\t\t\t\ttable.getColumn(i).setText(colInf.getColumnName());\n\t\t\t\t}\n\t\t\t\ttable.getColumn(i).setWidth(colInf.getWidth());\n\t\t\t}\n\t\t}\n\t\twrapedViewer.refresh();\n\t}", "@DELETE\n public void delete() {\n }", "public int delete(String whereClause,String[] whereArgs){\n return db.delete(Funcoes,whereClause,whereArgs);\n }", "public void removeColumn(TableColumn aColumn) {\n\t\tObject id = aColumn.getIdentifier();\n\t\tif (hiddenCols.containsKey(id))\n\t\t\thiddenCols.remove(id);\n\t\telse\n\t\t\tsuper.removeColumn(aColumn);\n\t\tJCheckBoxMenuItem item = (JCheckBoxMenuItem) itemMap.remove(id);\n\t\titem.removeActionListener(actionListener);\n\t\tidMap.remove(item);\n\t\tpopup.remove(item);\n\t\tif (getColumnCount() == 0) {\n\t\t\tresetHiddenCols();\n\t\t}\n\t}", "public void removeColumn(int i)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_element(COLUMN$0, i);\r\n }\r\n }", "public void deleteCertainRow(String itemname, String tableName, String columnName) throws SQLException\n {\n\n String deletetStr=\"DELETE FROM \"+tableName+\" WHERE \"+columnName+\" = \"+quotate(itemname);\n stmt.executeUpdate(deletetStr);\n return;\n\n }", "public void removeColumn (String columnName) {\n if (columnName == null) {\n return;\n }\n int colIndex = header.indexOf(columnName);\n removeColumn(colIndex);\n }", "public void OFFtestDeleteQueryColumnIDs() throws ScarabException\n {\n AttributeAccess aa = DAFactory.getAttributeAccess();\n String userID = \"1\";\n String listID = \"1\";\n String moduleID = \"5\";\n String artifactTypeID = \"1\";\n aa.deleteQueryColumnIDs(userID, listID, moduleID, artifactTypeID);\n // TODO: finish\n }", "@Override\n public int delete(String arg0) {\n return 0;\n }", "@Override\n\tpublic void delete(Connection c, Integer id) throws SQLException {\n\n\t}", "@Override\n\tpublic void doDelete(String product) throws SQLException {\n\t\t\n\t}", "@Override\n\tpublic String getPreparedDeleteText() {\n\t\treturn SQL_Delete;\n\t}", "@Nullable\n public TupleExpr getDeleteExpr() {\n return this.deleteExpr;\n }", "java.lang.String getColumn();", "public CustomSql getCustomSqlDelete();", "public void delete() {\n\n\t}", "public boolean del(String where) {\n return db.delete (TABLE, where);\n }", "public void deleteCertainRow(String itemname1,String itemname2, String tableName, String columnName1,String columnName2) throws SQLException\n {\n\n String deletetStr = \"DELETE FROM \"+tableName+\" WHERE \"+columnName1+\" = \"+quotate(itemname1)+\"AND \"+columnName2+\" = \"+quotate(itemname2);\n stmt.executeUpdate(deletetStr);\n return;\n\n }", "private void delete(ByteBuffer rowKey,\n Clustering<?> clustering,\n DeletionTime deletion,\n WriteContext ctx)\n {\n DecoratedKey valueKey = getIndexKeyFor(getIndexedValue(rowKey,\n clustering,\n null));\n doDelete(valueKey,\n buildIndexClustering(rowKey, clustering, null),\n deletion,\n ctx);\n }", "@Override\r\n\tpublic int deleteOne(int idx) throws SQLException {\n\t\treturn 0;\r\n\t}", "String getColumn();", "@Override\r\n\tpublic int fileDelete(int no) {\n\t\treturn sqlSession.delete(namespace + \"fileDelete\", no);\r\n\t}", "public void eliminarValor(String tabla, String columnaID, String datoABorrar){\n try {\n Statement stmt = Conexion.getInstancia().createStatement();\n stmt.executeUpdate(\"DELETE From \"+tabla+\" Where \"+columnaID+\" = \"+datoABorrar+\";\");\n }\n catch (Exception ex){\n ex.printStackTrace();\n }\n }", "public void delete() {\n\n }", "@Delete({ \"delete from csv_file\", \"where id = #{id,jdbcType=INTEGER}\" })\n\tint deleteByPrimaryKey(Integer id);", "@Override\r\n\tpublic void k_delete(String MF_NO) {\n\t\t\r\n\t}", "public int getColumn();", "@Override\n\tprotected String deleteStatement() {\n\t\treturn null;\n\t}", "public boolean delete(String id){\n SQLiteDatabase sqliteDatabase = this.getWritableDatabase();\n sqliteDatabase.delete(tableName,col_1+\" = ?\",new String[]{id});\n return true;\n }", "private void delete(ByteBuffer rowKey,\n Clustering<?> clustering,\n Cell<?> cell,\n WriteContext ctx,\n long nowInSec)\n {\n DecoratedKey valueKey = getIndexKeyFor(getIndexedValue(rowKey,\n clustering,\n cell));\n doDelete(valueKey,\n buildIndexClustering(rowKey, clustering, cell),\n DeletionTime.build(cell.timestamp(), nowInSec),\n ctx);\n }", "int getColumn();", "public void delete(MDSKey id) {\n try {\n table.delete(id.getKey(), COLUMN);\n } catch (Exception e) {\n throw Throwables.propagate(e);\n }\n }", "public int deleteByExample(ElemFeatureExample example) throws SQLException {\r\n\t\tint rows = getSqlMapClientTemplate().delete(\r\n\t\t\t\t\"cementerio_elem_feature.ibatorgenerated_deleteByExample\",\r\n\t\t\t\texample);\r\n\t\treturn rows;\r\n\t}", "@Delete({\n \"delete from test_module\",\n \"where id = #{id,jdbcType=VARCHAR}\"\n })\n int deleteByPrimaryKey(String id);", "public Criteria andDeletedEqualToColumn(LitemallOrder.Column column) {\n addCriterion(new StringBuilder(\"deleted = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "final void delete(int param1) {\n }", "public int deleteIndex(FeatureRow row) {\n return deleteIndex(row.getId());\n }", "@Override\n\tpublic boolean delete() {\n\t\tString sql=\"DELETE FROM tc_student where id=\"+id;\n\t\t//`\n\t\t\n\t\tSystem.out.println(sql);\n\t\treturn mysql.execute(sql);\n\t}", "int deleteByExample(Assist_tableExample example);", "public Criteria andDeletedEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"deleted = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "public Integer deleteData(String name) {\n SQLiteDatabase db = this.getWritableDatabase();\n int i = db.delete(TABLE_NAME, col1 + \" =?\", new String[]{name});\n return i;\n }", "public int getColumn()\n {\n return column;\n }", "public void delete(){\r\n\r\n }", "public interface Delete<T extends Model> {\n\n\t/**\n\t * Executes the operation.\n\t *\n\t * @return the number of the deleted rows.\n\t * @throws OperationException if any error happen\n\t */\n\tint execute() throws OperationException;\n\n\t/**\n\t * Executes the operation. Returns <code>-1</code> if any error happen.\n\t *\n\t * @return the number of the deleted rows.\n\t */\n\tint executeSafely();\n\n\t/**\n\t * Builds a filtering expression for this operation.\n\t *\n\t * @param column a column's name from the table\n\t */\n\thandy.storage.api.ColumnCondition<DeleteOperation<T>> where(String column);\n\n\t/**\n\t * Sets a filtering expression for this operation.\n\t *\n\t * @param expression a {@link Expression} object built for this table.\n\t * @return this object\n\t * @throws IllegalArgumentException if passed expression was built for another table\n\t */\n\tDeleteOperation<T> where(Expression expression);\n\n\t/**\n\t * Limits the number of rows to delete. Use {@link #orderBy(String)} and\n\t * {@link #orderBy(String, Order)} to set a rule which rows should be\n\t * deleted first.\n\t *\n\t * @param limit mux number of items to delete\n\t * @return this object\n\t */\n\tDelete<T> limit(int limit);\n\n\t/**\n\t * Adds a column to order by during deleting. Use it only simultaneously\n\t * with {@link #limit(int)}.\n\t *\n\t * @param column column to order by\n\t * @return this object\n\t */\n\tDelete<T> orderBy(String column);\n\n\t/**\n\t * Adds a column to order by during deleting. Use it only simultaneously\n\t * with {@link #limit(int)}.\n\t *\n\t * @param column column to order by\n\t * @param order ascending or descending\n\t * @return this object\n\t */\n\tDelete<T> orderBy(String column, Order order);\n\n}", "@Override\n\tpublic void delete(Long primaryKey) {\n\t\t\n\t}", "int deleteByExample(CTipoComprobanteExample example) throws SQLException;", "public int del(){\n int cnt = mDB.delete(DATABASE_TABLE, null , null);\n return cnt;\n }", "int deleteByPrimaryKey(String fucno);", "@Override\n\tpublic void delete(Integer arg0) {\n\t\t\n\t}", "public boolean del() {\n return db.delete (TABLE, createWhere());\n }", "public int delete(int ano, QueryRunner queryRunner, Connection connection)\n\t\t\tthrows SQLException {\n\t\treturn 0;\n\t}", "public void delete() throws SQLException {\n DatabaseConnector.updateQuery(\"DELETE FROM course \"\n + \"WHERE courseDept='\" + this.courseDept \n + \"' AND courseNum = '\" + this.courseNum + \"'\");\n }", "public int getColumn() {\n return column;\n }", "public int getColumn() {\n return column;\n }", "public int getColumn() {\n return column;\n }", "@Override\n\tpublic void deleteById(int id) throws SQLException {\n\n\t}", "public void delete(int id) throws SQLException {\n\t\t\r\n\t}", "public int getColumn() {\r\n return column;\r\n }", "public int getColumn() {\r\n return column;\r\n }", "public int deleteByWhere(String where) throws SQLException\n {\n Connection c = null;\n PreparedStatement ps = null;\n\n try\n {\n c = getConnection();\n String delByWhereSQL = \"DELETE FROM sampletype \" + where;\n ps = c.prepareStatement(delByWhereSQL);\n return ps.executeUpdate();\n }\n finally\n {\n getManager().close(ps);\n freeConnection(c);\n }\n }", "@Override\r\n\tpublic void delete(Integer arg0) {\n\t\t\r\n\t}", "public abstract int getColumn();", "com.google.spanner.v1.Mutation.Delete getDelete();", "void columnRemoved(Sheet s, int sheetIndex, int col)\r\n/* 191: */ {\r\n/* 192:347 */ this.parser.columnRemoved(sheetIndex, col, s == getSheet());\r\n/* 193:348 */ this.formulaBytes = this.parser.getBytes();\r\n/* 194: */ }", "public void delete(String arg0) {\n\t\t\n\t}", "protected void _dropColumn(DBField col)\n throws SQLException, DBException\n {\n String colName = col.getName();\n Map<String,DBField> colMap = this.getExistingColumnMap(false);\n if ((colMap != null) && colMap.containsKey(colName)) {\n String xtableName = this.getTranslatedTableName();\n String fieldDef = col.getFieldDefinition();\n StringBuffer sb = new StringBuffer();\n DBProvider dbp = DBProvider.getProvider();\n if (dbp.getID() == DBProvider.DB_MYSQL) {\n // MySQL: ALTER TABLE <TableName> DROP COLUMN <ColumnName>\n sb.append(\"ALTER TABLE \").append(xtableName); // DB_MYSQL\n sb.append(\" DROP COLUMN \");\n //sb.append(DBProvider.getProvider().getStartColumnChar());\n //sb.append(colName);\n //sb.append(DBProvider.getProvider().getEndColumnChar());\n sb.append(DBProvider.getProvider().quoteColumnName(colName));\n Print.logInfo(\"Dropping column: \" + xtableName + \".\" + fieldDef);\n } else\n if (dbp.getID() == DBProvider.DB_SQLSERVER) {\n sb.append(\"ALTER TABLE \").append(xtableName); // DB_SQLSERVER\n sb.append(\" DROP COLUMN \");\n //sb.append(DBProvider.getProvider().getStartColumnChar());\n //sb.append(colName);\n //sb.append(DBProvider.getProvider().getEndColumnChar());\n sb.append(DBProvider.getProvider().quoteColumnName(colName));\n Print.logInfo(\"Dropping column: \" + xtableName + \".\" + fieldDef);\n } else\n if (dbp.getID() == DBProvider.DB_DERBY) {\n sb.append(\"ALTER TABLE \").append(xtableName); // DB_DERBY\n sb.append(\" DROP COLUMN \");\n //sb.append(DBProvider.getProvider().getStartColumnChar());\n //sb.append(colName);\n //sb.append(DBProvider.getProvider().getEndColumnChar());\n sb.append(DBProvider.getProvider().quoteColumnName(colName));\n Print.logInfo(\"Dropping column: \" + xtableName + \".\" + fieldDef);\n }\n if (sb.length() > 0) {\n Print.logInfo(\"SQL Drop Column: \" + sb);\n DBConnection dbc = null;\n try {\n dbc = DBConnection.getDBConnection_write();\n dbc.executeUpdate(sb.toString());\n } finally {\n DBConnection.release(dbc);\n }\n }\n }\n }", "public void execute(XDBSessionContext client) throws Exception {\n database = client.getSysDatabase();\n\n SysColumn sysCol = aSqlAlterDropColumn.getParent().getTable()\n .getSysColumn(aSqlAlterDropColumn.getColumnName());\n\n int colid = sysCol.getColID();\n\n // We need to delete any Index created on this column.\n // Info for that is in xsysindexes, xsysindexkeys, xsysconstraints\n //\n // PROCEDURE\n // 1. Identify any index created on this coulumn by\n // Select idxid from xsysindexkeys where colid = xxx\n //\n // 2. for all such indexes found\n //\n // 2.1 delete from xyscontraints where idxid = idxid\n //\n // 2.2 delete from xsysindexkeys where .idxid = idxid\n //\n // 2.3 delete from xsysindexes where .idxid = idxid\n //\n // 3. delete col info from xsyscol\n\n // setp 1\n String sql_1 = \"SELECT idxid from xsysindexkeys where colid=\" + colid;\n // ResultSet rs = aSqlStatement.executeQuery(sql_1);\n ResultSet rs = MetaData.getMetaData().executeQuery(sql_1);\n\n // step2\n // delete all indexes and index-constraints defined on this column\n String sql_2_1, sql_2_2, sql_2_3;\n\n while (rs.next()) {\n int idxid = rs.getInt(\"idxid\");\n\n // step 2.1\n sql_2_1 = \"DELETE FROM xsysconstraints WHERE idxid=\" + idxid;\n // aSqlStatement.executeUpdate(sql_2_1);\n MetaData.getMetaData().executeUpdate(sql_2_1);\n\n // step 2.2\n sql_2_2 = \"DELETE FROM xsysindexkeys WHERE idxid=\" + idxid;\n // aSqlStatement.executeUpdate(sql_2_2);\n MetaData.getMetaData().executeUpdate(sql_2_2);\n\n // step 2.3\n sql_2_3 = \"DELETE FROM xsysindexes WHERE idxid=\" + idxid;\n // aSqlStatement.executeUpdate(sql_2_3);\n MetaData.getMetaData().executeUpdate(sql_2_3);\n }\n\n // step 3\n String sql_3 = \"DELETE FROM xsyscolumns where colid = \" + colid;\n // aSqlStatement.executeUpdate(sql_3);\n MetaData.getMetaData().executeUpdate(sql_3);\n }", "public int getColumn(){\n return this.column;\n }", "public int getColumn()\t \t\t{ return column; \t}", "public void setDeleteStatement(EdaContext xContext) throws IcofException {\n\n\t\t// Define the query.\n\t\tString query = \"delete from \" + TABLE_NAME + \n\t\t \" where \" + ID_COL + \" = ? \";\n\n\t\t// Set and prepare the query and statement.\n\t\tsetQuery(xContext, query);\n\n\t}" ]
[ "0.71241957", "0.6621259", "0.66140246", "0.6595064", "0.6514436", "0.6495311", "0.6465854", "0.6338955", "0.62795794", "0.6252096", "0.61703515", "0.6112457", "0.61122835", "0.6071968", "0.6049802", "0.6004235", "0.5964771", "0.5958248", "0.59409714", "0.58629096", "0.58301324", "0.58233696", "0.58233696", "0.5809251", "0.58082354", "0.58082354", "0.5800494", "0.5772333", "0.5760713", "0.575401", "0.5731081", "0.5725053", "0.57231057", "0.57205117", "0.5714251", "0.5704685", "0.5701333", "0.5693028", "0.5692816", "0.5692005", "0.5690469", "0.5687648", "0.5685128", "0.5684278", "0.5684165", "0.5683414", "0.5667894", "0.5651675", "0.56465405", "0.56463623", "0.5645822", "0.5644257", "0.5633117", "0.5619746", "0.56188697", "0.5618322", "0.5617358", "0.56155205", "0.56011575", "0.5587113", "0.5576657", "0.55761224", "0.55756927", "0.5575248", "0.5574578", "0.556981", "0.55589586", "0.5550237", "0.55494404", "0.5545032", "0.55357254", "0.5530313", "0.55302185", "0.5528488", "0.5524204", "0.55219287", "0.5516335", "0.5514437", "0.5512436", "0.5506494", "0.55058396", "0.55011916", "0.5501033", "0.5501033", "0.5501033", "0.54959595", "0.5493876", "0.5486011", "0.5486011", "0.5481137", "0.5479676", "0.5475921", "0.54745233", "0.54708004", "0.5470179", "0.54653895", "0.5464", "0.5462306", "0.54581493", "0.5450235" ]
0.7888684
0
Description of the method addItemCollection.
public void addItemCollection(ItemCollection itemCollection) { // Start of user code for method addItemCollection // End of user code }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void add(Collection collection) {\n\t\t\n\t}", "public void addItem(int itemCollection_id, Item item) {\n\t\t// Start of user code for method addItem\n\t\t// End of user code\n\t}", "public void addCollection(Collection<E> coll) {\n collectionList.add(coll);\n }", "void addItem (Item toAdd){\n\t\t\tthis.items.add(toAdd);}", "public void addIndexedCollection(IndexedCollection iColl) throws InvalidArgumentException,\r\n\t\t\tDuplicatedDataNameException\r\n\t{\n\t\taddDataElement(iColl);\r\n\r\n\t}", "CollectionItem createCollectionItem();", "@Override\r\n\tpublic void addItem(AbstractItemAPI item) {\n\t\titems.add(item);\r\n\t\t\r\n\t}", "public void addItem(Item toAdd) {\n\t\tthis.items.add(toAdd);\n\t}", "public void addItem(Item item) {\n items.add(item);\n }", "public void addItem(Item item) {\n items.add(item);\n }", "void add(Item item);", "public void addItem(Item item) {\n _items.add(item);\n }", "public void addKeyedCollection(KeyedCollection kColl) throws InvalidArgumentException, DuplicatedDataNameException\r\n\t{\n\t\taddDataElement(kColl);\r\n\r\n\t}", "public int addItem(Itemset i);", "public void addItemset(Itemset itemset) {\n itemsets.add(itemset);\n numberOfItems += itemset.size();\n }", "public void addItem(Item item) {\r\n if (items == null) {\r\n items = new ArrayList();\r\n }\r\n items.add(item);\r\n }", "public void addItem(Item item) {\r\n\t\titems.add(item);\r\n\t}", "public void addItem(Item item){\r\n items.add(item);\r\n total = items.getTotal();\r\n }", "public void addItems(ResultItem rItem) {\r\n\t\titems.add(rItem);\r\n\t}", "public void add() {\n\t\tcart.add(item.createCopy());\n\t}", "public void add(Item item) {\r\n\t\tcatalog.add(item);\r\n\t}", "public void addItem(Item item) {\n\t\titems.add(item);\n\t}", "public void addItem(Item i) {\n this.items.add(i);\n }", "private void addItems(Element furnitureItemElement, ArrayList<Furniture> furnitures,\n ArrayList<Item> items, int counter) {\n Item tmpItem =\n new Item(furnitureItemElement.getElementsByTagName(\"name\").item(0).getTextContent(),\n furnitureItemElement.getElementsByTagName(\"description\").item(0).getTextContent());\n\n // add current Item to furniture\n furnitures.get(counter).addItem(tmpItem);\n\n // add items to items list\n items.add(tmpItem);\n }", "public void addItem(Item e) {\n\t\tItem o = new Item(e);\n\t\titems.add(o);\n\t}", "public ItemCollection()\n\t{\n\t\t/*\n\t\t * master list of all consumable/miscellaneous items in the game\n\t\t * \n\t\t * to add a new item to the game, add the item to the itemCollections, and if it is a consumable,\n\t\t * add the effect to the useItem method in the switch statement. If it has no effect, don't add anything.\n\t\t * \n\t\t * sorted by NAME, VALUE, DESCRIPTION, TYPE\n\t\t */\n\t\t\n\t\t//CONSUMABLES\n\t\titemCollections.add(new Item(\"Polar Pop\", 1, \"Do you ever drink water?\", \"Consumable\"));\n\t\titemCollections.add(new Item(\"Klondike Bar\", 20, \"What would you do for this?\", \"Consumable\"));\n\t\titemCollections.add(new Item(\"Big tiddy goth GF\", 666, \"Vore.\", \"Consumable\"));\n\t\t\n\t\t//MISC, i.e. NO STATUS EFFECT\n\t\titemCollections.add(new Item(\"Sippy Cup\", 9, \"Somebody otta get their child their sippy cup back.\", \"Misc\"));\n\t\t\n\t\t/*\n\t\t * master list of equipment items in the game\n\t\t * \n\t\t * same as above\n\t\t * \n\t\t * sorted by NAME, VALUE, DESCRIPTION, TYPE, DAMAGE, DEFENSE, VITALITY, INTELLIGENCE, STRENGTH, WISDOM\n\t\t */\n\t\t\n\t\t//2H-WEAPONS\n\t\tequipmentCollections.add(new Equipment(\"A Big Boy's Sword\", 69, \"A two- handed sword for a big boy like you... You're growing up so fast!\", \"2H-Weapon\", 10, 0, 0, 0, 0, 0));\n\t\t\n\t\t//1H-WEAPONS\n\t\tequipmentCollections.add(new Equipment(\"Red Copper Pan\", 300, \"Hey there mothafuckas it's ya girl cathy, I got some brand new shit\", \"1H-Weapon\", 250, 0, 25, 3, 25, 3));\n\t\t\n\t\t//HEAD\n\t\tequipmentCollections.add(new Equipment(\"Broken Helmet\", 1, \"Leather helmet broken from thousands of years of war and abuse\", \"Head\", 0, 3, 0, 0, 0, 0));\n\t\t\n\t\t//TORSO\n\t\tequipmentCollections.add(new Equipment(\"Bloodied Tunic\", 1, \"Tunic covered in your own blood, you can see your wounds through its holes\", \"Torso\", 0, 2, 0, 0, 0, 0));\n\t\t\n\t\t//ARMS\n\t\tequipmentCollections.add(new Equipment(\"Torn Gloves\", 1, \"Gloves so torn they hardly protect your hands\", \"Arms\", 0, 1, 0, 0, 0, 0));\n\t\t\n\t\t//LEGS\n\t\tequipmentCollections.add(new Equipment(\"Muddy Pants\", 1, \"Cloth pants soiled in mud\", \"Legs\", 0, 2, 0, 0, 0, 0));\n\t\t\n\t\t//FEET\n\t\tequipmentCollections.add(new Equipment(\"Worn Boot\", 1, \"A boot with a hole in it, but where is the other one?\", \"Feet\", 0, 1, 0, 0, 0, 0));\n\t}", "public void addItem( Item anItem) {\n currentItems.add(anItem);\n }", "public void addItem(LibraryItem item){\r\n\t\t// use add method of list.class\r\n\t\tthis.inverntory.add(item);\r\n\t}", "public boolean addAll(Collection<? extends Type> items);", "public void addItems() {\r\n\t\tproductSet.add(new FoodItems(1000, \"maggi\", 12.0, 100, new Date(), new Date(), \"yes\"));\r\n\t\tproductSet.add(new FoodItems(1001, \"Pulses\", 55.0, 50, new Date(), new Date(), \"yes\"));\r\n\t\tproductSet.add(new FoodItems(1004, \"Meat\", 101.53, 5, new Date(), new Date(), \"no\"));\r\n\t\tproductSet.add(new FoodItems(1006, \"Jelly\", 30.0, 73, new Date(), new Date(), \"no\"));\r\n\t\t\r\n\t\tproductSet.add(new Apparels(1005, \"t-shirt\", 1000.0, 10, \"small\", \"cotton\"));\r\n\t\tproductSet.add(new Apparels(1002, \"sweater\", 2000.0, 5,\"medium\", \"woolen\"));\r\n\t\tproductSet.add(new Apparels(1003, \"cardigan\", 1001.53,22, \"large\", \"cotton\"));\r\n\t\tproductSet.add(new Apparels(1007, \"shirt\", 500.99, 45,\"large\",\"woolen\"));\r\n\t\t\r\n\t\tproductSet.add(new Electronics(1010, \"tv\", 100000.0, 13, 10));\r\n\t\tproductSet.add(new Electronics(1012, \"mobile\", 20000.0, 20,12));\r\n\t\tproductSet.add(new Electronics(1013, \"watch\", 1101.53,50, 5));\r\n\t\tproductSet.add(new Electronics(1009, \"headphones\", 300.0, 60,2));\r\n\t\t\r\n\t}", "public void addItem(final Item item) {\n\t\tnumberOfItems++;\n\t}", "protected abstract Collection createCollection();", "@attribute(value = \"\", required = false)\r\n\tpublic void addItem(Item i) {\r\n\t}", "void addCollectionName(Object newCollectionName);", "public void addData(@NonNull Collection<? extends T> newData) {\n mData.addAll(newData);\n notifyItemRangeInserted(mData.size() - newData.size() + getHeaderLayoutCount(), newData.size());\n compatibilityDataSizeChanged(newData.size());\n }", "@Override\r\n\t\t\t\t\tpublic void addItemEventOccurred(AddItemEvent event) {\n\r\n\t\t\t\t\t}", "void addCpItem(ICpItem item);", "public abstract void addItem(AbstractItemAPI item);", "public void addItem(String item){\n adapter.add(item);\n }", "public void add(ToDoItem item) {\n mItems.add(item);\n notifyDataSetChanged();\n }", "public com.rpg.framework.database.Protocol.Item.Builder addItemsBuilder() {\n return getItemsFieldBuilder().addBuilder(\n com.rpg.framework.database.Protocol.Item.getDefaultInstance());\n }", "CatalogItem addCatalogItem(CatalogItem catalogItem);", "public void addItemVector(Vector newItems, String name)\n\t{\n\t\titems.add(newItems);\n\t\tlegend.add(name);\n\t}", "public void AddCollection(View view) {\n Intent intent = new Intent(this, AddCollectionActivity.class);\n this.startActivity(intent);\n }", "public void addAll(Collection<? extends AudioFile> collection) {\n if (mOriginalValues != null) {\n synchronized (mLock) {\n mOriginalValues.addAll(collection);\n if (mNotifyOnChange) notifyDataSetChanged();\n }\n } else {\n mObjects.addAll(collection);\n if (mNotifyOnChange) notifyDataSetChanged();\n }\n }", "public int addItem(Item i);", "public void add(Thing newThing)\r\n {\r\n \titems.add(newThing);\r\n }", "public void addItem(CSVItem item)\n\t{\n\t\titemList.add(item);\n\t}", "void addAll(Collection<Book> books);", "public void addItem(Object item) {\r\n\t\tlistModel.addElement(item);\r\n\t}", "@Override\n\tpublic void add() {\n\t\t\n\t}", "public void add(E item);", "public void deleteItemCollection(ItemCollection itemCollection) {\n\t\t// Start of user code for method deleteItemCollection\n\t\t// End of user code\n\t}", "public COSArrayList( E actualObject, COSBase item, COSDictionary dictionary, COSName dictionaryKey )\n {\n array = new COSArray();\n array.add( item );\n actual = new ArrayList<>();\n actual.add( actualObject );\n\n parentDict = dictionary;\n dictKey = dictionaryKey;\n }", "public void add(Object obj) { \n\t\tcollection.addElement(obj);\n\t}", "public HashMap<String, Item> getItemCollection(){\n \tHashMap<String, Item> result = new HashMap<String, Item>(itemCollection);\r\n \treturn result;\r\n }", "public void addItem(Object obj) {\n items.add(obj);\n }", "public void addItem(Item item) {\n\t\tObjects.requireNonNull(item);\n\t\titems.add(item);\n\t}", "public void add() {\n\t\t\n\t}", "public void addItem(int indexItemset, Item item) {\n itemsets.get(indexItemset).addItem(item);\n numberOfItems++;\n }", "@SafeVarargs\n public final void add(Item... items) {\n add(asList(items));\n }", "public void add(List<Item> items) {\n if (mUseIdDistributor) {\n IdDistributor.checkIds(items);\n }\n mItems.addAll(items);\n mapPossibleTypes(items);\n getFastAdapter().notifyAdapterItemRangeInserted(getFastAdapter().getItemCount(getOrder()), items.size());\n }", "public boolean addAll(Collection added)\n {\n boolean ret = super.addAll(added);\n normalize();\n return(ret);\n }", "void addFruit(Fruit item){\n\t\tfruitList.add(item);\n\t}", "public Collection() {\n this.collection = new ArrayList<>();\n }", "public void add(MeasurementItem mi)\r\n {\r\n if(this.measurementItems==null) this.measurementItems=new ArrayList();\r\n measurementItems.add(mi);\r\n \r\n itemsQuantity=(measurementItems!=null)?measurementItems.size():0;\r\n }", "@Override\r\n\tpublic boolean addAll(int index, Collection<? extends E> c) {\n\t\treturn false;\r\n\t}", "private void addItems() {\n while (true) {\n ClothingItem item = readItem();\n if (item == null || item.getId() < 0) {\n break;\n }\n try {\n ctrl.addItem(item);\n } catch (ValidatorException e) {\n e.printStackTrace();\n }\n }\n }", "public void addTodoItem(TodoItem item) {\n todoItems.add(item);\n }", "public void addItem(String itemPath) {\n\n\t\tImage img = new Image(itemPath);\n\t\titemsList.add(img);\n\n\t}", "public synchronized void addAll(WCollection otherCollection)\n\t{\n\t\tif(otherCollection != null)\n\t\t{\n\t\t\tEnumeration otherCollectionEnum = otherCollection.elements();\n\t\t while(otherCollectionEnum.hasMoreElements())\n\t\t {\n\t\t \tWModelObject object = (WModelObject) otherCollectionEnum.nextElement();\n\t\t \tm_elements.addElement(object);\n\t\t }\n\t\t}\n\t\t\n\t}", "public static <T> void addToCollection(Collection<T> collection, Iterator<T> elementsToAdd)\n {\n while (elementsToAdd.hasNext())\n {\n T next = elementsToAdd.next();\n collection.add(next);\n }\n }", "public void addAll(FeatureCollection featColl){\n if (debug) logger.info(\"collection added\");\n fc.addAll(featColl);\n fcLastEdits.clear();\n fcLastEdits.addAll(featColl);\n lastEditType = EDIT_ADD;\n fireTableDataChanged();\n }", "private void addItem(Movie item) {\n mDataset.add(item);\n notifyItemInserted(mDataset.size() );\n notifyDataSetChanged();\n }", "public void add() {\n }", "public void add(@NonNull final E e) {\n if (mItems.add(e)) {\n final int position = mItems.size() - 1;\n mDatasourceObservable.notifyItemRangeInserted(position, 1);\n }\n }", "public void addItem(Collectable item){\n \tif (!(item instanceof Token)) {\n \t\titems.add(item);\n \t}\n }", "@Override\n\tpublic boolean addAll(Collection<? extends E> c) {\n\t\treturn false;\n\t}", "<C> CollectionItem<C> createCollectionItem();", "public void addAll(MyCollection col) {\n\t\taddAll(size, col);\n\t}", "public void addGroceryItem(String item){\n groceryList.add(item);\n }", "public Boolean add(Item item) {\n \tif (itemCollection.containsKey(item.getItemName())) {\r\n \tif (checkAvailability(item, 1)) {\r\n \t\titem.setQuatity(item.getQuatity() + 1);\r\n \t\titemCollection.put(item.getItemName(), item);\r\n \t\treturn true;\r\n \t} else return false;\r\n } else {\r\n \titemCollection.put(item.getItemName(), item);\r\n \treturn true;\r\n }\r\n \t\r\n }", "void addGroceryItem(String item) {\n\n\t}", "public void addCostItem(CostItem item) throws CostManagerException;", "@Override\n\tpublic boolean addAll(Collection<? extends T> c) {\n\t\tthrow new UnsupportedOperationException();\n\t}", "private void add(GroceryItem itemObj, String itemName) {\n\t\tbag.add(itemObj);\n\t\tSystem.out.println(itemName + \" added to the bag.\");\n\t}", "boolean addAll(Collection<? extends E> c);", "public boolean add (E item)\n {\n add(size, item); // calling public method add\n return true;\n }", "public void addItemToList(String[] item) {\n \t\n \tcurrentTaskItems.add(item);\n }", "public void addAll(Collection toAdd) {\r\n\t\tAssert.isNotNull(toAdd);\r\n\t\taddAll(toAdd.toArray());\r\n\t}", "public static void AddToCollection(Collection<? extends Person> c)\r\n\t{\r\n\t\t//c.add(new Person(\"abc\"));\r\n\t\t//c.add(new Worker(\"a\", \"b\"));\r\n\t\t//c.add(new Object());\r\n\t\t//Collection<? extends Object> c1 = new ArrayList<Person>();\r\n\t\t//c1.add(new Object());\r\n\t}", "default void addAllTo(Collection<? super E> collection) {\n // Accepting a Collection<? super E> allows us to add elements to\n // any collection that can hold E elements, including Collection<Object>.\n for (E element : this) {\n collection.add(element);\n }\n }", "public void addIngredientRecipe(ArrayList<IngredientRecipePOJO> ingr);", "public boolean addAll(Collection collection) {\n for (Iterator iterator = collection.iterator(); iterator.hasNext(); ) {\n this.add(iterator.next());\n }\n return true;\n }", "public void addItem(SoldItem item) {\n\n items.add(item);\n log.debug(\"Added \" + item.getName() + \" quantity of \" + item.getQuantity());\n\n }", "public void setItemCollection(HashMap<String, Item> copy ){\n \titemCollection.putAll(copy);\r\n }", "public Item addItem(Item item) {\r\n uniqueCounter++;\r\n items.add(item);\r\n return item;\r\n }", "@Override\n\tpublic String getName() {\n\t\treturn ActionEnum.ADD_ITEM_COLLECTION.getActionName();\n\t}", "CollectionResource createCollectionResource();", "void add(E item);" ]
[ "0.7274674", "0.7227332", "0.71710527", "0.69015145", "0.65398324", "0.6440696", "0.63144886", "0.62893635", "0.6280491", "0.6280491", "0.6254842", "0.6254664", "0.62521124", "0.6211844", "0.6153628", "0.61504376", "0.61396044", "0.61226404", "0.61104876", "0.60563844", "0.6049019", "0.6046429", "0.6028631", "0.6024575", "0.60136425", "0.60066867", "0.5993309", "0.5983041", "0.59652764", "0.5959242", "0.5958031", "0.59512895", "0.59062904", "0.59061176", "0.5898951", "0.5895381", "0.58904487", "0.5858636", "0.58295816", "0.5823231", "0.580888", "0.58055645", "0.57976896", "0.5763072", "0.57609016", "0.5741286", "0.573637", "0.5725119", "0.570788", "0.57038987", "0.570027", "0.5682324", "0.5680549", "0.5673904", "0.56647176", "0.56602484", "0.56527215", "0.56443334", "0.5637124", "0.5632943", "0.56173015", "0.56145936", "0.5609717", "0.5606197", "0.5604622", "0.56019443", "0.55921", "0.5587706", "0.55866486", "0.5568392", "0.5563765", "0.55606997", "0.55558115", "0.55509585", "0.5549446", "0.55480343", "0.5535384", "0.55352044", "0.55235773", "0.5520334", "0.5515827", "0.5507376", "0.5502564", "0.55008376", "0.55002195", "0.54974514", "0.54877067", "0.5485239", "0.54828376", "0.5482601", "0.5482114", "0.5458364", "0.5451186", "0.5451094", "0.54459316", "0.5437528", "0.54372835", "0.5434162", "0.5429312", "0.54281443" ]
0.8291784
0
Description of the method deleteItemCollection.
public void deleteItemCollection(ItemCollection itemCollection) { // Start of user code for method deleteItemCollection // End of user code }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void deleteItem(int itemCollection_id, int item_id) {\n\t\t// Start of user code for method deleteItem\n\t\t// End of user code\n\t}", "@Override\n public void delete(Context context, Item item) throws SQLException, IOException, AuthorizeException {\n //TODO: HIBERNATE CHECK COLLECTION REMOVE ?\n // Check authorisation here. If we don't, it may happen that we remove the\n // collections leaving the database in an inconsistent state\n authorizeService.authorizeAction(context, item, Constants.REMOVE);\n item.getCollections().clear();\n rawDelete(context, item);\n }", "@Override\n\tpublic void deleteItem(Object toDelete) {}", "@Override\r\n\tpublic void deleteItem() {\n\t\taPList.remove();\r\n\t}", "@Override\n public void deleteItem(P_CK t) {\n \n }", "@Override\r\n\t\tpublic boolean deleteItem() {\n\t\t\treturn false;\r\n\t\t}", "void onItemDeleted();", "public boolean deleteItem(int index);", "public DeleteItemOutcome deleteItem(DeleteItemSpec spec);", "public void delete(MainItemOrdered mainItemOrdered);", "public void delete(ItemsPk pk) throws ItemsDaoException;", "private void deleteItem(){\n //Only perform the delete if this is an existing item.\n if(mCurrentItemUri != null){\n //Call the ContentResolver to delete the item at the given content URI.\n //Pass in null for the selection and selection args because the mCurrentItemUri\n //content URI already identifies the item that we want.\n int rowsDeleted = getContentResolver().delete(mCurrentItemUri, null, null);\n\n //Show a toast message depending on weather or not the delete was successful.\n if(rowsDeleted == 0){\n //If no rows were deleted, then there was an error with the delete.\n Toast.makeText(this, \"Error with deleting item\",\n Toast.LENGTH_SHORT).show();\n }else {\n //Otherwise, the delete was successful and we can display a toast\n Toast.makeText(this, \"Item deleted\",\n Toast.LENGTH_LONG).show();\n }\n }\n //Close the activity\n finish();\n }", "@Override\r\n\tpublic void deleteCases(Collection<CBRCase> arg0) {\n\t}", "public void deleteItem() {\n\t\t\tAsyncCallback<BmUpdateResult> callback = new AsyncCallback<BmUpdateResult>() {\n\t\t\t\t@Override\n\t\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\t\tstopLoading();\n\t\t\t\t\tshowErrorMessage(this.getClass().getName() + \"-deleteItem(): ERROR \" + caught.toString());\n\t\t\t\t}\n\n\t\t\t\t@Override\n\t\t\t\tpublic void onSuccess(BmUpdateResult result) {\n\t\t\t\t\tstopLoading();\n\t\t\t\t\tprocessItemDelete(result);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// Llamada al servicio RPC\n\t\t\ttry {\n\t\t\t\tif (!isLoading()) {\n\t\t\t\t\tstartLoading();\n\t\t\t\t\tgetUiParams().getBmObjectServiceAsync().delete(bmoRequisitionItem.getPmClass(), bmoRequisitionItem, callback);\n\t\t\t\t}\n\t\t\t} catch (SFException e) {\n\t\t\t\tstopLoading();\n\t\t\t\tshowErrorMessage(this.getClass().getName() + \"-deleteItem(): ERROR \" + e.toString());\n\t\t\t}\n\t\t}", "public DeleteItemOutcome deleteItem(PrimaryKey primaryKey);", "void onItemDelete(int position);", "public void deleteCostItem(CostItem item) throws CostManagerException;", "void onDeleteItem(E itemElementView);", "long delete(String collection, String hkey);", "public void supprimerCollection(){\r\n collection.clear();\r\n }", "public void delete(Exercise item) {\n mAdapter.deleteItem(item);\n new AsyncDelete().execute(item);\n }", "void deleteItem(IDAOSession session, int id);", "@Override\n\tpublic void delete(Iterable<? extends Pessoa> arg0) {\n\t\t\n\t}", "protected abstract void removeItem();", "public void deleteItem(String nomItem) {\r\n \t\titems.removeItem(nomItem);\r\n \t}", "private void deleteitem() {\n if (mCurrentItemInfoUri != null) {\n DialogInterface.OnClickListener yesButtonClickListener =\n new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n mProgressbarView.setVisibility(View.VISIBLE);\n ContentValues values = null;\n new updateDeleteItemToDbTask().execute(values);\n }\n };\n // Show dialog that there are unsaved changes\n showConfirmationDeleteDialog(yesButtonClickListener);\n }\n }", "@Test\n public void deleteItem() {\n Item item = new Item();\n item.setName(\"Drill\");\n item.setDescription(\"Power Tool\");\n item.setDaily_rate(new BigDecimal(\"24.99\"));\n item = service.saveItem(item);\n\n // Delete the Item from the database using the Item API method\n service.removeItem(item.getItem_id());\n\n // Test the deleteItem() method\n verify(itemDao, times(1)).deleteItem(integerArgumentCaptor.getValue());\n TestCase.assertEquals(item.getItem_id(), integerArgumentCaptor.getValue().intValue());\n }", "public void deleteTodoItem(TodoItem item) {\n todoItems.remove(item);\n }", "@HTTP(\n method = \"DELETE\",\n path = \"/apis/config.openshift.io/v1/ingresses\"\n )\n @Headers({ \n \"Accept: */*\"\n })\n KubernetesCall<Status> deleteCollectionIngress(\n @QueryMap DeleteCollectionIngress queryParameters);", "@Transactional\n\tpublic void delete(final Collection<T> persistentObjectCollection) {\n\t\tfor(T object: persistentObjectCollection) {\n\t\t\tthis.em.remove(object);\n\t\t}\n\t}", "private void deleteItem(Item item) {\n updateItemInStoreList(item, DELETE_ITEM_OP);\n itemListViewModel.setList(storeList);\n }", "public void delete() \n\t\t\t\tthrows model.ConsistencyException, PersistenceException{\n //TODO Check delegation to abstract class and overwrite if necessary!\n this.getMyCONCMModelItem().delete();\n }", "@Override\n\tpublic void delete(Iterable<? extends Basket> arg0) {\n\t\t\n\t}", "public void deleteItem(MySmsMessage item){\n if(dataset.contains(item)){\n int pos=dataset.indexOf(item);\n dataset.remove(pos);\n notifyItemRemoved(pos);\n }\n }", "public void deleteCollection(String collectionName) throws Exception {\n\t try (HttpSolrClient hsc = createClient()) {\n\t\t Delete delete = Delete.deleteCollection(collectionName); //Create.createCollection(collectionName, shards, replicas);\n CollectionAdminResponse resp = delete.process(hsc);\n log.info(\"Collection delete: \"+resp);\n\t }\n }", "public void deleteItem(ActionEvent actionEvent) {\n // find the list that the item belongs in\n // removeItem() from its parenting list\n }", "private void deleteItem() {\n // Only perform the delete if this is an existing inventory item\n if (mCurrentInventoryUri != null) {\n // Call the ContentResolver to delete the inventory item at the given content URI.\n // Pass in null for the selection and selection args because the mCurrentInventoryUri\n // content URI already identifies the inventory item that we want.\n int rowsDeleted = getContentResolver().delete(mCurrentInventoryUri, null, null);\n\n // Show a toast message depending on whether or not the delete was successful.\n if (rowsDeleted == 0) {\n // If no rows were deleted, then there was an error with the delete.\n Toast.makeText(this, getString(R.string.editor_delete_inventory_failed),\n Toast.LENGTH_SHORT).show();\n } else {\n // Otherwise, the delete was successful and we can display a toast.\n Toast.makeText(this, getString(R.string.editor_delete_inventory_successful),\n Toast.LENGTH_SHORT).show();\n }\n }\n\n // Close the activity\n finish();\n }", "@HTTP(\n method = \"DELETE\",\n path = \"/apis/config.openshift.io/v1/ingresses\"\n )\n @Headers({ \n \"Accept: */*\"\n })\n KubernetesCall<Status> deleteCollectionIngress();", "public DeleteItemOutcome deleteItem(PrimaryKey primaryKey,\n Expected... expected);", "private void deleteItem()\n {\n Category categoryToDelete = dataCategories.get(dataCategories.size()-1);\n AppDatabase db = Room.databaseBuilder(getApplicationContext(),\n AppDatabase.class, \"database-name\").allowMainThreadQueries().build();\n db.categoryDao().delete(categoryToDelete);\n testDatabase();\n }", "@Override\n\tpublic Item delete() {\n\t\treadAll();\n\t\tLOGGER.info(\"\\n\");\n\t\t//user can select either to delete a customer from system with either their id or name\n\t\tLOGGER.info(\"Do you want to delete record by Item ID\");\n\t\tlong id = util.getLong();\n\t\titemDAO.deleteById(id);\n\t\t\t\t\n\t\t\t\t\n\t\treturn null;\n\t}", "@FXML\r\n\tpublic void deleteItem() {\r\n\t\tcontroller.deleteWishlistItem(listView.getSelectionModel().getSelectedItem().getId());\r\n\t\tlistView.setItems(controller.getWishlistWatchesForCurrentUser());\r\n\t\tlistView.getSelectionModel().select(-1);\r\n\t}", "public void doDelete ( RunData data)\n\t{\n\t\tSessionState state = ((JetspeedRunData)data).getPortletSessionState (((JetspeedRunData)data).getJs_peid ());\n\n\t\t// cancel copy if there is one in progress\n\t\tif(! Boolean.FALSE.toString().equals(state.getAttribute (STATE_COPY_FLAG)))\n\t\t{\n\t\t\tinitCopyContext(state);\n\t\t}\n\n\t\t// cancel move if there is one in progress\n\t\tif(! Boolean.FALSE.toString().equals(state.getAttribute (STATE_MOVE_FLAG)))\n\t\t{\n\t\t\tinitMoveContext(state);\n\t\t}\n\n\t\tParameterParser params = data.getParameters ();\n\n\t\tList Items = (List) state.getAttribute(STATE_DELETE_ITEMS);\n\n\t\t// Vector deleteIds = (Vector) state.getAttribute (STATE_DELETE_IDS);\n\n\t\t// delete the lowest item in the hireachy first\n\t\tHashtable deleteItems = new Hashtable();\n\t\t// String collectionId = (String) state.getAttribute (STATE_COLLECTION_ID);\n\t\tint maxDepth = 0;\n\t\tint depth = 0;\n\n\t\tIterator it = Items.iterator();\n\t\twhile(it.hasNext())\n\t\t{\n\t\t\tBrowseItem item = (BrowseItem) it.next();\n\t\t\tdepth = ContentHostingService.getDepth(item.getId(), item.getRoot());\n\t\t\tif (depth > maxDepth)\n\t\t\t{\n\t\t\t\tmaxDepth = depth;\n\t\t\t}\n\t\t\tList v = (List) deleteItems.get(new Integer(depth));\n\t\t\tif(v == null)\n\t\t\t{\n\t\t\t\tv = new Vector();\n\t\t\t}\n\t\t\tv.add(item);\n\t\t\tdeleteItems.put(new Integer(depth), v);\n\t\t}\n\n\t\tboolean isCollection = false;\n\t\tfor (int j=maxDepth; j>0; j--)\n\t\t{\n\t\t\tList v = (List) deleteItems.get(new Integer(j));\n\t\t\tif (v==null)\n\t\t\t{\n\t\t\t\tv = new Vector();\n\t\t\t}\n\t\t\tIterator itemIt = v.iterator();\n\t\t\twhile(itemIt.hasNext())\n\t\t\t{\n\t\t\t\tBrowseItem item = (BrowseItem) itemIt.next();\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tif (item.isFolder())\n\t\t\t\t\t{\n\t\t\t\t\t\tContentHostingService.removeCollection(item.getId());\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tContentHostingService.removeResource(item.getId());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (PermissionException e)\n\t\t\t\t{\n\t\t\t\t\taddAlert(state, rb.getString(\"notpermis6\") + \" \" + item.getName() + \". \");\n\t\t\t\t}\n\t\t\t\tcatch (IdUnusedException e)\n\t\t\t\t{\n\t\t\t\t\taddAlert(state,RESOURCE_NOT_EXIST_STRING);\n\t\t\t\t}\n\t\t\t\tcatch (TypeException e)\n\t\t\t\t{\n\t\t\t\t\taddAlert(state, rb.getString(\"deleteres\") + \" \" + item.getName() + \" \" + rb.getString(\"wrongtype\"));\n\t\t\t\t}\n\t\t\t\tcatch (ServerOverloadException e)\n\t\t\t\t{\n\t\t\t\t\taddAlert(state, rb.getString(\"failed\"));\n\t\t\t\t}\n\t\t\t\tcatch (InUseException e)\n\t\t\t\t{\n\t\t\t\t\taddAlert(state, rb.getString(\"deleteres\") + \" \" + item.getName() + \" \" + rb.getString(\"locked\"));\n\t\t\t\t}// try - catch\n\t\t\t\tcatch(RuntimeException e)\n\t\t\t\t{\n\t\t\t\t\tlogger.debug(\"ResourcesAction.doDelete ***** Unknown Exception ***** \" + e.getMessage());\n\t\t\t\t\taddAlert(state, rb.getString(\"failed\"));\n\t\t\t\t}\n\t\t\t}\t// for\n\n\t\t}\t// for\n\n\t\tif (state.getAttribute(STATE_MESSAGE) == null)\n\t\t{\n\t\t\t// delete sucessful\n\t\t\tstate.setAttribute (STATE_MODE, MODE_LIST);\n\n\t\t\tif (((String) state.getAttribute (STATE_SELECT_ALL_FLAG)).equals (Boolean.TRUE.toString()))\n\t\t\t{\n\t\t\t\tstate.setAttribute (STATE_SELECT_ALL_FLAG, Boolean.FALSE.toString());\n\t\t\t}\n\n\t\t}\t// if-else\n\n\t}", "@Override\n\tpublic int delete(List<OrderItem> objectsToDelete) throws SQLException {\n\t\treturn 0;\n\t}", "@Override\n\t\tpublic void delete() {\n\n\t\t}", "public DeleteItemOutcome deleteItem(KeyAttribute ... primaryKeyComponents);", "public void deleteItem(int index) {\n this.items.remove(index);\n }", "@Override\n\tpublic boolean delete(Item obj) {\n\t\ttry{\n\t\t\tString query=\"DELETE FROM items WHERE id = ?\";\n\t\t\tPreparedStatement state = conn.prepareStatement(query,ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);\n\t\t\tstate.setInt(1, obj.getIndex());\n\t\t\tint nb_rows = state.executeUpdate();\n\t\t\tSystem.out.println(\"Deleted \"+nb_rows+\" lines\");\n\t\t\tstate.close();\n\t\t\t\n\t\t\t// Notify the Dispatcher on a suitable channel.\n\t\t\tthis.publish(EntityEnum.ITEM.getValue());\n\t\t\t\n\t\t\treturn true;\n\t\t} catch (SQLException e){\n\t\t\tJOptionPane jop = new JOptionPane();\n\t\t\tjop.showMessageDialog(null, e.getMessage(),\"PostgreSQLItemDao.delete -- ERROR!\",JOptionPane.ERROR_MESSAGE);\n\t\t\treturn false;\n\t\t} catch (Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\t\n\t}", "public boolean delete() {\r\n \t\t// need to have a way to inform if delete did not happen\r\n \t\t// can't delete if there are dependencies...\r\n \t\tif ((this.argumentsAgainst.size() > 0)\r\n \t\t\t\t|| (this.argumentsFor.size() > 0)\r\n \t\t\t\t|| (this.relationships.size() > 0)\r\n \t\t\t\t|| (this.questions.size() > 0)\r\n \t\t\t\t|| (this.subDecisions.size() > 0)) {\r\n \t\t\tMessageDialog.openError(new Shell(), \"Delete Error\",\r\n \t\t\t\"Can't delete when there are sub-elements.\");\r\n \r\n \t\t\treturn true;\r\n \t\t}\r\n \r\n \t\tif (this.artifacts.size() > 0) {\r\n \t\t\tMessageDialog.openError(new Shell(), \"Delete Error\",\r\n \t\t\t\"Can't delete when code is associated!\");\r\n \t\t\treturn true;\r\n \t\t}\r\n \t\tRationaleDB db = RationaleDB.getHandle();\r\n \r\n \t\t// are there any dependencies on this item?\r\n \t\tif (db.getDependentAlternatives(this).size() > 0) {\r\n \t\t\tMessageDialog.openError(new Shell(), \"Delete Error\",\r\n \t\t\t\"Can't delete when there are depencencies.\");\r\n \t\t\treturn true;\r\n \t\t}\r\n \r\n \t\tm_eventGenerator.Destroyed();\r\n \r\n \t\tdb.deleteRationaleElement(this);\r\n \t\treturn false;\r\n \r\n \t}", "public void deleteItem(ToDoList item) {\n SQLiteDatabase db = this.getWritableDatabase();\n db.delete(TABLE_NAME, KEY_ID + \" = ?\",\n new String[]{String.valueOf(item.getId())});\n db.close();\n }", "@HTTP(\n method = \"DELETE\",\n path = \"/apis/config.openshift.io/v1/images\"\n )\n @Headers({ \n \"Accept: */*\"\n })\n KubernetesCall<Status> deleteCollectionImage(\n @QueryMap DeleteCollectionImage queryParameters);", "@Override\n public void delete(Long id) {\n log.debug(\"Request to delete Collection : {}\", id);\n collectionRepository.delete(id);\n collectionSearchRepository.delete(id);\n }", "@HTTP(\n method = \"DELETE\",\n path = \"/apis/config.openshift.io/v1/images\"\n )\n @Headers({ \n \"Accept: */*\"\n })\n KubernetesCall<Status> deleteCollectionImage();", "@Override\n\tpublic void entriesDeleted(Collection<String> arg0) {\n\n\t}", "void deletingCatalogItemById(final Long id);", "public void deleteSelection() {\n deleteFurniture(Home.getFurnitureSubList(this.home.getSelectedItems())); \n }", "private void deleteItem(int position){\n deleteItem(dataset.get(position),position);\n }", "int deleteByExample(HpItemParamItemExample example);", "public boolean deletePlayerItem(PlayerItem playerItem);", "@Test\n public void normal_recursive_delete_WebDAV_collection() {\n String collectionName = \"deleteDavCollection\";\n String davFileName = \"davFile.txt\";\n\n try {\n // Create collection.\n DavResourceUtils.createWebDAVCollection(Setup.TEST_CELL1, Setup.TEST_BOX1, collectionName,\n Setup.BEARER_MASTER_TOKEN, HttpStatus.SC_CREATED);\n // Create dav file.\n DavResourceUtils.createWebDAVFile(Setup.TEST_CELL1, Setup.TEST_BOX1, collectionName + \"/\" + davFileName,\n \"text/html\", TOKEN, \"foobar\", HttpStatus.SC_CREATED);\n // Recursive delete collection.\n deleteRecursive(collectionName, \"true\", HttpStatus.SC_NO_CONTENT);\n } finally {\n deleteRecursive(collectionName, \"true\", -1);\n }\n }", "void checkItemForDelete(Object item, java.sql.Statement stmt) throws PrismsRecordException;", "@Override\n public void delete()\n {\n }", "public long delete(Collection<String> collection, int amount) {\n List<String> str = new ArrayList<>();\n str.addAll(collection);\n long start = System.currentTimeMillis();\n\n for (int i = 0; i < amount; i++) {\n collection.remove(str.get(i));\n }\n\n long finish = System.currentTimeMillis();\n System.out.println(String.format(\"Collection after deleting - %s\", collection.size()));\n return finish - start;\n }", "@HTTP(\n method = \"DELETE\",\n path = \"/apis/config.openshift.io/v1/proxies\"\n )\n @Headers({ \n \"Accept: */*\"\n })\n KubernetesCall<Status> deleteCollectionProxy(\n @QueryMap DeleteCollectionProxy queryParameters);", "public void deleteItem() {\n\t\tIntent intent = new Intent(this, AlarmActivity.class);\n\t\tint alarmId = itemsAdapter.getSelectedItem().getId();\n\t\tLog.d(TAG, \"Cancelling Alarm with ID \" + alarmId); \n\t\tPendingIntent sender = PendingIntent.getBroadcast(this, alarmId, intent, 0);\n\t\tAlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);\n\t\talarmManager.cancel(sender);\n\t\t\n\t\titemsAdapter.remove(itemsAdapter.getSelectedPosition());\n\t\titemsAdapter.unsetSelectedPosition();\n\t\tgetActionBar().hide();\n\t}", "@Override\n\tpublic void delete(Iterable<? extends Pedido> arg0) {\n\n\t}", "@Override\n\tpublic void delete() {\n\n\t}", "int deleteByPrimaryKey(Integer fitemid);", "public void delete() {\n\n\t}", "public void deleteItem(MySmsMessage item,int position){\n dataset.remove(item);\n notifyItemRemoved(position);\n }", "@Test\n void deleteItem() {\n }", "public void deleteItem(final SavedItem item) {\n final SavedItem savedItem = item;\n final String name = item.getName();\n final AlertDialog dialog = new AlertDialog.Builder(this)\n .setTitle(\"Delete \" + name)\n .setMessage(name+ \" and its associated sorting data will be removed\")\n .setPositiveButton(\"Yes\", null)\n .setNegativeButton(\"No\", null)\n .show();\n Button positiveButton = dialog.getButton(AlertDialog.BUTTON_POSITIVE);\n positiveButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n Toast.makeText(SavedItemListActivity.this, (name + \" Deleted.\"), Toast.LENGTH_SHORT).show();\n vm.deleteSavedItem(item);\n dialog.dismiss();\n }\n });\n }", "public void removeItem(int id);", "void clearDeletedItemsTable();", "public void deleteItem(PlatformLayerKey key) throws PlatformLayerClientException;", "void delete(int index) throws ListException;", "@Override\n\tpublic void delete(Iterable<? extends ComplitedOrderInfo> arg0) {\n\t\t\n\t}", "int deleteByPrimaryKey(String itemFlow);", "@Override\n\tpublic void delete(Iterable<? extends ReportCategory> arg0) {\n\n\t}", "public int deleteItem(int itemId) {\n\t\t\t DB db = mongoClient.getDB(\"solar\");\n\t\t\t\t\t DBCollection dbCollection = db.getCollection(\"item_master\");\n\t\t\t\t\t BasicDBObject searchQuery = new BasicDBObject(\"item_id\",itemId );\n\t\t\t\t\t \n\t\t\t\t\t BasicDBObject newDocument = new BasicDBObject();\n\t\t\t\t\t newDocument.append(\"delete_status\", 1);\n\t\t\t\t\t //System.out.println(\"NEWDOCUMENT====================\"+newDocument);\n\t\t\t\t\t BasicDBObject setQuery = new BasicDBObject();\n\t\t\t\t\t setQuery.append(\"$set\", newDocument);\n\t\t\t\t\t WriteResult result = dbCollection.update(searchQuery, setQuery);\n\t\t\t\t\t //System.out.println(\"Result-----------\"+result.getN());\n\t\t\t\t return result.getN();\n\t\t}", "@Test\n\tpublic void deleteItemTest() {\n\t\tInteger associatedAccountId_1 = 1;\n\t\tString type_1 = \"deposit\";\n\t\tString date_1 = \"2018-04-03\";\n\t\tInteger amount_1 = 100;\n\t\tString description_1 = \"This is test transaction number one\";\n\t\tTransaction testDeleteTransaction_1 = new Transaction();\n\t\ttestDeleteTransaction_1.setAssociatedAccountId(associatedAccountId_1);\n\t\ttestDeleteTransaction_1.setType(type_1);\n\t\ttestDeleteTransaction_1.setDate(date_1);\n\t\ttestDeleteTransaction_1.setAmount(amount_1);\n\t\ttestDeleteTransaction_1.setDescription(description_1);\n\t\ttransacRepoTest.saveItem(testDeleteTransaction_1);\t\t\n\t\t\n\t\t//should now be 1 transaction in the repo\t\t\n\t\tArrayList<Transaction> transList = transacRepoTest.getItemsFromAccount(associatedAccountId_1);\n\t\tassertEquals(transList.size(), 1);\n\t\t\t\n\t\ttransacRepoTest.deleteItem(associatedAccountId_1);\n\n\t\t//should now be 0 transactions in the repo\n\t\ttransList = transacRepoTest.getItemsFromAccount(associatedAccountId_1);\n\t\tassertEquals(transList.size(), 0);\n\t\t\n\t}", "public void delete(Iterable<? extends T> arg0) {\n\t\t\n\t}", "@Override\n\tpublic void deleteSelected() {\n\n\t}", "@Override\n\tpublic void delete(Note e) {\n\t\t\n\t}", "public void deleteItem(String string) {\n itemArrayList.remove(string);\n saveArrayList(itemArrayList, \"itemArrayList\");\n }", "public boolean delete()\r\n\t{\n\t\tif ((this.argumentsAgainst.size() > 0) ||\r\n\t\t\t\t(this.argumentsFor.size() > 0) ||\r\n\t\t\t\t(this.relationships.size() > 0) ||\r\n\t\t\t\t(this.questions.size() > 0) ||\r\n\t\t\t\t(this.subDecisions.size() > 0))\r\n\t\t{\r\n\t\t\tMessageDialog.openError(new Shell(),\t\"Delete Error\",\t\"Can't delete when there are sub-elements.\");\r\n\t\t\t\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tRationaleDB db = RationaleDB.getHandle();\r\n\t\t\r\n//\t\t//are there any dependencies on this item?\r\n//\t\tif (db.getDependentAlternatives(this).size() > 0)\r\n//\t\t{\r\n//\t\t\tMessageDialog.openError(new Shell(),\t\"Delete Error\",\t\"Can't delete when there are depencencies.\");\r\n//\t\t\treturn true;\r\n//\t\t}\r\n\t\t\r\n\t\tm_eventGenerator.Destroyed();\r\n\t\t\r\n\t\tdb.deleteRationaleElement(this);\r\n\t\treturn false;\r\n\t\t\r\n\t}", "public void actionPerformed(ActionEvent e) {\n\t\t\t\tItemType i = getSelectedItem();\n\t\t\t\tif(i != null)\n\t\t\t\t{\t\n\n\t\t\t\t\tfinal String msg = \"Delete \"+i.getName() + \"?\";\n\t\t\t\t\tif(!confirmDelete(msg))\n\t\t\t\t\t\treturn;\n\t\t\t\t\ti.removeContainer(GeneralItemList.this);\n\t\t\t\t\ti.destroy();\n\t\t\t\t}\n\t\t\t\titems.remove(i);\n\t\t\t\tlist.clearSelection();\n\t\t\t\tlist.repaint(100);\t\t\t\t\n\t\t\t}", "public void itemRemoved(E item);", "@Override\n\t\tpublic void deleteItem(int index) {\n\t\t\tmFiles.remove(index);\n\t\t}", "@Override\n\t@RequestMapping(value=ZuelControllerValue.Manage+\"deleteItem\")\n\tpublic ZuelResult deleteItem(Long id) throws Exception {\n\t\treturn service.deleteItem(id);\n\t}", "private void deleteExec(){\r\n\t\tList<HashMap<String,String>> selectedDatas=ViewUtil.getSelectedData(jTable1);\r\n\t\tif(selectedDatas.size()<1){\r\n\t\t\tJOptionPane.showMessageDialog(null, \"Please select at least 1 item to delete\", \"Error\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tint options = 1;\r\n\t\tif(selectedDatas.size() ==1 ){\r\n\t\t\toptions = JOptionPane.showConfirmDialog(null, \"Are you sure to delete this Item ?\", \"Info\",JOptionPane.YES_NO_OPTION);\r\n\t\t}else{\r\n\t\t\toptions = JOptionPane.showConfirmDialog(null, \"Are you sure to delete these \"+selectedDatas.size()+\" Items ?\", \"Info\",JOptionPane.YES_NO_OPTION);\r\n\t\t}\r\n\t\tif(options==1){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tfor(HashMap<String,String> map:selectedDatas){\r\n\t\t\t\r\n\t\t\tdiscountService.deleteDiscountByMap(NameConverter.convertViewMap2PhysicMap(map, \"Discount\"));\r\n\t\t}\r\n\t\tthis.initDatas();\r\n\t}", "@Override\n\tpublic int delete(Uri uri, String selection, String[] selectionArgs) {\n\t\tint cnt = 1;\n\t\tmChallengesDB.del();\n\t\treturn cnt;\n\t}", "@Override\r\n\tpublic void delete(T element) {\n\r\n\t}", "@Override\r\n\tpublic void delete() {\n\r\n\t}", "@Override\n\tpublic void delete() {\n\t\t\n\t}", "@Override\n\tpublic void delete() {\n\t\t\n\t}", "@Override\r\n\t\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t\tfor(int i=0;i<favorites.size();i++){\r\n\t\t\t\t\t\tif(e.getSource().equals(deleteButtons.get(i))){\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tClient client=new Client();\r\n\t\t\t\t\t\t\t\tclient.deleteCollection(favorites.get(i).getFoodName());\r\n\t\t\t\t\t\t\t\tnew MYCollection(customer).setVisible(true);\r\n\t\t\t\t\t\t\t\tclose();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t} catch (Exception e1) {\r\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "private void deleteRoutine() {\n String message = \"Are you sure you want to delete this routine\\nfrom your routine collection?\";\n int n = JOptionPane.showConfirmDialog(this, message, \"Warning\", JOptionPane.YES_NO_OPTION);\n if (n == JOptionPane.YES_OPTION) {\n Routine r = list.getSelectedValue();\n\n collection.delete(r);\n listModel.removeElement(r);\n }\n }", "@Test\r\n\tpublic void TestdeleteFood() {\n\t\tassertNotNull(\"Test if there is valid food list to delete food item\", foodList);\r\n\r\n\t\t// when given an empty food list, after adding two items, the size of the food\r\n\t\t// list is 2. After removing a food item, the size of the food list becomes 1.\r\n\t\tfoodList.add(f1);\r\n\t\tfoodList.add(f2);\r\n\t\tassertEquals(\"Test that food list size is 2\", 2, foodList.size());\r\n\t\tC206_CaseStudy.getAllFoodItem(foodList);\r\n\t\tfoodList.remove(0);\r\n\t\tassertEquals(\"Test that food list size is 1\", 1, foodList.size());\r\n\r\n\t\t// Continue from step 2, test that after removing a food item, the size of the\r\n\t\t// food list becomes empty.\r\n\t\tC206_CaseStudy.getAllFoodItem(foodList);\r\n\t\tfoodList.remove(0);\r\n\t\tassertTrue(\"Test that the food list is empty\", foodList.isEmpty());\r\n\t}", "public void clickDeleteRecyclerView(final Item item){\n try{\n realm.executeTransaction(new Realm.Transaction() {\n @Override\n public void execute(Realm realm) {\n // RealmResults<Item> result = realm.where(Item.class).equalTo(\"id\",item.getId()).findAll();\n //result.deleteAllFromRealm();\n }\n });\n }catch (Exception e){\n Log.i(CLASS_NAME,e.getMessage());\n }\n }" ]
[ "0.7271369", "0.6928785", "0.68039846", "0.6737721", "0.6705007", "0.667197", "0.665397", "0.6604901", "0.65609986", "0.6550204", "0.64455175", "0.6311697", "0.62021303", "0.62019825", "0.6189605", "0.6174769", "0.6173517", "0.61586094", "0.61457413", "0.61254686", "0.6118153", "0.6066456", "0.605462", "0.6043794", "0.6041987", "0.6014637", "0.60074914", "0.5997397", "0.5979327", "0.59414554", "0.5938814", "0.59192395", "0.59058005", "0.5889874", "0.58816886", "0.5880553", "0.5877082", "0.58752656", "0.58697456", "0.5852051", "0.5843773", "0.5840952", "0.583785", "0.58320844", "0.5823918", "0.5821597", "0.5821296", "0.58195114", "0.581567", "0.5815009", "0.5813819", "0.5808017", "0.5805308", "0.5781159", "0.5766254", "0.5756756", "0.5755446", "0.5751084", "0.574921", "0.5725386", "0.5724854", "0.5716944", "0.5709734", "0.5695548", "0.56948435", "0.56902105", "0.568502", "0.567346", "0.5673027", "0.56729704", "0.566186", "0.5654459", "0.56509227", "0.5649772", "0.5648063", "0.56473607", "0.5646745", "0.5641984", "0.56355894", "0.56343764", "0.5630291", "0.5627249", "0.56270915", "0.5624393", "0.5623241", "0.5619131", "0.56166416", "0.56147915", "0.56139356", "0.55949336", "0.5594067", "0.55901426", "0.5587681", "0.55856764", "0.5581463", "0.5581463", "0.55755043", "0.55754596", "0.5567189", "0.55664575" ]
0.8038023
0
Description of the method addItem.
public void addItem(int itemCollection_id, Item item) { // Start of user code for method addItem // End of user code }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void addItem (Item toAdd){\n\t\t\tthis.items.add(toAdd);}", "void add(Item item);", "@Override\r\n\tpublic void addItem(AbstractItemAPI item) {\n\t\titems.add(item);\r\n\t\t\r\n\t}", "public void addItem(Item item) {\n items.add(item);\n }", "public void addItem(Item item) {\n items.add(item);\n }", "public abstract void addItem(AbstractItemAPI item);", "public void addItem(Item item) {\n _items.add(item);\n }", "public void addItem(Item item){\r\n items.add(item);\r\n total = items.getTotal();\r\n }", "public void addItem(Item item) {\r\n\t\titems.add(item);\r\n\t}", "public void addItem(Item toAdd) {\n\t\tthis.items.add(toAdd);\n\t}", "public void addItem(Item e) {\n\t\tItem o = new Item(e);\n\t\titems.add(o);\n\t}", "@attribute(value = \"\", required = false)\r\n\tpublic void addItem(Item i) {\r\n\t}", "public void addItem( Item anItem) {\n currentItems.add(anItem);\n }", "public void addItem(Item item) {\n\t\titems.add(item);\n\t}", "public void addItem(Item i) {\n this.items.add(i);\n }", "public void addItem(LibraryItem item){\r\n\t\t// use add method of list.class\r\n\t\tthis.inverntory.add(item);\r\n\t}", "public void addItem(final Item item) {\n\t\tnumberOfItems++;\n\t}", "public int addItem(Item i);", "public void addItem(SoldItem item) {\n\n items.add(item);\n log.debug(\"Added \" + item.getName() + \" quantity of \" + item.getQuantity());\n\n }", "@Override\n\t@RequestMapping(value=ZuelControllerValue.Manage+\"addItem\")\n\tpublic ZuelResult addItem(TbItem item) {\n\t\treturn service.addItem(item);\n\t}", "public void addItem(Item item) {\n\t\tObjects.requireNonNull(item);\n\t\titems.add(item);\n\t}", "public void addItem(Object obj) {\n items.add(obj);\n }", "public void additem(String item){\n\t\trep.takeitem(\"take \" + item);\n\t}", "public void add() {\n\t\tcart.add(item.createCopy());\n\t}", "public void addItem(String item){\n adapter.add(item);\n }", "void addItem(DataRecord record);", "public void addItem(Object item) {\r\n\t\tlistModel.addElement(item);\r\n\t}", "public void add(Item item) {\r\n\t\tcatalog.add(item);\r\n\t}", "void addCpItem(ICpItem item);", "public void addItem(Item item) {\r\n if (items == null) {\r\n items = new ArrayList();\r\n }\r\n items.add(item);\r\n }", "public void addTodoItem(TodoItem item) {\n todoItems.add(item);\n }", "public void add(ToDoItem item) {\n mItems.add(item);\n notifyDataSetChanged();\n }", "public boolean add(Type item);", "Item addItem(IDAOSession session, String title, String description,\n\t\t\tint userId);", "void addFruit(Fruit item){\n\t\tfruitList.add(item);\n\t}", "public Item addItem(Item item) {\r\n uniqueCounter++;\r\n items.add(item);\r\n return item;\r\n }", "public void addItem(ToDoList item) {\n SQLiteDatabase db = this.getWritableDatabase();\n\n ContentValues values = new ContentValues();\n values.put(TITLE, item.getTitle());\n values.put(DETAILS, item.getDetails());\n\n db.insert(TABLE_NAME, null, values); //Insert query to store the record in the database\n db.close();\n\n }", "public void addItem(Item item) {\n\t\thashOperations.put(KEY, item.getId(), item);\n\t\t//valueOperations.set(KEY + item.getId(), item);\n\t}", "CatalogItem addCatalogItem(CatalogItem catalogItem);", "public void addItemInventory(Item item){\r\n playerItem.add(item);\r\n System.out.println(item.getDescription() + \" was taken \");\r\n }", "public void addItem() {\r\n\t\tFacesContext fc = FacesContext.getCurrentInstance();\r\n\t\tif (itemInvoice.getQuantidade() <= itemPO.getQuantidadeSaldo()) {\r\n\t\t\tBigDecimal total = itemInvoice.getPrecoUnit().multiply(\r\n\t\t\t\t\tnew BigDecimal(itemInvoice.getQuantidade()));\r\n\t\t\titemInvoice.setTotal(total);\r\n\t\t\tif (!editarItem) {\r\n\r\n\t\t\t\tif (itemInvoice.getPrecoUnit() == null) {\r\n\t\t\t\t\titemInvoice.setPrecoUnit(new BigDecimal(0.0));\r\n\t\t\t\t}\r\n\t\t\t\tif (itemInvoice.getQuantidade() == null) {\r\n\t\t\t\t\titemInvoice.setQuantidade(0);\r\n\t\t\t\t}\r\n\t\t\t\titemInvoice.setInvoice(invoice);\r\n\r\n\t\t\t\tinvoice.getItensInvoice().add(itemInvoice);\r\n\r\n\t\t\t} else {\r\n\t\t\t\tinvoice.getItensInvoice().set(\r\n\t\t\t\t\t\tinvoice.getItensInvoice().indexOf(itemInvoice),\r\n\t\t\t\t\t\titemInvoice);\r\n\t\t\t}\r\n\t\t\tcarregarTotais();\r\n\t\t\tinicializarItemInvoice();\r\n\t\t\trequired = false;\r\n\t\t} else {\r\n\r\n\t\t\tMessages.adicionaMensagemDeInfo(TemplateMessageHelper.getMessage(\r\n\t\t\t\t\tMensagensSistema.INVOICE, \"lblQtdMaioSaldo\", fc\r\n\t\t\t\t\t\t\t.getViewRoot().getLocale()));\r\n\t\t}\r\n\t}", "public void addItem() {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tSystem.out.print(\"Enter Item Name: \");\n\t\tString itemName = scanner.nextLine();\n\t\tSystem.out.print(\"Enter Item Description: \");\n\t\tString itemDescription = scanner.nextLine();\n\t\tSystem.out.print(\"Enter minimum bid price for item: $\");\n\t\tdouble basePrice = scanner.nextDouble();\n\t\tLocalDate createDate = LocalDate.now();\n\t\tItem item = new Item(itemName, itemDescription, basePrice, createDate);\n\t\taddItem(item);\n\t}", "public void store(Item item) {\n this.items.add(item);\n }", "@Override\n public void addItem(P_CK t) {\n \n }", "private void addItem(Movie item) {\n mDataset.add(item);\n notifyItemInserted(mDataset.size() );\n notifyDataSetChanged();\n }", "public void add(E item);", "public synchronized void addItem(IJABXAdvertisementItem item) {\n\t\tidMap.put(item.getSerialNo(), item);\n\t\titemList.add(item);\n\t}", "public void addItem(CSVItem item)\n\t{\n\t\titemList.add(item);\n\t}", "public int addItem(Itemset i);", "public void addItem(String itemPath) {\n\n\t\tImage img = new Image(itemPath);\n\t\titemsList.add(img);\n\n\t}", "public void addItem(String nomItem, Item item) {\r\n \t\titems.putItem(nomItem, item);\r\n \t}", "public void addItem(Item i) {\r\n assert (ic != null);\r\n \r\n ic.setItem(i);\r\n ic.setHandler(handler);\r\n items.add(ic.getItem());\r\n }", "@Override\n public void addItem(ItemType item) {\n if (curArrayIndex > items.length - 1) {\n System.out.println(item.getDetails() + \" - This bin is full. Item cannot be added!\");\n }\n else if (item.getWeight() + curWeight <= maxWeight) {\n curWeight += item.getWeight();\n items[curArrayIndex++] = item;\n }\n else {\n System.out.println(item.getDetails() + \" - Overweighted. This item cannot be added!\");\n }\n if (item.isFragile()) {\n setLabel(\"Fragile - Handle with Care\");\n }\n\n }", "private void add(GroceryItem itemObj, String itemName) {\n\t\tbag.add(itemObj);\n\t\tSystem.out.println(itemName + \" added to the bag.\");\n\t}", "public void addItem(Item theItem) {\n\t\tif (inventory != null) {\n\t\t\tif (!isAuctionAtMaxCapacity()) {\n\t\t\t\t// Check item doesn't already exist as key in map\n\t\t\t\tif (inventory.containsKey(theItem)) {\n\t\t\t\t\t//ERROR CODE: ITEM ALREADY EXISTS\n\t\t\t\t\tSystem.out.println(\"That item already exists in the inventory.\");\n\t\t\t\t} else\n\t\t\t\t\tinventory.put(theItem, new ArrayList<Bid>());\n\t\t\t} else if (isAuctionAtMaxCapacity()) {\n\t\t\t\t//ERROR CODE: AUCTION AT MAX CAPACITY\n\t\t\t\tSystem.out.println(\"\\nYour auction is at maximum capacity\");\n\t\t\t} \n\t\t} else {\n\t\t\tinventory = new HashMap<Item, ArrayList<Bid>>();\n\t\t\tinventory.put(theItem, new ArrayList<Bid>());\t\t\t\t\n\t\t} \t\t\t\t\t\t\n\t}", "@Override\r\n\t\t\t\t\tpublic void addItemEventOccurred(AddItemEvent event) {\n\r\n\t\t\t\t\t}", "public void addItem(LineItem item)\r\n {\r\n\t ChangeEvent event = new ChangeEvent(this);\r\n\t if(items.contains(item))\r\n\t {\r\n\t\t \r\n\t\t counter = 0;\r\n\t\t items.add(item);\r\n\t\t //tem.addQuantity();\r\n\t\t //tem.getQuantity();\r\n\t\t for(int i = 0; i < items.size(); i++)\r\n\t\t {\r\n\t\t\t if(items.get(i).equals(item))\r\n\t\t\t {\r\n\t\t\t counter++;\r\n\t\t\t }\r\n\t\t }\r\n\t\t for (ChangeListener listener : listeners)\r\n\t\t listener.stateChanged(event);\r\n\t\t System.out.print(\"\\r Quantity of \" + item.toString() + \": \"+ counter);\r\n\t\t \r\n\t }\r\n\t else\r\n\t {\r\n\t\t counter = 1;\r\n\t// item.addQuantity();\r\n\t// item.getQuantity();\r\n\t\t items.add(item);\r\n\t// System.out.println(item.getQuantity());\r\n\t\t for (ChangeListener listener : listeners)\r\n\t\t listener.stateChanged(event);\r\n\t \t\r\n\t \tSystem.out.print(\"\\n Quantity of \" + item.toString() + \": \"+ counter);\r\n\t \r\n\t\t \r\n\t }\r\n\t\t\r\n \r\n }", "public void addItemInventory(Item item){\n playerItem.add(item);\n System.out.println(item.getDescription() + \" was taken \");\n System.out.println(item.getDescription() + \" was removed from the room\"); // add extra information to inform user that the item has been taken\n }", "public void add( Order item ) {\n\t\tsuper.internalAdd(item);\n\t}", "public void addCostItem(CostItem item) throws CostManagerException;", "public void addItem(Item item){\n if(ChronoUnit.DAYS.between(LocalDate.now(), item.getBestBefore()) <= 2){\n //testInfoMessage = true; //ONLY FOR TESTING\n infoMessage(item.getName(), item.getBestBefore()); // DISABLE FOR TESTING\n }\n itemList.add(item);\n totalCost += item.getPrice();\n }", "public void addItem(Item param) {\r\n if (localItem == null) {\r\n localItem = new Item[] { };\r\n }\r\n\r\n //update the setting tracker\r\n localItemTracker = true;\r\n\r\n java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localItem);\r\n list.add(param);\r\n this.localItem = (Item[]) list.toArray(new Item[list.size()]);\r\n }", "public void addItems(ResultItem rItem) {\r\n\t\titems.add(rItem);\r\n\t}", "void add(T item);", "protected void addInventoryItemType() {\n\t\tProperties props = new Properties();\n\n\t\t/* DEBUG\n\t\t\n\t\tSystem.out.println(typeNameTF.getText());\n\t\tSystem.out.println(unitsTF.getText());\n\t\tSystem.out.println(unitMeasureTF.getText());\n\t\tSystem.out.println(validityDaysTF.getText());\n\t\tSystem.out.println(reorderPointTF.getText());\n\t\tSystem.out.println(notesTF.getText());\n\t\tSystem.out.println(statusCB.getValue());\n\t\n\t\t*/ \n\n\t\t// Set the values.\n\t\tprops.setProperty(\"ItemTypeName\", typeNameTF.getText());\n\t\tprops.setProperty(\"Units\", unitsTF.getText());\n\t\tprops.setProperty(\"UnitMeasure\", unitMeasureTF.getText());\n\t\tprops.setProperty(\"ValidityDays\", validityDaysTF.getText());\n\t\tprops.setProperty(\"ReorderPoint\", reorderPointTF.getText());\n\t\tprops.setProperty(\"Notes\", notesTF.getText());\n\t\tprops.setProperty(\"Status\", (String) statusCB.getValue());\n\n\t\t// Create the inventory item type.\n\t\tInventoryItemType iit = new InventoryItemType(props);\n\n\t\t// Save it into the database.\n\t\tiit.update();\n\n\t\tpopulateFields();\n\t\t\n\t\t// Display message on GUI.\n\t\t//submitBTN.setVisible(false);\n\t\tcancelBTN.setText(\"Back\");\n\t\tmessageLBL.setText(\"Inventory Item Type added.\");\n\t}", "public void add(int index, Object item)\n {\n items[index] = item;\n numItems++;\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic void add(T item){\n\t\t\n\n\t\tif(currentsize == data.length-1){\n\t\t\tgrow();\n\t\t}\n\n\t\t\n\t\tdata[currentsize] = item;\n\t\tcurrentsize++;\n\n\n\t}", "public void add(TradeItem newItem) {\n if (newItem.isUnique()) {\n removeType(newItem);\n }\n items.add(newItem);\n }", "public void add(Thing newThing)\r\n {\r\n \titems.add(newThing);\r\n }", "@Test\n\tpublic void testAddItem() throws IOException{\n\t\tModel.addItem(item, amount + \"\");\n\t\tassertEquals(amount + \"\", Model.hash.get(item));\n\t\t\n\t}", "void add(E item);", "void add(E item);", "void add(E item);", "public void add(ItemInfo item) {\n\t\tsynchronized (mContents) {\n\t\t\titem.registerObserver(this);\n\t\t\tmContents.add(item);\n\t\t\tif (item instanceof ShortCutInfo) {\n\t\t\t\tif (((ShortCutInfo) item).getRelativeItemInfo() == null) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tmTotleUnreadCount += ((ShortCutInfo) item).getRelativeItemInfo().getUnreadCount();\n\t\t\t}\n\t\t}\n\t}", "@SuppressWarnings (\"unchecked\") public void add(String item){\n if(item==null)\n return;\n items.add(item.trim());\n }", "public void addFileUploaderItem(FileUploaderItem item) {\n m_items.addView(item, new LinearLayout.LayoutParams(\n ViewGroup.LayoutParams.MATCH_PARENT,\n ViewGroup.LayoutParams.WRAP_CONTENT\n ));\n }", "public void addItem(LineItem lineItem){\n\t\t\n\t\tlineItems.add(lineItem);\n\t}", "public void addItem(Item newItem){\n // check for duplicate item ID\n for (Item item: items) {\n if (item.getItemID() == newItem.getItemID()) {\n item.setQuantity(item.getQuantity() + 1);\n return;\n }\n }\n newItem.setQuantity(1);\n this.items.add(newItem);\n }", "public void addProduct(Product item){\n inventory.add(item);\n }", "public void addItem(String key, Item item) throws IOException {\n\n itemMap.get(key).add(item);\n\n if(item.getImportance().equals(\"yes\")) importantItemList.add(item);\n\n notifyObservers(item);\n\n fileWrite.saveItemMap(this, file);\n\n }", "@RequestMapping(method=RequestMethod.POST, value = \"/item/{id}\", produces = \"application/json\")\n public void addItem(@RequestBody Item itemToAdd)\n {\n this.itemRepository.addItem(itemToAdd);\n }", "@Override\r\n\tpublic void AddItem(int n) {\n\t\tSystem.out.println(\"ADDED:\" + n);\r\n\r\n\t}", "public void addItem(Item newItem){\n\t\tif(newItem!=null){\r\n\t\t\tif(newItem.stackable()){\r\n\t\t\t\taddItemStack(newItem);\r\n\t\t\t\tdisplayIcon();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\taddFullStack(newItem);\r\n\t\t\tdisplayIcon();\r\n\t\t}\r\n\t}", "public void add(E item) {\n\t\tDblListnode<E> tmp = lastNode;\n\t\tlastNode.setNext(new DblListnode<E>(item));\n\t lastNode = lastNode.getNext();\n\t lastNode.setPrev(tmp);\n\t numItems++;\n\t}", "@Override\n public void onItemAdded(Object toAdd) {\n if(toAdd instanceof SpotifyItem)\n return;\n\n //Reflect changes in the drink list\n DrinkInfo item = (DrinkInfo)toAdd;\n Log.d(TAG, \"Array size = \" + mDrinkInfos.size());\n mDrinkInfos.add(mDrinkInfos.size(), item);\n mDrinkQueueAdapter.notifyDataSetChanged();\n Log.d(TAG, \"Added song: \" + item.getDrinkName());\n }", "public void addItem(Item itemToAdd){\n\t\tif(!isFull()){\n\t\t\tint index = findFreeSlot();\n\t\t\tinventoryItems[index] = itemToAdd;\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(\"Inventory full.\");\n\t\t}\n\t\t\n\t}", "public void addItem(Product p) {\n\t\t_items.add(p);\n\t}", "public void add(String nameItem)\n\t{\n\t\tmenu.add(nameItem);\n\t}", "public void addProduct(Product item)\n {\n stock.add(item);\n }", "public void addItem(Item item) {\n this.reservationItems.add(new ReservationItem(item, this));\n }", "public void add(MenuItem item) {\n this.items.add(item);\n }", "public void addItem(Item item) {\n if (winner(item)) {\n listItems.add(item);\n }\n }", "public void addItem(Item item)\n\t{\n\t\tif(inventory.size()<=9)\n\t\t\tinventory.add(item);\n\t\telse\n\t\t\tSystem.out.println(\"Inventory is full.\");\n\t}", "void addGroceryItem(String item) {\n\n\t}", "public void addGroceryItem(String item){\n groceryList.add(item);\n }", "public void add(Item item) {\n for (int i = 0; i < items.length; i++) {\n if (items[i] == null) {\n items[i] = item;\n break;\n }\n }\n }", "public boolean add (E item)\n {\n add(size, item); // calling public method add\n return true;\n }", "private void addItem(UndoItem item, RefactoringSession session) {\n if (wasUndo) {\n LinkedList<UndoItem> redo = redoList.get(session);\n redo.addFirst(item);\n } else {\n if (transactionStart) {\n undoList.put(session, new LinkedList<UndoItem>());\n descriptionMap.put(undoList.get(session), description);\n transactionStart = false;\n }\n LinkedList<UndoItem> undo = this.undoList.get(session);\n undo.addFirst(item);\n }\n if (!(wasUndo || wasRedo)) {\n redoList.clear();\n }\n }", "public void adicionar(ItemProduto item) {\n\t\titens.add(item);\n\t}", "public void addItem(int indexItemset, Item item) {\n itemsets.get(indexItemset).addItem(item);\n numberOfItems++;\n }" ]
[ "0.8303469", "0.8212502", "0.8006877", "0.7989325", "0.7989325", "0.7956037", "0.78282315", "0.7810494", "0.7764311", "0.7715689", "0.7710162", "0.7683108", "0.76675206", "0.76542354", "0.76295406", "0.7566629", "0.7549649", "0.7513583", "0.74688303", "0.74569184", "0.74521714", "0.7422691", "0.7412629", "0.739632", "0.7375215", "0.73751926", "0.73546916", "0.73516536", "0.7345092", "0.7333204", "0.7304307", "0.7142205", "0.71374065", "0.7108024", "0.7107808", "0.7103155", "0.709597", "0.7093872", "0.7084402", "0.70536745", "0.7047893", "0.7046203", "0.7042561", "0.70314556", "0.70201445", "0.7019609", "0.69871783", "0.69754404", "0.6970042", "0.69608104", "0.6957532", "0.6944186", "0.69403166", "0.6935942", "0.6932664", "0.6911286", "0.68852156", "0.6880502", "0.68798864", "0.6878932", "0.68779486", "0.68774265", "0.68616676", "0.6848897", "0.684661", "0.6840311", "0.6835636", "0.6832687", "0.68300074", "0.6825848", "0.68253815", "0.68253815", "0.68253815", "0.68239117", "0.68157995", "0.6810054", "0.68028975", "0.6788031", "0.6775659", "0.67749333", "0.6773932", "0.676349", "0.6748352", "0.67415035", "0.67340446", "0.6733468", "0.6731285", "0.6723441", "0.6718652", "0.67126626", "0.67109376", "0.67052513", "0.6694069", "0.66894567", "0.6677481", "0.66679454", "0.66476715", "0.66360134", "0.6634327", "0.66321975" ]
0.6841715
65
Description of the method deleteItem.
public void deleteItem(int itemCollection_id, int item_id) { // Start of user code for method deleteItem // End of user code }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public DeleteItemOutcome deleteItem(DeleteItemSpec spec);", "@Override\n\tpublic void deleteItem(Object toDelete) {}", "public void deleteItem() {\n\t\t\tAsyncCallback<BmUpdateResult> callback = new AsyncCallback<BmUpdateResult>() {\n\t\t\t\t@Override\n\t\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\t\tstopLoading();\n\t\t\t\t\tshowErrorMessage(this.getClass().getName() + \"-deleteItem(): ERROR \" + caught.toString());\n\t\t\t\t}\n\n\t\t\t\t@Override\n\t\t\t\tpublic void onSuccess(BmUpdateResult result) {\n\t\t\t\t\tstopLoading();\n\t\t\t\t\tprocessItemDelete(result);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// Llamada al servicio RPC\n\t\t\ttry {\n\t\t\t\tif (!isLoading()) {\n\t\t\t\t\tstartLoading();\n\t\t\t\t\tgetUiParams().getBmObjectServiceAsync().delete(bmoRequisitionItem.getPmClass(), bmoRequisitionItem, callback);\n\t\t\t\t}\n\t\t\t} catch (SFException e) {\n\t\t\t\tstopLoading();\n\t\t\t\tshowErrorMessage(this.getClass().getName() + \"-deleteItem(): ERROR \" + e.toString());\n\t\t\t}\n\t\t}", "@Override\n public void deleteItem(P_CK t) {\n \n }", "public void delete(MainItemOrdered mainItemOrdered);", "public DeleteItemOutcome deleteItem(PrimaryKey primaryKey);", "public boolean deleteItem(int index);", "private void deleteitem() {\n if (mCurrentItemInfoUri != null) {\n DialogInterface.OnClickListener yesButtonClickListener =\n new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n mProgressbarView.setVisibility(View.VISIBLE);\n ContentValues values = null;\n new updateDeleteItemToDbTask().execute(values);\n }\n };\n // Show dialog that there are unsaved changes\n showConfirmationDeleteDialog(yesButtonClickListener);\n }\n }", "void deleteItem(IDAOSession session, int id);", "@Override\r\n\t\tpublic boolean deleteItem() {\n\t\t\treturn false;\r\n\t\t}", "@Override\r\n\tpublic void deleteItem() {\n\t\taPList.remove();\r\n\t}", "private void deleteItem(){\n //Only perform the delete if this is an existing item.\n if(mCurrentItemUri != null){\n //Call the ContentResolver to delete the item at the given content URI.\n //Pass in null for the selection and selection args because the mCurrentItemUri\n //content URI already identifies the item that we want.\n int rowsDeleted = getContentResolver().delete(mCurrentItemUri, null, null);\n\n //Show a toast message depending on weather or not the delete was successful.\n if(rowsDeleted == 0){\n //If no rows were deleted, then there was an error with the delete.\n Toast.makeText(this, \"Error with deleting item\",\n Toast.LENGTH_SHORT).show();\n }else {\n //Otherwise, the delete was successful and we can display a toast\n Toast.makeText(this, \"Item deleted\",\n Toast.LENGTH_LONG).show();\n }\n }\n //Close the activity\n finish();\n }", "@Test\n public void deleteItem() {\n Item item = new Item();\n item.setName(\"Drill\");\n item.setDescription(\"Power Tool\");\n item.setDaily_rate(new BigDecimal(\"24.99\"));\n item = service.saveItem(item);\n\n // Delete the Item from the database using the Item API method\n service.removeItem(item.getItem_id());\n\n // Test the deleteItem() method\n verify(itemDao, times(1)).deleteItem(integerArgumentCaptor.getValue());\n TestCase.assertEquals(item.getItem_id(), integerArgumentCaptor.getValue().intValue());\n }", "public void delete(Exercise item) {\n mAdapter.deleteItem(item);\n new AsyncDelete().execute(item);\n }", "public void deleteItem(String nomItem) {\r\n \t\titems.removeItem(nomItem);\r\n \t}", "public void delete(ItemsPk pk) throws ItemsDaoException;", "@Override\n\tpublic boolean delete(Item obj) {\n\t\ttry{\n\t\t\tString query=\"DELETE FROM items WHERE id = ?\";\n\t\t\tPreparedStatement state = conn.prepareStatement(query,ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);\n\t\t\tstate.setInt(1, obj.getIndex());\n\t\t\tint nb_rows = state.executeUpdate();\n\t\t\tSystem.out.println(\"Deleted \"+nb_rows+\" lines\");\n\t\t\tstate.close();\n\t\t\t\n\t\t\t// Notify the Dispatcher on a suitable channel.\n\t\t\tthis.publish(EntityEnum.ITEM.getValue());\n\t\t\t\n\t\t\treturn true;\n\t\t} catch (SQLException e){\n\t\t\tJOptionPane jop = new JOptionPane();\n\t\t\tjop.showMessageDialog(null, e.getMessage(),\"PostgreSQLItemDao.delete -- ERROR!\",JOptionPane.ERROR_MESSAGE);\n\t\t\treturn false;\n\t\t} catch (Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\t\n\t}", "public void deleteTodoItem(TodoItem item) {\n todoItems.remove(item);\n }", "public void deleteItem(ToDoList item) {\n SQLiteDatabase db = this.getWritableDatabase();\n db.delete(TABLE_NAME, KEY_ID + \" = ?\",\n new String[]{String.valueOf(item.getId())});\n db.close();\n }", "public DeleteItemOutcome deleteItem(PrimaryKey primaryKey,\n Expected... expected);", "public void deleteCostItem(CostItem item) throws CostManagerException;", "public void deleteItem(final SavedItem item) {\n final SavedItem savedItem = item;\n final String name = item.getName();\n final AlertDialog dialog = new AlertDialog.Builder(this)\n .setTitle(\"Delete \" + name)\n .setMessage(name+ \" and its associated sorting data will be removed\")\n .setPositiveButton(\"Yes\", null)\n .setNegativeButton(\"No\", null)\n .show();\n Button positiveButton = dialog.getButton(AlertDialog.BUTTON_POSITIVE);\n positiveButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n Toast.makeText(SavedItemListActivity.this, (name + \" Deleted.\"), Toast.LENGTH_SHORT).show();\n vm.deleteSavedItem(item);\n dialog.dismiss();\n }\n });\n }", "private void deleteItem() {\n // Only perform the delete if this is an existing inventory item\n if (mCurrentInventoryUri != null) {\n // Call the ContentResolver to delete the inventory item at the given content URI.\n // Pass in null for the selection and selection args because the mCurrentInventoryUri\n // content URI already identifies the inventory item that we want.\n int rowsDeleted = getContentResolver().delete(mCurrentInventoryUri, null, null);\n\n // Show a toast message depending on whether or not the delete was successful.\n if (rowsDeleted == 0) {\n // If no rows were deleted, then there was an error with the delete.\n Toast.makeText(this, getString(R.string.editor_delete_inventory_failed),\n Toast.LENGTH_SHORT).show();\n } else {\n // Otherwise, the delete was successful and we can display a toast.\n Toast.makeText(this, getString(R.string.editor_delete_inventory_successful),\n Toast.LENGTH_SHORT).show();\n }\n }\n\n // Close the activity\n finish();\n }", "@Override\n\t@RequestMapping(value=ZuelControllerValue.Manage+\"deleteItem\")\n\tpublic ZuelResult deleteItem(Long id) throws Exception {\n\t\treturn service.deleteItem(id);\n\t}", "public boolean deletePlayerItem(PlayerItem playerItem);", "private void deleteItem(Item item) {\n updateItemInStoreList(item, DELETE_ITEM_OP);\n itemListViewModel.setList(storeList);\n }", "@Override\n\tpublic Item delete() {\n\t\treadAll();\n\t\tLOGGER.info(\"\\n\");\n\t\t//user can select either to delete a customer from system with either their id or name\n\t\tLOGGER.info(\"Do you want to delete record by Item ID\");\n\t\tlong id = util.getLong();\n\t\titemDAO.deleteById(id);\n\t\t\t\t\n\t\t\t\t\n\t\treturn null;\n\t}", "int deleteByExample(HpItemParamItemExample example);", "void onItemDelete(int position);", "void onItemDeleted();", "public void delete(CbmCItemFininceItem entity);", "void checkItemForDelete(Object item, java.sql.Statement stmt) throws PrismsRecordException;", "void onDeleteItem(E itemElementView);", "@Override\n public boolean deleteItem(String groupId, String itemId) {\n return new Item(groupId, itemId).getFile().delete();\n }", "public void deleteItem(MySmsMessage item){\n if(dataset.contains(item)){\n int pos=dataset.indexOf(item);\n dataset.remove(pos);\n notifyItemRemoved(pos);\n }\n }", "int deleteByPrimaryKey(String itemFlow);", "public void deleteItem(String itemName) throws ToDoListDAOException{\r\n\t\t// TODO Auto-generated method stub\r\n\t\tSession session = factory.openSession();\r\n\r\n\t\t try\r\n\t\t {\r\n\t\t session.beginTransaction();\r\n\t\t Query query = session.createQuery(\"delete from Items where itemName = :itemName\");\r\n\t\t query.setParameter(\"itemName\", itemName);\r\n\t\t int id1= query.executeUpdate();\r\n\t\t if(id1==0)\r\n\t\t {\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"The Item Name isn't correct, you didn't delete anything\", \"Error\", JOptionPane.INFORMATION_MESSAGE);\r\n\t\t }\r\n\t\t session.getTransaction().commit();\r\n\t\t }\r\n\t\t catch (HibernateException e)\r\n\t\t {\r\n\t\t e.printStackTrace();\r\n\t\t if(session.getTransaction()!=null) session.getTransaction().rollback();\r\n\t\t }\r\n\t\t finally\r\n\t\t {\r\n\t\t\t if(session != null) \r\n\t\t\t\t{ \r\n\t\t\t\t\tsession.close(); \r\n\t\t\t\t}\r\n\t\t } \r\n\t}", "public static void deleteItem(String itemToDelete){\n\t\tint saveFilePosition=getItemPosition(itemToDelete);\n\t\titemList.remove(saveFilePosition);\n\t\tpopulateList(todoList,false);\n\t\tpopulateList(archiveList,true);\n\n\t}", "@Test\n\tpublic void deleteItemTest() {\n\t\tInteger associatedAccountId_1 = 1;\n\t\tString type_1 = \"deposit\";\n\t\tString date_1 = \"2018-04-03\";\n\t\tInteger amount_1 = 100;\n\t\tString description_1 = \"This is test transaction number one\";\n\t\tTransaction testDeleteTransaction_1 = new Transaction();\n\t\ttestDeleteTransaction_1.setAssociatedAccountId(associatedAccountId_1);\n\t\ttestDeleteTransaction_1.setType(type_1);\n\t\ttestDeleteTransaction_1.setDate(date_1);\n\t\ttestDeleteTransaction_1.setAmount(amount_1);\n\t\ttestDeleteTransaction_1.setDescription(description_1);\n\t\ttransacRepoTest.saveItem(testDeleteTransaction_1);\t\t\n\t\t\n\t\t//should now be 1 transaction in the repo\t\t\n\t\tArrayList<Transaction> transList = transacRepoTest.getItemsFromAccount(associatedAccountId_1);\n\t\tassertEquals(transList.size(), 1);\n\t\t\t\n\t\ttransacRepoTest.deleteItem(associatedAccountId_1);\n\n\t\t//should now be 0 transactions in the repo\n\t\ttransList = transacRepoTest.getItemsFromAccount(associatedAccountId_1);\n\t\tassertEquals(transList.size(), 0);\n\t\t\n\t}", "public E delete(E item){\n\t\troot = delete(item, root);\n\t\treturn deleteReturn;\n\t}", "private void deleteItem()\n {\n System.out.println(\"Delete item with the ID: \");\n\n BufferedReader bufferRead = new BufferedReader(new InputStreamReader(System.in));\n try {\n Long id = Long.valueOf(bufferRead.readLine());\n ctrl.deleteItem(id);\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n\n }", "public DeleteItemOutcome deleteItem(String hashKeyName, Object hashKeyValue);", "@RequestMapping(method=RequestMethod.DELETE, value = \"/item/{id}\")\n public void deleteItem(@PathVariable (name = \"id\") UUID id)\n {\n this.itemRepository.deleteItem(id);\n }", "int deleteByPrimaryKey(Integer fitemid);", "@PreAuthorize(\"hasAuthority('PARENT')\")\n\t@RequestMapping(value = \"/delete/{id}\", method = RequestMethod.GET)\n\tpublic String deleteItem(@PathVariable(\"id\") Long itemId, Model model) {\n\t\trepository.deleteById(itemId);\n\t\treturn \"redirect:../itemlist\";\n\t}", "public DeleteItemOutcome deleteItem(KeyAttribute ... primaryKeyComponents);", "@FXML\r\n\tpublic void deleteItem() {\r\n\t\tcontroller.deleteWishlistItem(listView.getSelectionModel().getSelectedItem().getId());\r\n\t\tlistView.setItems(controller.getWishlistWatchesForCurrentUser());\r\n\t\tlistView.getSelectionModel().select(-1);\r\n\t}", "private void deleteItem(int position){\n deleteItem(dataset.get(position),position);\n }", "public void deleteItem(int index) {\n this.items.remove(index);\n }", "@Test\n void deleteItem() {\n }", "protected abstract void removeItem();", "public void deleteItem(MenuItem menuItem) {\n\n // delete shopping list item from database\n dbHandler.deleteShoppingListItem((int) id);\n\n // display \"Item deleted!\" toast\n Toast.makeText(this, \"Item deleted!\", Toast.LENGTH_LONG).show();\n }", "public void deleteItem(MySmsMessage item,int position){\n dataset.remove(item);\n notifyItemRemoved(position);\n }", "public DeleteItemOutcome deleteItem(String hashKeyName, Object hashKeyValue,\n Expected... expected);", "public void deleteItem() {\n\t\tIntent intent = new Intent(this, AlarmActivity.class);\n\t\tint alarmId = itemsAdapter.getSelectedItem().getId();\n\t\tLog.d(TAG, \"Cancelling Alarm with ID \" + alarmId); \n\t\tPendingIntent sender = PendingIntent.getBroadcast(this, alarmId, intent, 0);\n\t\tAlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);\n\t\talarmManager.cancel(sender);\n\t\t\n\t\titemsAdapter.remove(itemsAdapter.getSelectedPosition());\n\t\titemsAdapter.unsetSelectedPosition();\n\t\tgetActionBar().hide();\n\t}", "@RequestMapping(value = \"/api/todo-items/{id}\", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)\n\tpublic ResponseEntity<TodoItem> deleteItem(@PathVariable(\"id\") long id) {\n\t\tSystem.out.println(\"Fetching & Deleting task with id \" + id);\n\n\t\tTodoItem item = todoItemService.findById(id);\n\t\tif (item == null) {\n\t\t\tSystem.out.println(\"Unable to delete. Item with id \" + id + \" not found\");\n\t\t\treturn new ResponseEntity<TodoItem>(HttpStatus.NOT_FOUND);\n\t\t}\n\n\t\ttodoItemService.delete(id);\n\t\treturn new ResponseEntity<TodoItem>(HttpStatus.NO_CONTENT);\n\t}", "public void clickDeleteRecyclerView(final Item item){\n try{\n realm.executeTransaction(new Realm.Transaction() {\n @Override\n public void execute(Realm realm) {\n // RealmResults<Item> result = realm.where(Item.class).equalTo(\"id\",item.getId()).findAll();\n //result.deleteAllFromRealm();\n }\n });\n }catch (Exception e){\n Log.i(CLASS_NAME,e.getMessage());\n }\n }", "@Test\n public void testDeleteItem() {\n System.out.println(\"deleteItem\");\n String name = \"\";\n MainWindow1 instance = new MainWindow1();\n boolean expResult = false;\n boolean result = instance.deleteItem(name);\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "void rawDelete(Context context, Item item) throws SQLException, AuthorizeException, IOException\n {\n // Check authorisation here. If we don't, it may happen that we remove the\n // metadata but when getting to the point of removing the bundles we get an exception\n // leaving the database in an inconsistent state\n authorizeService.authorizeAction(context, item, Constants.REMOVE);\n\n context.addEvent(new Event(Event.DELETE, Constants.ITEM, item.getID(), item.getHandle(context)));\n\n log.info(LogManager.getHeader(context, \"delete_item\", \"item_id=\"\n + item.getID()));\n\n // Remove bundles\n removeAllBundles(context, item);\n\n // remove all of our authorization policies\n authorizeService.removeAllPolicies(context, item);\n \n // Remove any Handle\n handleService.unbindHandle(context, item);\n \n // remove version attached to the item\n removeVersion(context, item);\n\n\n // Finally remove item row\n itemDAO.delete(context, item);\n }", "public void delete(HrCStatitem entity);", "@Override\n public void onDeleteItemFromBench(CharacterItem item) {\n }", "@Override\n\tpublic void deleteDBDlItemById(long paramLong)\n\t{\n\n\t}", "@Test \n\tpublic void testDeleteBasketItem() throws Exception {\n\t\tBBBBasket basket = AccountHelper.getInstance().getBasket();\n\t\t\n\t\tif(basket == null || basket.items == null || basket.items.length < 1) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tString id = basket.items[0].id;\n\t\t\n\t\tBBBRequest request = BBBRequestFactory.getInstance().createDeleteBasketItemRequest(id);\n\t\tString expectedUrl = AccountHelper.constructUrl(BBBRequestFactory.getInstance().getHostBasket(), String.format(PATH_MY_BASKETS_ITEMS_, id) );\n\t\tassertEquals(expectedUrl, request.getUrl());\n\t\t\n\t\tBBBResponse response = BBBRequestManager.getInstance().executeRequestSynchronously(request);\n\t\t\n\t\tif(response.getResponseCode() != HttpURLConnection.HTTP_OK) {\n\t\t\tfail(\"Error: \"+response.toString());\n\t\t}\n\t}", "@Synchronized\r\n public void deleteTransferModel(String itemId) {\r\n databaseHandler.getWritableDatabase();\r\n databaseHandler.deleteData(\r\n TableTransferModel.TABLE_NAME, TableTransferModel.id + \"=?\",\r\n new String[]{itemId + \"\"}\r\n );\r\n }", "public void deleteItem(ActionEvent actionEvent) {\n // find the list that the item belongs in\n // removeItem() from its parenting list\n }", "void deletingCatalogItemById(final Long id);", "@GetMapping(\"/deleteItem/{id}\")\n\tpublic String deleteItemById(@PathVariable(value=\"id\") long id) {\n\t\titemService.deleteItemById(id);\t\n\t\t\n\t\treturn \"redirect:/\";\n\t}", "@Override\n\tpublic void delete(Recipe entity) {\n\t\t\n\t}", "@Override\r\n\tpublic int delete(ActionContext arg0) throws Exception {\n\t\treturn 0;\r\n\t}", "@Override\n public void deleteItem(int position) {\n // User feedback that he deleted an ingredient\n Toast.makeText(getContext(), \"Deleted \" + ingredients.get(position).getTitle() + \" Successfully\", Toast.LENGTH_SHORT).show();\n // Actually removing the ingredient from the list\n ingredients.remove(position);\n // Notifying the adapter so he updates his display\n rv_adapt.notifyItemRemoved(position);\n\n // In case the last item was deleted, we shouldn't be able to perform a search\n if (ingredients.isEmpty()) {\n Button button_search = v.findViewById(R.id.button_search);\n button_search.setEnabled(false);\n }\n }", "@Modifying \n\t@Transactional\n\t@Query(value = \"DELETE FROM item_user WHERE item_id=?1\", nativeQuery = true)\n\tvoid deleteByIdItem(Long itemId);", "public void deleteItem() {\n\t\tMobileElement el = driver.findElement(By.xpath(\"//android.view.View[@resource-id='\" + deleteButton + \"']\"));\n\t\tel.findElementByClassName(\"android.widget.Button\").click();\n\t\ttry {\n\t\t\tThread.sleep(2000);\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void delete()\n\t{\n\t\ttry\n\t\t{\n\t\t\tConnection con = Connector.DBcon();\n\t\t\tString query = \"select * from items where IT_ID=?\";\n\t\t\t\n\t\t\tPreparedStatement pst = con.prepareStatement(query);\n\t\t\tpst.setString(1, txticode.getText());\n\t\t\tResultSet rs = pst.executeQuery();\n\t\t\t\n\t\t\tint count = 0;\n\t\t\twhile(rs.next())\n\t\t\t{\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\t\n\t\t\tif(count == 1)\n\t\t\t{\n\t\t\t\tint choice = JOptionPane.showConfirmDialog(null, \"Are you sure you want to delete selected item data?\", \"ALERT\", JOptionPane.YES_NO_OPTION);\n\t\t\t\tif(choice==JOptionPane.YES_OPTION)\n\t\t\t\t{\n\t\t\t\t\tquery=\"delete from items where IT_ID=?\";\n\t\t\t\t\tpst = con.prepareStatement(query);\n\t\t\t\t\t\n\t\t\t\t\tpst.setString(1, txticode.getText());\n\t\t\t\t\t\n\t\t\t\t\tpst.execute();\n\t\t\t\t\t\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Deleted Successfully\", \"RESULT\", JOptionPane.INFORMATION_MESSAGE);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tloadData();\n\t\t\t\t\n\t\t\t\trs.close();\n\t\t\t\tpst.close();\n\t\t\t\tcon.close();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\telse\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Record Not Found!\", \"Alert\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\n\t\t\trs.close();\n\t\t\tpst.close();\n\t\t\tcon.close();\n\t\t\t\n\t\t} \n\t\tcatch (Exception e)\n\t\t{\n\t\t\tJOptionPane.showMessageDialog(null, e);\n\t\t}\n\t}", "public void removeItem(int id);", "public void delete(Comparable<T> item)\r\n {\r\n root = delete(root,item);\r\n }", "public int deleteItem(Connection conn, int item_no) {\r\n\t\ttry {\r\n\t\t\tPreparedStatement pstmt = conn.prepareStatement(\"delete item_XXXX where item_no=?\");\r\n\t\t\tpstmt.setInt(1, item_no);\r\n\t\t\tint count = pstmt.executeUpdate();\r\n\t\t\treturn count;\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn 0;\r\n\t}", "@Override\n\t\tpublic void deleteItem(int index) {\n\t\t\tmFiles.remove(index);\n\t\t}", "public void resourceDeleted(Resource item)\n\t{\n\t\tevent(\"ResourceDeletion\",\n\t\t\t item.getId(),\n\t\t\t -1,\n\t\t\t -1,\n\t\t\t false);\n\t}", "@Override\n public void delete(Context context, Item item) throws SQLException, IOException, AuthorizeException {\n //TODO: HIBERNATE CHECK COLLECTION REMOVE ?\n // Check authorisation here. If we don't, it may happen that we remove the\n // collections leaving the database in an inconsistent state\n authorizeService.authorizeAction(context, item, Constants.REMOVE);\n item.getCollections().clear();\n rawDelete(context, item);\n }", "public abstract boolean depleteItem();", "@Indexable(type = IndexableType.DELETE)\n\t@Override\n\tpublic ItemPublicacao deleteItemPublicacao(ItemPublicacao itemPublicacao) {\n\t\treturn itemPublicacaoPersistence.remove(itemPublicacao);\n\t}", "public void deleteTask(String item){\n SQLiteDatabase db = this.getWritableDatabase();\n db.execSQL(\"DELETE FROM ToDo where task='\"+item+\"'\");\n }", "public void deleteItem(LibraryItem item){\r\n\t\tif(this.inverntory.empty())\r\n\t\t\tthrow new RuntimeException(\"Inventory is empty.\");\r\n\t\t// as long as the list is not empty\r\n\t\twhile(!this.inverntory.endpos()){\r\n\t\t\t// check if current head of list is item you want deleted\r\n\t\t\tif(this.inverntory.elem() == item){\r\n\t\t\t\t// if it is, then delete item and report deletion\r\n\t\t\t\tthis.inverntory.delete();\r\n\t\t\t\tSystem.out.println(item+\" removed from inventory.\");\r\n\t\t\t}\r\n\t\t\t// if it is not head of list, advance in list\r\n\t\t\telse{\r\n\t\t\t\tthis.inverntory.advance();\r\n\t\t\t}\r\n\t\t// do so until you reach end of list/inventory\r\n\t\t}\r\n\t}", "public Inventory inventoryDelete (TheGroceryStore g, LinkedList<Inventory> deleter) throws ItemNotFoundException;", "private void onItemDeleted() {\n Log.i(\"BasketFragment\",\"deleted\");\n }", "public OrderItem deleteOrderItem(OrderItem orderItem)\n\t{\n\t\tif(findOrderItemById(orderItem.getId())==null)\n\t\t{\n\t\t\tSystem.out.println(\"Comanda si produsele care se doresc sterse nu exista\");\n\t\t\treturn null;\n\t\t}\n\t\tOrderItem orderIt=orderItemDAO.delete(orderItem);\n\t\treturn orderIt;\n\t}", "public void delete(T ob) throws ToDoListException;", "public DeleteTask(final android.content.Context ctx,\n final Reponses item) {\n super();\n this.ctx = ctx;\n this.item = item;\n }", "private void deleteItem()\n {\n Category categoryToDelete = dataCategories.get(dataCategories.size()-1);\n AppDatabase db = Room.databaseBuilder(getApplicationContext(),\n AppDatabase.class, \"database-name\").allowMainThreadQueries().build();\n db.categoryDao().delete(categoryToDelete);\n testDatabase();\n }", "@Override\r\n\tpublic void delete(Integer arg0) {\n\t\t\r\n\t}", "public static void deleteItem()\r\n\t{\r\n\t\tif(receiptList.getSelectedIndex() < listModel.getSize()-4 && receiptList.getSelectedIndex() > -1)\r\n\t\t{\r\n\t\t\tString itemPrice = receiptList.getSelectedValue().substring(0,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treceiptList.getSelectedValue().indexOf(\" \"));\r\n\t\t\t\r\n\t\t\tsubtotalAmount = subtotalAmount - Functions.toAmount(itemPrice);\r\n\t\t\tupdateTotals();\r\n\t\t\t\r\n\t\t\tlistModel.removeElementAt(receiptList.getSelectedIndex());\r\n\t\t\tif(listModel.getSize() == 4)\r\n\t\t\t\tclearReceipt();\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tfor(int count=0; count < 4; count++)\r\n\t\t\t\t\tlistModel.removeElementAt(listModel.getSize()-1);\r\n\t\t\t\tlistModel.addElement(\" \");\r\n\t\t\t\tlistModel.addElement(Functions.toMoney(subtotalAmount) + manualTab(Functions.toMoney(subtotalAmount)) + \"Subtotal \");\r\n\t\t\t\tlistModel.addElement(Functions.toMoney(taxAmount) + manualTab(Functions.toMoney(taxAmount)) + \"Tax\");\r\n\t\t\t\tlistModel.addElement(Functions.toMoney(totalAmount) + manualTab(Functions.toMoney(totalAmount)) + \"Total\");\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n\tpublic void delete(Note e) {\n\t\t\n\t}", "@Override\n\t\t\t\t\tpublic String getTitle() {\n\t\t\t\t\t\treturn item + \" deleted\";\n\t\t\t\t\t}", "@Override\n\t\t\tpublic boolean onActionItemClicked(ActionMode mode, MenuItem item) {\n\t\t\n\t\t\t\t \n\t\t\t\tswitch (item.getItemId()) {\n\t\t\t\tcase R.id.delete:\n\t\t\t\t\t\n\t\t\t\t\tfor(messagewrapper obje:dummyList){\n\t\t\t\t\t\t\n\t\t\t\t\t\tmAdapter.remove(obje);\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tcheckedCount=0;\n\t\t\t\t\t\n\t\t\t\t\tmode.finish();\n\t\t\t\t\treturn true;\n\t\t\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}", "private void delete() {\n\t\tComponents.questionDialog().message(\"Are you sure?\").callback(answeredYes -> {\n\n\t\t\t// if confirmed, delete the current product PropertyBox\n\t\t\tdatastore.delete(TARGET, viewForm.getValue());\n\t\t\t// Notify the user\n\t\t\tNotification.show(\"Product deleted\", Type.TRAY_NOTIFICATION);\n\n\t\t\t// navigate back\n\t\t\tViewNavigator.require().navigateBack();\n\n\t\t}).open();\n\t}", "@Override\n\tpublic void delete(Object entidade) {\n\t\t\n\t}", "int deleteByExample(PageItemCfgExample example);", "public void delete() {\n\n\t}", "public T delete(T item) \r\n {\r\n \tint code = item.hashCode(); // The hash code for the item\r\n \t\r\n \t// If the hashcode is negative\r\n \tif(code < 0)\r\n \t{\r\n \t\tcode = -code;\r\n \t}\r\n \t\r\n \tcode = code % size;\r\n \t\r\n \tif(hashTable[code].contains(item))\r\n \t{\r\n \t\tT temp = hashTable[code].get(hashTable[code].indexOf(item));\r\n \t\thashTable[code].remove(hashTable[code].indexOf(item));\r\n \t\tnumItems--;\r\n \t\treturn temp;\r\n \t}\r\n \telse\r\n \t{\r\n \t\treturn null;\r\n \t}\r\n }", "@DELETE \r\n @Path(\"/delete\") \r\n @Consumes(MediaType.APPLICATION_XML) \r\n @Produces(MediaType.TEXT_PLAIN) \r\n public String deleteItem(String itemData) {\n \tDocument doc = Jsoup.parse(itemData, \"\", Parser.xmlParser()); \r\n \t\r\n \t//Read the value from the element <itemID> \r\n \tString appointmentID = doc.select(\"appointmentID\").text(); \r\n \r\n \tString output = appObj.deleteAppointment(appointmentID); \r\n \r\n \treturn output; \r\n \t\r\n }" ]
[ "0.8009163", "0.7753249", "0.76887107", "0.7676455", "0.7644226", "0.75630975", "0.7562375", "0.75497675", "0.749032", "0.74835557", "0.7467528", "0.7444548", "0.7416013", "0.7389086", "0.7341961", "0.7332009", "0.73253435", "0.730438", "0.72916466", "0.7186408", "0.7174044", "0.71660924", "0.7154819", "0.71459895", "0.7144077", "0.71252656", "0.712355", "0.7094882", "0.70509183", "0.70229626", "0.6968484", "0.69486374", "0.693183", "0.6890075", "0.68750083", "0.6868297", "0.6864217", "0.684429", "0.6831621", "0.6830231", "0.67907023", "0.6770648", "0.6756766", "0.6746989", "0.67440975", "0.672298", "0.67007154", "0.6688209", "0.66881925", "0.6687877", "0.6631499", "0.6617637", "0.6617018", "0.65818024", "0.65784603", "0.6578029", "0.65635324", "0.6543505", "0.65344936", "0.6523532", "0.65176916", "0.65128475", "0.6504785", "0.6502732", "0.6498775", "0.6497969", "0.64850235", "0.6479447", "0.6472006", "0.6455127", "0.64537895", "0.6434618", "0.6417044", "0.6413305", "0.6408692", "0.64013475", "0.6401302", "0.6398188", "0.6396303", "0.63921875", "0.63898224", "0.63884807", "0.63791674", "0.6373745", "0.6366178", "0.6359674", "0.6356931", "0.6351992", "0.6349401", "0.63442653", "0.63414156", "0.63357073", "0.63331497", "0.63325524", "0.63319397", "0.6329851", "0.63239014", "0.6323758", "0.6320628", "0.6317956" ]
0.6780016
41
Description of the method getColumnType.
public String getColumnType(int column_id) { // Start of user code for method getColumnType String getColumnType = ""; return getColumnType; // End of user code }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Column.Type getType();", "public int getColumnType() {\n return (this.option >> 6) & 3;\n }", "public Class<?>[] getColumnTypes();", "RelDataType getColumnType(String sql);", "public int getColumnType(int position) {\n return columns[position].getType();\n }", "@Override\r\n\tpublic String getType() {\n\t\treturn \"column\";\r\n\t}", "public String getColType() {\r\n\t\treturn colType;\r\n\t}", "ColumnAffinityType getColumnType();", "@Override\n\tpublic int getColumnType(int col) throws SQLException {\n\n\t\tif (col <= width && col >= 1) {\n\t\t\tcol--;\n\n\t\t\tString str = table[0][col];\n\t\t\tStringTokenizer token = new StringTokenizer(str, \",\");\n\t\t\tString name = token.nextToken();\n\t\t\tString type = token.nextToken();\n\t\t\t/*\n\t\t\t * possible errors here according . we should check accurately the\n\t\t\t * name of types returned by amr to make sure they match the words\n\t\t\t * here . anyway I wrote them now and can be modified in\n\t\t\t * logartithmic time easily :P :D\n\t\t\t */\n\n\t\t\tif (type.equals(\"double\"))\n\t\t\t\treturn java.sql.Types.DOUBLE;\n\t\t\telse if (type.equals(\"integer\"))\n\t\t\t\treturn java.sql.Types.INTEGER;\n\t\t\telse if (type.equals(\"string\"))\n\t\t\t\treturn java.sql.Types.VARCHAR;\n\t\t\telse if (type.equals(\"boolean\"))\n\t\t\t\treturn java.sql.Types.BOOLEAN;\n\t\t\telse if (type.equals(\"date\"))\n\t\t\t\treturn java.sql.Types.DATE;\n\t\t\telse\n\t\t\t\treturn java.sql.Types.NULL;\n\n\t\t} else\n\t\t\tthrow new SQLException(\"column requested out of table bounds\");\n\n\t}", "public int getColumnType(Connection con, String table) throws SQLException {\r\n if (databaseColumnType == Types.NULL) {\r\n // For the sake of compatibility, always retrieve meta data with capitalized table and column names\r\n // first and afterwards (for Postgres) with lower-cased names\r\n try {\r\n databaseColumnType = selectDataType(con, table.toUpperCase(), databaseFieldName.toUpperCase());\r\n }\r\n catch(SQLException sqlx) {\r\n databaseColumnType = selectDataType(con, table.toLowerCase(), databaseFieldName.toLowerCase());\r\n }\r\n }\r\n return databaseColumnType;\r\n }", "public StrColumn getType() {\n return delegate.getColumn(\"type\", DelegatingStrColumn::new);\n }", "public StrColumn getType() {\n return delegate.getColumn(\"type\", DelegatingStrColumn::new);\n }", "@Override\n\tpublic int getType() {\n\t\treturn _expandoColumn.getType();\n\t}", "public Class<?> getColumnClass(int columnIndex) {\r\n return this.table.getSchema().getColumnType(columnIndex);\r\n }", "public DataType getColDataType(String columnName) {\n final ColumnDefinition x = this.columns.get(columnName.toLowerCase());\n\n return (x == null) ? null\n : x.getDataType();\n }", "public StrColumn getType() {\n return (StrColumn) (isText ? textFields.computeIfAbsent(\"type\", StrColumn::new) :\n getBinaryColumn(\"type\"));\n }", "public String getColumnDataType(String columnname){\r\n\t\tSystem.out.println(\"getColumnDataType, column name = \"+columnname);\r\n\t\tStatement st = null;\r\n\t\tString result = null;\r\n\t\ttry {\r\n\t\t\tst = conn.createStatement();\r\n\t\t\t\r\n\t\t\tString query = \"select data_type from information_schema.columns where table_name='sales' and column_name = '\"+columnname+\"'\";\r\n\t\t\tResultSet rs = st.executeQuery(query);\r\n\t\t\twhile(rs.next()){\r\n\t\t\t\tresult = rs.getString(1);\r\n\t\t\t\tSystem.out.println(\"getColumnDataType, result=\"+result);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\trs.close();\r\n\t\t\treturn result;\r\n\t\t}\r\n\t\tcatch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tfinally{\r\n\t\t\tif(st!=null){\r\n\t\t\t\ttry {\r\n\t\t\t\t\tst.close();\r\n\t\t\t\t} catch (SQLException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t}", "@Override\r\n public Class getColumnClass(int column) {\r\n return getValueAt(0, column).getClass();\r\n }", "@Override\n\tpublic String getColumnTypeName(int arg0) throws SQLException {\n\t\treturn tMeta[0].colType(arg0);\n\t}", "public String getSQLDataType(int displayType, String columnName, int fieldLength) {\n\t\treturn null;\n\t}", "@Override\n public Class getColumnClass(int c) {\n return getValueAt(0, c).getClass();\n }", "public TypeColis getTypeColis() {\r\n\t\treturn typeColis;\r\n\t}", "@Override\r\n\t\t\tpublic Class getColumnClass(int column)\r\n\t\t\t{\r\n\t\t\t\treturn getValueAt(0, column).getClass();\r\n\t\t\t}", "@Override\r\n\t\t\tpublic Class getColumnClass(int column)\r\n\t\t\t{\r\n\t\t\t\treturn getValueAt(0, column).getClass();\r\n\t\t\t}", "@Override\r\n\t\t\tpublic Class getColumnClass(int column)\r\n\t\t\t{\r\n\t\t\t\treturn getValueAt(0, column).getClass();\r\n\t\t\t}", "@Override\r\n\t\t\tpublic Class getColumnClass(int column)\r\n\t\t\t{\r\n\t\t\t\treturn getValueAt(0, column).getClass();\r\n\t\t\t}", "java.lang.String getDataType();", "private ColumnType typeOf(DataType type) {\n switch (type) {\n case _class:\n return ColumnType.nominal;\n case _float:\n return ColumnType.continuous;\n case _order:\n return ColumnType.ordinal;\n default:\n throw new IllegalArgumentException(\"Unknown type: \" + type);\n }\n }", "public Class getColumnClass(int column)\n\t {\n\t return getValueAt(0, column).getClass();\n\t }", "public String getDataType() ;", "@Override\n\tpublic String getColumnClassName(int arg0) throws SQLException {\n\t\treturn tMeta[0].colType(arg0-1);\n\t}", "@Override\n\tpublic java.lang.String getTypeSettings() {\n\t\treturn _expandoColumn.getTypeSettings();\n\t}", "public Class<?> getColumnClass(int columnIndex) {\n switch(columnIndex){\n case 0:\n return String.class;\n case 1:\n return Date.class;\n case 2:\n return String.class;\n case 3:\n return BigDecimal.class;\n }\n return super.getColumnClass(columnIndex);\n }", "protected abstract DTDataTypes52 getDataType(C column);", "@Override\n public Class<?> getColumnClass(int aColumn) {\n return model.getColumnClass(aColumn); \n }", "public LuaObject getcoltypes() throws SQLException\n {\n L.newTable();\n LuaObject table = L.getLuaObject(-1);\n \n ResultSetMetaData md = rs.getMetaData();\n \n for (int i = 1; i <= md.getColumnCount(); i++)\n {\n String name = md.getColumnTypeName(i);\n \n L.pushNumber(i);\n L.pushString(name);\n L.setTable(-3);\n }\n L.pop(1);\n \n return table;\n }", "private static String getColumnType(String columnValue) {\n\t\ttry {\r\n\t\t\tInteger.parseInt(columnValue);\r\n\t\t\treturn \"INTEGER\";\r\n\t\t} catch (Throwable error) {}\r\n\t\t// then, try to parse it as a float\r\n\t\ttry {\r\n\t\t\tDouble.parseDouble(columnValue);\r\n\t\t\treturn \"REAL\";\r\n\t\t} catch (Throwable error) {}\r\n\t\t// otherwise, it's a text column\r\n\t\treturn \"TEXT\";\r\n\t}", "public Object getExtensionType(String columnName) {\n FieldVector vector = table.getVector(columnName);\n return vector.getObject(rowNumber);\n }", "@Override public Class<?> getColumnClass(int iColumnIndex)\r\n {\r\n Class<?> cReturn = String.class;\r\n\r\n return cReturn;\r\n }", "@Override final public Class<?> getColumnClass( int columnIndex ) { return fColumnClasses[ columnIndex ]; }", "public Class getColumnClass(int c) {\r\n return getValueAt(0, c).getClass();\r\n }", "@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n\t\tpublic Class getColumnClass(int c) {\n return getValueAt(0, c).getClass();\n }", "public Class getAttributeType();", "public Class getColumnClass(int c) {\n return getValueAt(0, c).getClass();\n }", "public Class getColumnClass(int c) {\n return getValueAt(0, c).getClass();\n }", "public Class getColumnClass(int c) {\n return getValueAt(0, c).getClass();\n }", "@Override\r\n\t@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\r\n\tpublic Class getColumnClass(int columna) {\r\n\t\treturn getValueAt(0, columna).getClass();\r\n\t}", "public int getSqlType() { return _type; }", "public Class<?> getColumnClass(int column) {\r\n if (_debugTable == null) {\r\n return String.class ;\r\n } else {\r\n return getValueAt(0, column).getClass();\r\n }\r\n }", "@Override\n public Class<?> getColumnClass(int column) {\n return columnClasses[column];\n }", "@Override\n public Class<?> getColumnClass(int column) {\n return columnClasses[column];\n }", "public Class<?> getColumnClass(int column) {\r\n\tswitch (column){\r\n\t\tcase COLUMN_NAME:{\r\n\t\t\treturn String.class;\r\n\t\t}\r\n\t\tcase COLUMN_DESCRIPTION:{\r\n\t\t\treturn String.class;\r\n\t\t}\r\n\t\tcase COLUMN_UNIT:{\r\n\t\t\treturn String.class;\r\n\t\t}\r\n\t\tcase COLUMN_VALUE:{\r\n\t\t\treturn ScopedExpression.class;\r\n\t\t}\r\n\t\tdefault:{\r\n\t\t\treturn Object.class;\r\n\t\t}\r\n\t}\r\n}", "@Override\n\t\t\tpublic Class<?> getColumnClass(int column) {\n\t\t\t\treturn super.getColumnClass(column);\n\t\t\t}", "public Class<? extends AttributeDescription> getDataType();", "public Class getColumnClass(int c) {\r\n return getValueAt(0, c).getClass();\r\n }", "public Class getColumnClass(int c) {\r\n return getValueAt(0, c).getClass();\r\n }", "private static String getColumnClassDataType (String windowName2) {\n\r\n\t\tString classType = \"@Override \\n public Class getColumnClass(int column) { \\n switch (column) {\\n\";\r\n\t\tVector<WindowTableModelMapping> maps = getMapColumns(windowName2);\r\n\t\tfor (int i = 0; i < maps.size(); i++) {\r\n\t\t\tWindowTableModelMapping mp = maps.get(i);\r\n\t\t\tclassType = classType + \" case \" + i + \":\\n\";\r\n\t\t\tif(mp.getColumnDataType().equalsIgnoreCase(\"Boolean\")) {\r\n\t\t\t\tclassType = classType + \" return Boolean.class; \\n\";\r\n\t\t\t} else \tif(mp.getColumnDataType().equalsIgnoreCase(\"Integer\")) {\r\n\t\t\t\tclassType = classType + \" return Integer.class; \\n\";\r\n\t\t\t} else \t\t\tif(mp.getColumnDataType().equalsIgnoreCase(\"Double\")) {\r\n\t\t\t\tclassType = classType + \" return Double.class; \\n\";\r\n\t\t\t} else {\r\n\t\t\t\tclassType = classType + \" return String.class; \\n\";\r\n\t\t\t}\r\n\t\t\r\n \r\n\r\n\t\t}\r\n\t\tclassType = classType + \" default: \\n return String.class;\\n }\\n}\";\r\n\t\treturn classType;\r\n\t}", "public abstract Map<String, Integer> getColumnTypes(String tableName);", "public Class getColumnClass(int c) \n {\n return getValueAt(0, c).getClass();\n }", "@Override\r\n\tpublic Class<?> getColumnClass(final int column)\r\n\t{\n\t\t\r\n\t\treturn super.getColumnClass(column);\r\n\t}", "@Override\n public Class getColumnClass(int c) {\n // has any data ?\n // if not, return String class as default\n if (this.getRowCount()==0){\n return String.class;\n }\n \n return getValueAt(0, c).getClass();\n }", "public Class getColumnClass(int c) {\n\t\t\t\t\treturn getValueAt(0, c).getClass();\n\t\t\t\t}", "public StrColumn getClazz() {\n return delegate.getColumn(\"class\", DelegatingStrColumn::new);\n }", "public String getColumnName();", "com.google.cloud.datacatalog.FieldType getType();", "public Class<?> getColumnClass(int columnIndex) {\n if (columnIndex == 0) {\n return Boolean.class;\n } else {\n return String.class;\n }\n }", "public Class<?> getColumnClass(int column) {\n return String.class;\n }", "@Override\n public Class<?> getColumnClass(int columnIndex) {\n switch(columnTypes[columnIndex]) {\n case TEXT_COL:\n return String.class;\n\n case CURR0_COL:\n case CURR2_COL:\n return Double.class;\n\n case PERCENT_COL:\n return Double.class;\n\n default:\n return String.class;\n }\n }", "public String getFinancialDocumentColumnTypeCode() {\r\n return financialDocumentColumnTypeCode;\r\n }", "public Vector<Class<?>>getTableColumnClasses()\n\t{\n\t\tVector<Class<?>> vec = new Vector<Class<?>>(this.dbColumnNames.size());\n\t\tif( usesPrefix )\n\t\t{\n\t\t\tvec.add(String.class);\n\t\t} else {\n\t\t\tvec.add(Integer.class);\n\t\t}\n\t\treturn vec;\n\t}", "@Override\n public Class getColumnClass(int columnIndex) {\n if (columnIndex == COL_ID) {\n return String.class;\n } else if (columnIndex == COL_NAME) {\n return String.class;\n }\n return String.class;\n }", "public Class getColumnClass(int c) {\n \t\treturn getValueAt(0, c).getClass();\n \t}", "String getColumnName();", "@SuppressWarnings(\"unchecked\")\r\n\t\t\t\tpublic Class getColumnClass(int c) {\r\n\t\t \treturn getValueAt(0, c).getClass();\r\n\t\t \r\n\t\t }", "public Class getColumnClass(int c) \r\n\t {\n\t \treturn getValueAt(0, c).getClass(); \r\n\t }", "public int getDataType();", "public int getJdbcType();", "@Override\n public Class getColumnClass(int columnIndex) {\n Class clase = Object.class;\n\n Object aux = getValueAt(0, columnIndex);\n if (aux != null) {\n clase = aux.getClass();\n }\n\n return clase;\n }", "@SuppressWarnings(\"unchecked\")\r\n\t\t\tpublic Class getColumnClass(int c) {\r\n\t \treturn getValueAt(0, c).getClass();\r\n\t \r\n\t }", "void checkColumnType(\n String sql,\n String expected);", "protected String getTableColumn()\n\t\t{\n\t\t\treturn Column ;\n\t\t}", "public Class getColumnClass(int c)\n {\n \treturn getValueAt(0,c).getClass();\n }", "public Class getColumnClass(int c) {\r\n\t\treturn this.getValueAt(0, c).getClass();\r\n\t}", "public List<Column> getColumns();", "DatabaseTypes getDatabaseType();", "public String getSqlType() {\n\t\treturn this.sqlType;\n\t}", "public static int getColumnType(String colClassName) {\n\t\tint type = 0;\n\n\t\tif (colClassName.equals(\"java.util.Date\")) {\n\t\t\treturn 3;\n\t\t}\n\t\tif (colClassName.equals(\"java.sql.Date\")) {\n\t\t\treturn 3;\n\t\t}\n\t\tif (colClassName.equals(\"java.sql.Timestamp\")) {\n\t\t\treturn 3;\n\t\t}\n\t\tif (colClassName.equals(\"java.sql.Time\")) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (colClassName.equals(\"java.lang.Number\")) {\n\t\t\treturn 1;\n\t\t}\n\t\tif (colClassName.equals(\"java.math.BigDecimal\")) {\n\t\t\treturn 1;\n\t\t}\n\t\tif (colClassName.equals(\"java.math.BigInteger\")) {\n\t\t\treturn 1;\n\t\t}\n\t\tif (colClassName.equals(\"java.lang.Byte\")) {\n\t\t\treturn 1;\n\t\t}\n\t\tif (colClassName.equals(\"java.lang.Double\")) {\n\t\t\treturn 1;\n\t\t}\n\t\tif (colClassName.equals(\"java.lang.Float\")) {\n\t\t\treturn 1;\n\t\t}\n\t\tif (colClassName.equals(\"java.lang.Integer\")) {\n\t\t\treturn 1;\n\t\t}\n\t\tif (colClassName.equals(\"java.lang.Long\")) {\n\t\t\treturn 1;\n\t\t}\n\t\tif (colClassName.equals(\"java.lang.Short\")) {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn type;\n\t}", "List<ColumnType> getColumnTypes(String disease) throws SearchServiceException;", "public String getKeyType() \n {\n return DBFactory.getKeyTypeName(this.keyType);\n }", "int getDataType();", "public Class getColumnClass(int c)\n\t{\n\t\treturn getValueAt(0, c).getClass();\n\t}", "public ColumnsForType getColumnsForType(String type){\r\n\t\tColumnsForType cft = columnsForTypeCache.get(type);\r\n\t\tif(cft == null){\r\n\t\t\tcft = buildCache(type);\r\n\t\t\tcolumnsForTypeCache.put(type, cft);\r\n\t\t}\r\n\t\treturn cft;\r\n\t\t\r\n\t}", "public ScGridColumn<AcActionAutoCorrectedLog> newActualTypeColumn()\n {\n return newActualTypeColumn(\"Actual Type\");\n }", "public String getColumnForPrimaryKey() {\n return null;\n }", "public Class getColumnClass(int c)\n {\n\tif (c==0) {\n\t return String.class;\n\t} else {\n\t return Long.class;\n\t}\n }", "public Class<?> getColumnClass(int columnIndex)\r\n {\r\n return String.class;\r\n }", "public int getType() throws SQLException\n {\n return m_rs.getType();\n }", "@Override\n\tpublic String getDbType() {\n\t\treturn this.dbType;\n\t}", "public String getJavaType() {\n return type.getJavaType(isInt52());\n }", "com.google.protobuf.ByteString\n getColumnBytes();" ]
[ "0.7787329", "0.77425396", "0.7586266", "0.7500584", "0.7408355", "0.73983204", "0.72820836", "0.72468597", "0.7092824", "0.7090366", "0.6982554", "0.6982554", "0.6963235", "0.6927179", "0.6818836", "0.68045175", "0.6697079", "0.66830397", "0.6676706", "0.66293144", "0.66293013", "0.6616955", "0.6547668", "0.6547668", "0.6547668", "0.6547668", "0.65452653", "0.65081745", "0.64948887", "0.6476324", "0.64533013", "0.6431724", "0.64283127", "0.6423853", "0.64229214", "0.64225113", "0.63970333", "0.6388703", "0.6371155", "0.6367618", "0.6349212", "0.6329832", "0.63291526", "0.63241863", "0.63241863", "0.63241863", "0.6318268", "0.63059705", "0.63046455", "0.62954295", "0.62954295", "0.6293459", "0.6288169", "0.6265043", "0.62648195", "0.62648195", "0.6261735", "0.6258402", "0.62513125", "0.6220088", "0.6199508", "0.6199356", "0.6195617", "0.6191568", "0.6188", "0.6184392", "0.6159498", "0.61574376", "0.61538523", "0.6153083", "0.6152944", "0.6141397", "0.61164516", "0.611423", "0.61102283", "0.6106695", "0.61042", "0.6103355", "0.60980535", "0.60957074", "0.60905766", "0.6070028", "0.60667163", "0.606618", "0.60590583", "0.60531265", "0.60506064", "0.6049249", "0.60472316", "0.6041493", "0.6040875", "0.6025807", "0.6023494", "0.6020277", "0.60095644", "0.5987714", "0.5977874", "0.5964912", "0.594233", "0.59385234" ]
0.7364674
6
Description of the method getStatusColumnLabels.
public HashSet<StatusLabel> getStatusColumnLabels(int column_id) { // Start of user code for method getStatusColumnLabels HashSet<StatusLabel> getStatusColumnLabels = new HashSet<StatusLabel>(); return getStatusColumnLabels; // End of user code }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public List<String> getColumnLabels() {\n return columns;\n }", "public Vector<String> getColumnLabels() \n\t{\n\t\ttry\n\t\t{\n\t\t\tVector<Vector<String>> rows = TableHelper.getColumnLabelsForTable(\n\t\t\t\t\tthis.getDBTableName()\n\t\t\t\t);\n\t\t\t\n\t\t\tif( rows.size() == 0 )\n\t\t\t{\n\t\t\t\tApplicationLogger.logWarning(\n\t\t\t\t\t\t\"No Column Labels found for \"\n\t\t\t\t\t\t\t+ this.getDBTableName() \n\t\t\t\t\t\t\t+\" !\"\n\t\t\t\t\t);\n\t\t\t\treturn this.dbColumnNames;\n\t\t\t}\n\t\t\t\n\t\t\tVector<String> labels = new Vector<String>(this.dbColumnNames.size());\n\t\t\tlabels.add(\"ID\");\n\t\t\tfor( int i=1; i< this.dbColumnNames.size(); i++ )\n\t\t\t\tlabels.add(\"\");\n\t\t\t\n\t\t\tfor( int i=0; i<rows.size(); i++ )\n\t\t\t{\n\t\t\t\tVector<String> row = rows.elementAt(i);\n\t\t\t\t\n\t\t\t\tif( this.dbColumnNames.indexOf(row.elementAt(0)) > -1 )\n\t\t\t\t{\n\t\t\t\t\tlabels.setElementAt(\n\t\t\t\t\t\t\trow.elementAt(1), \n\t\t\t\t\t\t\tthis.dbColumnNames.indexOf(row.elementAt(0))\n\t\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tApplicationLogger.logWarning(\n\t\t\t\t\t\t\t\"Column Label for \"\n\t\t\t\t\t\t\t\t+ this.getDBTableName()\n\t\t\t\t\t\t\t\t+ \" : \"\n\t\t\t\t\t\t\t\t+ row.elementAt(0)\n\t\t\t\t\t\t\t\t+\" not found ! Using internal name now.\"\n\t\t\t\t\t\t);\n\t\t\t\t\treturn this.dbColumnNames;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn labels;\n\t\t\t\n\t\t} catch( SQLException e) {\n\t\t\tApplicationLogger.logWarning(\n\t\t\t\t\t\"No Column Labels found for \"\n\t\t\t\t\t\t+ this.getDBTableName() \n\t\t\t\t\t\t+\" !\"\n\t\t\t\t);\n\t\t}\n\t\t\n\t\treturn this.dbColumnNames;\n\t}", "@Override\n public String getLabel() {\n return columnInfo.getLabel();\n }", "public String getLabelColumn()\n {\n return myLabelColumn;\n }", "@Override\n public int getColumnCount() { return columnnames.length; }", "@Override\n public List<String> getUserColumnLabels() {\n // per-user and global have the same fields, they just differ in aggregation.\n return columns;\n }", "@Override\n\tpublic String getColumnLabel(int arg0) throws SQLException {\n\t\treturn columns[arg0-1];\n\t}", "public int\ngetLabels() {\n\treturn labels;\n}", "private ArrayList<String> getXLabels(ArrayList<Column> columns){\n\n ArrayList<String> XLabels = new ArrayList<>();\n\n for(Column column:columns){\n XLabels.add(column.getColName());\n }\n\n return XLabels;\n }", "public String[] getStatusVariableNames();", "@Override\r\n public int getColumnCount() {\n return this.columnNames.size();\r\n }", "public Vector getFieldLabels() {\n\treturn _vcFieldLabels;\n }", "@Override\n public int getColumnCount() {\n return columnNames.length;\n }", "@Override\n public int getColumnCount() {\n return columnNames.length;\n }", "public int getColumnCount(){\n return columnTitles.length;\n }", "@Override\n\tpublic int getColumnCount() {\n\t\treturn columnNames.size();\n\t}", "public String[] getColumnNames();", "@Override public int getColumnCount()\r\n {\r\n return COLUMN_NAMES.length;\r\n }", "public String getLabels() {\n return queryMap.get(Types.FILTER_CRITERIA_LABELS);\n }", "public StrColumn getLabel() {\n return (StrColumn) (isText ? textFields.computeIfAbsent(\"label\", StrColumn::new) :\n getBinaryColumn(\"label\"));\n }", "@Override\n public int getColumnCount() {\n return columnNames.length;\n }", "public StrColumn getStatusCodeCs() {\n return delegate.getColumn(\"status_code_cs\", DelegatingStrColumn::new);\n }", "@Override\n\tpublic int getColumnCount() {\n\t\treturn columnNames.length;\n\t}", "@Override\n\tpublic int getColumnCount() {\n\t\treturn columnNames.length;\n\t}", "@Override\n\tpublic int getColumnCount() {\n\t\treturn columnNames.length;\n\t}", "@Override\n\tpublic int getColumnCount() {\n\t\treturn columnNames.length;\n\t}", "public abstract String[] getLabels();", "public ArrayList<String> getColumnNames();", "@Override\r\n\tpublic int getColumnCount() {\n\t\treturn columnNames.length;\r\n\t}", "@Override\r\n\tpublic int getColumnCount() {\n\t\treturn columnNames.length;\r\n\t}", "@Override\r\n\tpublic int getColumnCount() {\n\t\treturn columnNames.length;\r\n\t}", "public StrColumn getStatusCode() {\n return delegate.getColumn(\"status_code\", DelegatingStrColumn::new);\n }", "public List<Label> getHeaderLabels() {\r\n return headerLabels;\r\n }", "@Override\r\n public int getColumnCount() {\n return chineseColumNames.length;\r\n }", "public String getColumnLabel(int pos) {\n String colLabel = columns[pos].getLabel();\n\n if (colLabel == null) {\n return \"column_\" + pos;\n } else {\n return colLabel;\n }\n }", "public String getStatus() {\r\n return \"[\" + getStatusIcon() + \"]\";\r\n }", "public int getColumnCount() {\n\t return columnNames.length;\n }", "ArrayList<String> getLabels();", "@Override\n\tpublic int getColumnCount() {\n\t\treturn this.columnName.size();\n\t}", "public void customiseStatusCells() {\n TableColumn column = table.getVisibleLeafColumn(5);\n column.setCellFactory(new Callback<TableColumn, TableCell>() {\n public TableCell call(TableColumn p) {\n //cell implementation\n return new styleCell();\n }\n });\n }", "@Override\n public int getColumnCount() {\n return columname.length;\n \n }", "public List<LabelModel> getSystemLabels();", "@Override\n public int getColumnCount() {\n return colName.length;\n }", "public int getColumnCount() {\n\t\treturn this.headerTitles.length;\n\t\t\n\t}", "public int getColumnCount() {\r\n return columnNames.length;\r\n }", "@Override\n public int getColumnCount()\n {\n return this.headers.length;\n }", "protected String getCurrentStatusColumn() {\n\t\treturn \"CurrentPhase\";\n\t}", "public int getColumnCount() {\n return columnNames.length;\n }", "public List getLabels () {\n return labels;\n }", "public int getColumnCount() {\n return columnNames.size();\n }", "@Override\n\tpublic HashMap<Integer, String> paramLabels() {\n\t\tHashMap<Integer, String> paramlabels = new HashMap<>();\n\t\tparamlabels.put(ALIVE_INDEX, \"Alive\");\n\t\treturn paramlabels;\n\t}", "public int getColumnCount() {\n return columnNames.length;\n }", "public int getColumnCount() {\n return columnNames.length;\n }", "public int getColumnCount()\n\t{\n\t\treturn columnNames.length;\n\t}", "public List<String> getLabels() {\n return this.labels;\n }", "public String[] getColumnNames()\n {\n return columnNames;\n }", "public List<String> getLabels() {\n return labels;\n }", "@Override\r\n\t\tpublic Class<?> getColumnClass(int column)\r\n\t\t{\r\n\t\t\tif (getColumnName(column).equals(\"Status\") || getColumnName(column).equals(\"Country\") ) {\r\n\t\t\t\treturn new ImageIcon().getClass();\r\n\t\t\t}\r\n\t\t\treturn new Object().getClass();\r\n\t\t}", "@Override\n public String toString() {\n return \"[\" + getStatusIcon() + \"] \" + getDescription();\n }", "@Override\r\n\tpublic int getColumnCount() {\n\t\treturn columnName.length;\r\n\t}", "public Tuple<String> getColumnNames() {\n return resultTable.getColumnNames();\r\n }", "@Override\r\n\tpublic int getColumnCount() {\n\t\treturn cols.length;\r\n\t}", "public int getColumnCount() {\n\t\treturn(colNames.size());\n\t}", "public JLabel getStatusbarLabel()\r\n {\r\n return lbStatusbar;\r\n }", "public String getColumnNameTwo(){\n return columnNameTwoLbl.getText();\n }", "@Override\n\tpublic int getColumnCount() {\n\t\treturn name.length;\n\t}", "@Override\n\tpublic int getColumnCount() {\n\t\treturn columns.length;\n\t}", "public Map<String,List<Label>> getLabels() {\n return this.labels;\n }", "@Basic\n Map<String, String> getLabelsMap();", "@Override\n\tpublic int getColumnCount() {\n\t\treturn colCount;\n\t}", "@Override\n\tpublic int getColumnCount() {\n\t\treturn colCount;\n\t}", "int getLabelsCount();", "int getLabelsCount();", "int getLabelsCount();", "int getLabelsCount();", "public String getColumnNameOne(){\n return columnNameOneLbl.getText();\n }", "public int getStatusOrdinal() { return status.ordinal(); }", "public Object[] getColumnNames(){\r\n if (ufeRunner == null || renders == null || htmlObjLang == null) {\r\n return null;\r\n }\r\n String[] columnNames = {\"Name\", \"Value\"};\r\n return columnNames;\r\n }", "@Override\n public String toString() {\n return \"[\" + getStatusIcon() + \"] \" + description;\n }", "public List<Label> getLabels()\n\t{\n\t\treturn labels;\n\t}", "public List<LabelModel> getCustomLabels();", "public int getColumnCount() {\r\n return this.title.length;\r\n }", "@Override\n\tpublic int getColumnCount() {\n\t\treturn head.length;\n\t}", "public JLabel[] todasLabels(){\n JLabel[] todasLabels = new JLabel[]{lbData, lbNomeCliente, lbStatus};\n \n return todasLabels;\n }", "protected ArrayList<String> getColumnNames() {\n return getVariableNames();\n }", "@Override\n\tpublic String getColumnLabel(int col) throws SQLException {\n\n\t\tif (col <= this.width && col >= 1) {\n\n\t\t\tcol--;\n\t\t\tString str = table[0][col];\n\t\t\tStringTokenizer token = new StringTokenizer(str, \",\");\n\t\t\tString label = token.nextToken();\n\n\t\t\treturn label;\n\n\t\t} else\n\t\t\tthrow new SQLException(\"column requested out of table bounds \");\n\n\t}", "public String getColumnNameFour(){\n return columnNameFourLbl.getText();\n }", "public int getColumnCount() {\n return columnNameList.length;\n }", "public StrColumn getStatusCoordinatesInNDB() {\n return delegate.getColumn(\"status_coordinates_in_NDB\", DelegatingStrColumn::new);\n }", "public int getColumnCount () {\n return COL_COUNT;\n }", "@Override\r\n public int getColumnCount() {\n return colunas.length;\r\n }", "public void setLabelColumn(String labelColumn)\n {\n myLabelColumn = labelColumn;\n }", "java.util.Map<java.lang.String, java.lang.String> getLabelsMap();", "java.util.Map<java.lang.String, java.lang.String> getLabelsMap();", "java.util.Map<java.lang.String, java.lang.String> getLabelsMap();", "java.util.Map<java.lang.String, java.lang.String> getLabelsMap();", "DatasetLabel getLabel();", "@Override\n public int getColumnCount()\n {\n if (!UserMain.self.is_user() && !UserMain.self.is_admin())\n return col_names.length - 2;\n\n // EDIT IST 2.LAST ROW!!!!\n if (!UserMain.self.is_admin())\n return col_names.length - 1;\n\n\n return col_names.length;\n }", "@Override\n\tpublic int getColumnCount()\n\t{\n\t\treturn nomColonnes.length;\n\t}", "public int getColumnCount() {\r\n return columns.length;\r\n }" ]
[ "0.72013986", "0.67502415", "0.6656753", "0.6289951", "0.5983263", "0.5971614", "0.58792627", "0.58194125", "0.5803304", "0.57622254", "0.57582825", "0.573018", "0.5728437", "0.5728437", "0.5728153", "0.5723679", "0.5718594", "0.5706687", "0.56937075", "0.5677904", "0.56582445", "0.5652241", "0.5644845", "0.5644845", "0.5644845", "0.5644845", "0.5639851", "0.56356627", "0.56026", "0.56026", "0.56026", "0.5594703", "0.5564072", "0.5562979", "0.5559926", "0.55542237", "0.55433077", "0.5537068", "0.5530533", "0.5528611", "0.5519201", "0.5509719", "0.54958683", "0.5475639", "0.5444087", "0.5440486", "0.5435018", "0.54299104", "0.541408", "0.54118663", "0.54047024", "0.53973645", "0.53973645", "0.53907335", "0.53896695", "0.53886807", "0.5375466", "0.535113", "0.5343022", "0.53415436", "0.5333045", "0.5332967", "0.5327005", "0.5324103", "0.5322343", "0.5317268", "0.53146404", "0.5310129", "0.5306371", "0.5297737", "0.5297737", "0.5282357", "0.5282357", "0.5282357", "0.5282357", "0.52766454", "0.5263627", "0.5257586", "0.5252963", "0.52504694", "0.5248762", "0.52478224", "0.52383614", "0.5235211", "0.52350086", "0.5234952", "0.5219253", "0.52162266", "0.52121973", "0.5208416", "0.51995844", "0.51910067", "0.5188403", "0.5188403", "0.5188403", "0.5188403", "0.51839656", "0.518052", "0.5178503", "0.51748866" ]
0.7128481
1
Start of user code (user defined methods for Board) End of user code Returns parentWorkspace.
public Workspace getParentWorkspace() { return this.parentWorkspace; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n \tpublic File getWorkspace() {\n \t\treturn null;\r\n \t}", "@Override\r\n\tpublic Workspace getWorkspace() {\n\t\treturn null;\r\n\t}", "public Workspace getWorkspace() {\n return workspace;\n }", "public Workspace getWorkspace() {\n return this.workspace;\n }", "public RTWLocation parent();", "public void setParentWorkspace(Workspace newParentWorkspace) {\n\t\tthis.parentWorkspace = newParentWorkspace;\n\t}", "public String getWorkspace() {\n return workspace;\n }", "@VTID(9)\n excel._Worksheet getParent();", "@Override\r\n\tpublic Refactoring getParent() {\r\n\t\treturn this.parent;\r\n\t}", "public GoPlayingBoard getCurrentBoard() {\n \t\treturn currentBoard.clone();\n \t}", "MainBoard createMainBoard();", "public Board getBoard(){\n return undoBoards.peek();\n }", "public NotebookWorkspaceInner() {\n }", "public void setParent (com.redsaga.hibnatesample.step2.Board _parent) {\n\t\tthis._parent = _parent;\n\t}", "@Override\r\n \tpublic File getWorkspace(String subspace) {\n \t\treturn null;\r\n \t}", "protected TacticalBattleProcessor getParent() {\n return parent;\n }", "public PuzzleState getParent();", "public WorkspaceController() {\n this.workspace = new Workspace();\n pom = new ProcedureOutputManager(workspace);\t//*****\n }", "public Board getBoard ();", "protected Board getBoard() { // nao vou deixar public, vou deixar privado\n\t\treturn board;\n\t}", "public interface WorkspaceContext {\n\n\n /**\n * Retorna a representação do workspace.\n *\n * @return\n */\n WorkspaceRepresentation getWorkspace();\n\n /**\n * Define o projeto de trabalho.\n *\n * @param projectRepresentation\n */\n void setWorkingProject(ProjectRepresentation projectRepresentation);\n\n\n /**\n * Retorna o projeto de trabalho.\n *\n * @return\n */\n ProjectRepresentation getWorkingProject();\n}", "@VTID(7)\r\n void getParent();", "private String makeWorkspace( File workspace ) throws ScmException {\n \t\ttry {\r\n \t\t\tintegrationstream = UCMEntity.getStream( intStream, false );\r\n \t\t\tbl = Baseline.getBaseline( baselinefqname );\r\n \t\t} catch (UCMException e) {\r\n \t\t\tthrow new ScmException( \"Could not get stream. Job might run on machine with different region. \" + e.getMessage() );\r\n \t\t}\r\n \t\tif( workspace != null ) {\r\n \t\t\tlogger.debug( id + \"workspace: \" + workspace.getAbsolutePath() );\r\n \t\t} else {\r\n \t\t\tlogger.debug( id + \"workspace must be null???\" );\r\n \t\t}\r\n \r\n \t\tString newJobName = jobname.replaceAll(\"\\\\s\", \"_\");\r\n \t\tString viewtag = \"CCUCM_\" + newJobName + \"_\" + System.getenv(\"COMPUTERNAME\");\r\n \r\n \t\tFile viewroot = new File( workspace, \"view\" );\r\n \t\t\r\n \t\tStream devstream = null;\r\n \r\n \t\tdevstream = getDeveloperStream( \"stream:\" + viewtag, Config.getPvob( integrationstream ), hudsonOut );\r\n \r\n \t\tsv = Util.makeView( devstream, workspace, listener, loadModule, viewroot, viewtag, false );\r\n \t\t\r\n \r\n \t\t// Now we have to rebase - if a rebase is in progress, the\r\n \t\t// old one must be stopped and the new started instead\r\n \t\tif( devstream.isRebaseInProgress() ) {\r\n \t\t\thudsonOut.print( \"[\" + Config.nameShort + \"] Cancelling previous rebase.\" );\r\n \t\t\tdevstream.cancelRebase();\r\n \t\t\thudsonOut.println( \" DONE\" );\r\n \t\t}\r\n \t\t// The last boolean, complete, must always be true from CCUCM\r\n \t\t// as we are always working on a read-only stream according\r\n \t\t// to LAK\r\n \t\thudsonOut.print( \"[\" + Config.nameShort + \"] Rebasing development stream (\" + devstream.getShortname() + \") against parent stream (\" + integrationstream.getShortname() + \")\" );\r\n \t\tdevstream.rebase( sv, bl, true );\r\n \t\thudsonOut.println( \" DONE\" );\r\n \t\t\r\n \t\ttry {\r\n hudsonOut.println(\"[\" + Config.nameShort + \"] Updating view using \" + loadModule.toLowerCase() + \" modules\");\r\n sv.Update(true, true, true, false, COMP.valueOf(loadModule.toUpperCase()), null);\r\n } catch (UCMException e) {\r\n if (e.stdout != null) {\r\n hudsonOut.println(e.stdout);\r\n }\r\n throw new ScmException(\"Could not update snapshot view. \" + e.getMessage());\r\n }\r\n \t\t\r\n \t\treturn viewtag;\r\n \t}", "public static WildBoard getBoard()\n {\n System.out.println(\"*** WildApp.getBoard() called\");\n \n return myBoard;\n }", "Window getParent();", "private int parent ( int pos )\n\t{\n\t\treturn -1; // replace this with working code\n\t}", "public static void getWorkspace2 () {\n //Create a connection info object\n TwConnectionInfo connectionInfo = new TwConnectionInfo (\"localhost\", \"1112\"); \t\n //Create retriever\n retriever = new ItemRetriever(connectionInfo, \"KB-WORKSPACE\", \"WKSP-2\");\n try {\n //Retrieve item and cast result\n kbWorkspace = (KbWorkspace)retriever.retrieveItem();\n System.out.println(kbWorkspace);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "private IWorkspaceRoot getWorkspaceRoot() {\n\t\treturn ResourcesPlugin.getWorkspace().getRoot();\n\t}", "public IBuildObject getParent();", "public Board getCurrentBoard() {\n return boardIterator.board;\n }", "abstract public Command getParent();", "private Board getBoard() {\n return gameStatus.getBoard();\n }", "public int getBoardLocation() {return boardLocation;}", "public OwObject getParent()\r\n {\r\n return m_Parent;\r\n }", "public VisualLexiconNode getParent() {\n \t\treturn parent;\n \t}", "@Override\n\tpublic ASTNode getParent() {\n\t\treturn this.parent;\n\t}", "public String computerMove() {\n\t\t// Look to win in a row\n\t\tfor (int r = 0; r < 3; r++) {\n\t\t\tif (rowSum[r] == -2) {\n\t\t\t\t// Find the empty space\n\t\t\t\tfor (int c = 0; c < 3; c++) {\n\t\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\t\treturn done(r, c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Look to win in a col\n\t\tfor (int c = 0; c < 3; c++) {\n\t\t\tif (colSum[c] == -2) {\n\t\t\t\t// Find the empty space\n\t\t\t\tfor (int r = 0; r < 3; r++) {\n\t\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\t\treturn done(r, c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Look to win a diag\n\t\tfor (int d = 0; d < 2; d++) {\n\t\t\tif (diagSum[d] == -2) {\n\t\t\t\t// Find the empty space\n\t\t\t\tfor (int r = 0; r < 3; r++) {\n\t\t\t\t\tint c = d == 0 ? r : 2 - r;\n\t\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\t\treturn done(r, c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Look to block a row\n\t\tfor (int r = 0; r < 3; r++) {\n\t\t\tif (rowSum[r] == 2) {\n\t\t\t\t// Find the empty space\n\t\t\t\tfor (int c = 0; c < 3; c++) {\n\t\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\t\treturn done(r, c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Look to block a col\n\t\tfor (int c = 0; c < 3; c++) {\n\t\t\tif (colSum[c] == 2) {\n\t\t\t\t// Find the empty space\n\t\t\t\tfor (int r = 0; r < 3; r++) {\n\t\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\t\treturn done(r, c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Look to block a diag\n\t\tfor (int d = 0; d < 2; d++) {\n\t\t\tif (diagSum[d] == 2) {\n\t\t\t\t// Find the empty space\n\t\t\t\tfor (int r = 0; r < 3; r++) {\n\t\t\t\t\tint c = d == 0 ? r : 2 - r;\n\t\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\t\treturn done(r, c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Find the non-full row and col w/ least val\n\t\tint bestR = -1;\n\t\tint bestC = -1;\n\t\tint minSum = 10;\n\t\tfor (int r = 0; r < 3; r++) {\n\t\t\tfor (int c = 0; c < 3; c++) {\n\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\tint sum = rowSum[r] + colSum[c];\n\t\t\t\t\tif (sum < minSum) {\n\t\t\t\t\t\tminSum = sum;\n\t\t\t\t\t\tbestR = r;\n\t\t\t\t\t\tbestC = c;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn done(bestR, bestC);\n\t}", "private void getWorkspace () {\n try {\n\tfinal Sequence wkspNames = connection.getNamedWorkspaces ();\n\tint numWksps = wkspNames.size ();\n\tString[] names = new String [numWksps];\n\tfor (int i=0; i<numWksps; i++)\n\t names[i] = ((Symbol)wkspNames.elementAt(i)).getPrintValue();\n\tStandardDialogClient getHandler = new StandardDialogClient () {\n\t @Override\n\t public void dialogDismissed (StandardDialog d, int code) {\n\t if (d.wasCancelled ()) return;\n\t SelectionDialog sd = (SelectionDialog)d;\n\t int chosenIndex = sd.getResult ();\n\t Symbol wkspName_ = (Symbol) wkspNames.elementAt (chosenIndex);\n\t new WorkspaceDownloadThread (multiWkspView, connection, wkspName_).start ();\n\t }\n\t};\n\tnew SelectionDialog (getCurrentFrame(), \"Get Named Workspace\",\n\t\t\t false, \n\t\t\t \"Choose Workspace to Display\",\n\t\t\t names, false, -1, true, getHandler).setVisible (true);\n } catch (Exception e) {\n\tnew WarningDialog (null, \"Error During Get Workspace\", true, e.toString (), null).setVisible (true);\n }\n }", "@VTID(9)\n @ReturnValue(type=NativeType.Dispatch)\n com4j.Com4jObject getParent();", "@VTID(9)\n @ReturnValue(type=NativeType.Dispatch)\n com4j.Com4jObject getParent();", "@VTID(9)\n @ReturnValue(type=NativeType.Dispatch)\n com4j.Com4jObject getParent();", "@VTID(9)\n @ReturnValue(type=NativeType.Dispatch)\n com4j.Com4jObject getParent();", "public abstract void createBoard();", "public IPSComponent peekParent();", "public String getCodeParent() {\n\t\treturn codeParent;\n\t}", "public CQLWorkSpaceView() {\n\t\tdefineAceEditor.startEditor();\n\t\tparameterAceEditor.startEditor();\n\t\tcqlAceEditor.startEditor();\n\t\tfunctionBodyAceEditor.startEditor();\n\t\tresetAll();\n\t}", "@VTID(9)\r\n @ReturnValue(type=NativeType.Dispatch)\r\n com4j.Com4jObject getParent();", "public Path getPathToWorkspaceFolder() {\n return pathToWorkspaceFolder;\n }", "int childrenParent () {\r\n\treturn OS.PtWidgetChildBack (handle);\r\n}", "public Grid getExit(){\n\t\treturn getpos((byte)3);\n\t}", "public BoardSquareButton getSelf()\n {\n return this;\n }", "public Board getBoard()\r\n {\r\n return gameBoard;\r\n }", "private void getBoard() {\n gameBoard = BoardFactory.makeBoard();\n }", "public void setWorkspace( Integer workspace ) {\n this.workspace = workspace;\n }", "public void setWorkspace(Workspace workspace) {\n this.workspace = workspace;\n }", "public abstract OperatorImpl getParent();", "public abstract void gameLogic(Cell currentCell);", "public void updateWorkspace()\n {\n workspace.update();\n }", "@Override\n\tpublic UpdateContainer undoIt(Workspace workspace) {\n\t\treturn null;\n\t}", "public PartialSolution getParent() {\n return _parent;\n }", "public void projectClosed() { }", "public void projectClosed() { }", "public IRubyObject getTopSelf() {\n return topSelf;\n }", "public ContentScanner getParentLevel(\n )\n {return parentLevel;}", "public static void getWorkspace1 () {\n //Create retriever\n retriever = new ItemRetriever();\n //Set class and item information\n retriever.setItemClassName(\"KB-WORKSPACE\");\n retriever.setItemName(\"WKSP-1\"); \n retriever.setHost(\"localhost\");\n retriever.setPort(\"1112\");\n try {\n kbWorkspace = (KbWorkspace)retriever.retrieveItem();\n System.out.println(kbWorkspace);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "@Override\n\tpublic void comeBackToWork() {\n\t\t\n\t}", "final MenuContainer getParent_NoClientCode() {\n return parent;\n }", "public PathCode getCurPathCode() { return /*appliedTo.curPathCode*/currentpathcode;}", "public RMParentShape getParent() { return _parent; }", "protected LambdaTerm getParent() { return parent; }", "public abstract void buildMoveData(ChessBoard board);", "public JFrame sprout()\n {\n return super.sprout();\n }", "public Stmt\ngetHirBody();", "public GUIBoard getBoard() {\n return board;\n }", "public void popParent();", "public abstract JCodeModel owner();", "public String getMainWindow() {\r\n\t\treturn null;\r\n\t}", "public ToolBar getParent () {\r\n\tcheckWidget();\r\n\treturn parent;\r\n}", "public WorkspaceCache getWorkspace();", "public long getParentCode() {\n return parentCode;\n }", "public int Parent() { return this.Parent; }", "public String getWorkspaceName() {\n return workspaceName;\n }", "public SeleniumQueryObject parent() {\n\t\treturn ParentFunction.parent(this);\n\t}", "protected void removeWorkspace( String workspaceName ) {\n }", "public GitCommit getParent() { return _par!=null? _par : (_par=getParentImpl()); }", "@Override\n\tpublic void win() {\n\t\t\n\t}", "public GridPosition run(){\n\t\t\n\t\tinstructions.forEach(i -> {\n\t\t\tGridPosition newPosition = i.nextPosition(position);\n\t\t\tlogger.fine(\"new position is \"+newPosition.toString());\n\t\t\tif(validator.validate(position, newPosition)){\n\t\t\t\tvalidator.addUsedCoordinate(newPosition);\n\t\t\t\tGridPosition oldPosition = position;\n\t\t\t\tposition = newPosition;\n\t\t\t\tvalidator.removeUnusedCoordinate(oldPosition);\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\tlogger.warning(\"The new position \"+newPosition.toString()+\" is not valid, the lawn mower remain on the current position\");\n\t\t\t\t//if position is not valid, mower keep at the current position and execute next instruction\n\t\t\t}\n\t\t});\n\t\t\n\t\treturn position;\n\t}", "@DISPID(150)\n @PropGet\n com4j.Com4jObject getParent();", "@DISPID(150)\n @PropGet\n com4j.Com4jObject getParent();", "SemanticRegion<T> parent();", "public Workspace() {\n\t\tdesktops.add(new WSDesktop());\n\t}", "private void easyMove(Board board) {\n\t\t\r\n\t}", "public String getParentNode()\r\n\t{\r\n\t\tif (roadBelongingType.equals(\"inbound\"))\r\n\t\t{\r\n\t\t\treturn endNode;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn startNode;\r\n\t\t}\r\n\t}", "public static Board getBoard(){\n\t\treturn board;\n\t}", "@DISPID(1002) //= 0x3ea. The runtime will prefer the VTID if present\r\n @VTID(9)\r\n @ReturnValue(type=NativeType.Dispatch)\r\n com4j.Com4jObject parent();", "@DISPID(1002) //= 0x3ea. The runtime will prefer the VTID if present\r\n @VTID(9)\r\n @ReturnValue(type=NativeType.Dispatch)\r\n com4j.Com4jObject parent();", "public Board getBoard() {\n return gameBoard;\n }", "public static java.awt.Frame getParent() {\n return parent;\n}", "@Override\n public UIPanel getParentPanel() {\n return parentPanel;\n }", "public Board getBoard() {\r\n return board;\r\n }" ]
[ "0.60993886", "0.6090919", "0.5835109", "0.5811085", "0.56267977", "0.5550823", "0.5472616", "0.5464417", "0.54614556", "0.53985137", "0.5384379", "0.5369833", "0.5363021", "0.5329433", "0.53165954", "0.52891505", "0.52817726", "0.5246516", "0.52447504", "0.52321136", "0.52236", "0.5220189", "0.5211004", "0.5200335", "0.5196499", "0.5189572", "0.5160449", "0.5158765", "0.5156566", "0.5156075", "0.5152244", "0.51360375", "0.5108955", "0.50946975", "0.509348", "0.5087686", "0.50770223", "0.5071212", "0.50704896", "0.50704896", "0.50704896", "0.50704896", "0.5057194", "0.50540984", "0.50528586", "0.50497204", "0.50373554", "0.5033933", "0.50335157", "0.5032266", "0.50101304", "0.50087214", "0.49993318", "0.49984622", "0.49947986", "0.49924538", "0.4991179", "0.4988841", "0.49814433", "0.4979936", "0.4974832", "0.4974832", "0.49729338", "0.49706557", "0.49679336", "0.49500668", "0.4949566", "0.49336198", "0.49248776", "0.49228927", "0.4917991", "0.49166623", "0.49161094", "0.4914613", "0.49128067", "0.4909244", "0.4900588", "0.48997512", "0.4896674", "0.48943532", "0.48931375", "0.4884051", "0.48831207", "0.48795292", "0.4878683", "0.4872564", "0.48714003", "0.48694026", "0.48694026", "0.48624513", "0.48601854", "0.48566577", "0.48503336", "0.48418888", "0.48395535", "0.48395535", "0.4826428", "0.48189062", "0.4811404", "0.48094493" ]
0.659279
0
Sets a value to attribute parentWorkspace.
public void setParentWorkspace(Workspace newParentWorkspace) { this.parentWorkspace = newParentWorkspace; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void setParent(IGLProperty parent);", "public void setParent(String value) {\r\n setAttributeInternal(PARENT, value);\r\n }", "public void setParentLayer(EObject newValue);", "public void setParent (com.redsaga.hibnatesample.step2.Board _parent) {\n\t\tthis._parent = _parent;\n\t}", "public void setParent(String aParent) {\n _theParent = aParent;\n }", "public void setParent(ASTNeoNode parent) {\r\n \t\tassertTrue(parent != null);\r\n \t\tassertTrue(this.parent == null); // Can only set parent once\r\n \t\tthis.parent = parent;\r\n \t}", "public void setORM_Parent(orm.Nomenclature value) {\r\n\t\tthis.parent = value;\r\n\t}", "public void setParent(Concept _parent) { parent = _parent; }", "public void setParentOne(int parent)\n\t{\n\t\tparentSetOne = parent;\n\t}", "@Override\n\tpublic void setParent(WhereNode parent) {\n\t\tthis.parent = parent;\n\t}", "public void setParent(ASPMSyntaxElement parent) {\n\t\tassert this.parent == null;\n\t\tthis.parent = parent;\n\t}", "public void setParent(PafDimMember parent) {\r\n\t\tthis.parent = parent;\r\n\t}", "public void setParent(Node parent){\n this.parent = parent;\n }", "public void setParent(String parent) {\r\n this.parent = parent;\r\n }", "public void setParent(String parent) {\n _parent = parent;\n }", "public void setParent(State aParent);", "public void setParent(Instance parent) {\r\n \t\tthis.parent = parent;\r\n \t}", "protected void setParent(ILanguageElement parent) {\r\n this.parent = parent;\r\n }", "void setParent(WidgetParent ip) {\n this.m_parent = ip;\n }", "public void setParent(Node parent) {\n this.parent = parent;\n }", "protected void setParent(CodeItem codeItem) {\n this.parent = codeItem;\n }", "public void setParent(MenuTree parent){\n this.parentMenuTree = parent;\n }", "public void setParent(String parent) {\n this.parent = parent;\n }", "public void setParent(int id);", "<E extends CtElement> E setParent(E parent);", "public void setParent(Kit parentKit) {\n this.parent = parentKit;\n }", "public void setParent(LeafTreeNode parent) {\n this.parent = parent;\n }", "private void setParent(Node<T> parent) {\n this.parent = parent;\n }", "public void setParent (CompoundExpression parent){\n _parent = parent;\n }", "public void setParentCode(long value) {\n this.parentCode = value;\n }", "public void setParent (CompoundExpression parent)\r\n\t\t{\r\n\t\t\t_parent = parent;\r\n\t\t}", "public void setParentModule(EObject newValue);", "public void setParent(AsNode parent) {\n\t\tthis.state.setG(parent.getState().getG() + parent.childCost.get(this));\n\t\tthis.parent = parent;\n\t}", "void setParent(TestResultTable.TreeNode p) {\n parent = p;\n }", "void setParent(TreeNode<T> parent);", "public boolean setParent (\n\t\tfinal BinomialTree<KEY, ITEM> parent)\n\t{\n\t\t_parent = parent;\n\t\treturn true;\n\t}", "public void setParent(final ParseTreeNode parent) {\r\n _parent = parent;\r\n }", "void setParent(Resource parent)\n {\n this.parent = new ResourceRef(parent, coral);\n if(parent != null)\n {\n \tparentId = parent.getId();\n }\n else\n {\n \tparentId = -1;\n }\n }", "void setParentInstId(String parentInstId);", "public void setParent(TreeNode parent)\r\n\t{\r\n\t\tm_parent = parent;\r\n\t}", "public void setParent(Node<T> parent) {\n this.parent = parent;\n }", "public void setParentKey(long value) {\n\t\tthis.parentKey = value;\n\t}", "public Token setParent_id(int parent_id) {\n this.parent_id = parent_id;\n setParent_idIsSet(true);\n return this;\n }", "public void setParent(FileNode parent) {\r\n this.parent = parent;\r\n }", "public int setParent(PathNode2d parent) {\n depth = parent.depth + 1;\n this.parent = parent;\n\n return depth;\n }", "public void setParent(DocxContext<?> parent) {\n\n }", "public void setParent(@CheckForNull final OtuSet parent) {\n\t\tthis.parent = parent;\n\t}", "public void setParent(AbstractConfigNode parent) {\n this.parent = parent;\n }", "public void set_parent(short value) {\n setUIntElement(offsetBits_parent(), 8, value);\n }", "public Workspace getParentWorkspace() {\n\t\treturn this.parentWorkspace;\n\t}", "final void setParent(ShapeParent newParent)\n {\n this.parent = newParent;\n }", "public void setParent(IAVLNode node);", "public void setParent(IAVLNode node);", "public void setParent (TreeNode parent)\r\n {\r\n if (logger.isFineEnabled()) {\r\n logger.fine(\"setParent parent=\" + parent + \" for \" + this);\r\n }\r\n\r\n this.parent = parent;\r\n }", "public void setParent(Node newParent) {\r\n\t\t\tparent = newParent;\r\n\t\t}", "public void setParent(View parent) {\n throw new Error(\"Can't set parent on root view\");\n }", "public void setParent(ILexComponent parent);", "public void setParentID(int parentID) {\n\t\tthis.parentID = parentID;\n\t}", "public void setParentPanel(UIPanel parent) {\n this.parentPanel = parent;\n updateBounds();\n }", "@Override\n\tpublic void setParent(TreeNode parent) {\n\t\tthis.parent = parent ;\n\t}", "@Override\n\tpublic void setParent(TreeNode parent) {\n\t\tthis.parent = parent ;\n\t}", "public void setParent(Node node) {\n parent = node;\n }", "public final synchronized void setParent(final ICache<K, V, D> parent) {\n ICache<K, V, D> current = parent;\n while (current != null) {\n if (current == this)\n throw new IllegalArgumentException(\"Cycle detected, cannot set parent to \" + parent);\n current = current.getParent();\n }\n this.parent = parent;\n }", "public void setWorkingParent(String path) throws IllegalArgumentException\n {\n ServerSettings.getInstance().setProperty(\n ServerSettings.WORKING_PARENT,\n \"\"+validatePath(path)\n );\n }", "public void setParent(SearchNode<S, A> parent) {\r\n\t\tthis.parent = parent;\r\n\t}", "public void setParent(RMParentShape aShape) { _parent = aShape; }", "public void setParent(Node parent) {\r\n//\t\tdepth = parent.depth + 1;\r\n\t\tthis.parent = parent;\r\n\t\t//return depth;\r\n\t\t\r\n\t}", "public abstract void setParent (XMLReader parent);", "public void setParentTid(Integer parentTid) {\r\n this.parentTid = parentTid;\r\n }", "public void setParent(PaletteContainer newParent) {\n if (parent != newParent) {\n PaletteContainer oldParent = parent;\n parent = newParent;\n listeners.firePropertyChange(PROPERTY_PARENT, oldParent, parent);\n }\n }", "@Override\n\tpublic void setParent(ASTNode node) {\n\t\tthis.parent = node;\n\t\t\n\t}", "@Override\n public void setParent(IStatement _statement) {\n\t this._parent = _statement;\n }", "public void setParentTwo(int parent)\n\t{\n\t\tparentSetTwo = parent;\n\t}", "public void setParent(CarrierShape parent)\n\t{\n\t\tthis.parent = parent;\n\t}", "public void setParent(HtmlMap<T> parent)\n\t{\n\t\tthis.m_parent = parent;\n\t}", "public void setParentNode(BSTNode parent) {\n\t\tthis.parentNode = parent;\n\t}", "public void setParent(PsUpdateIf parent) {\n\t\tsuper.setParent(parent);\n\t\tm_pjRoot = (PjRootFinder)parent;\n\t\tm_pFunction.add(m_pjRoot.m_fx.getInfoPanel());\n\t\tm_pBounds.add(m_pjRoot.m_xMin.getInfoPanel());\n\t\tm_pBounds.add(m_pjRoot.m_xMax.getInfoPanel());\n\t\tm_pBounds.add(m_pjRoot.m_discr.getInfoPanel());\n\t}", "public void setParent(RBNode<T> node, RBNode<T> parent) {\n if(node != null)\r\n node.parent = parent;\r\n }", "public void setParentid(Integer parentid) {\n\t\tthis.parentid = parentid;\n\t}", "public void setParent(final @Nullable Node<@Nullable T> parent) {\n this.parent = parent;\n }", "public OwnerTrace<T> parent(Object parent) {\n\t\tif (parent instanceof OwnerTrace)\n\t\t\tdata.parent = ((OwnerTrace<?>)parent).data;\n\t\telse if (parent == null)\n\t\t\tdata.parent = null;\n\t\telse\n\t\t\tdata.parent = OwnerTrace.of(parent).data;\n\t\treturn this;\n\t}", "abstract public void setParent(Command cmd);", "public abstract void setParent(UIComponent parent);", "public void setParentFolder(com.vmware.converter.ManagedObjectReference parentFolder) {\r\n this.parentFolder = parentFolder;\r\n }", "public void setParent(ProviderStore parent) {\n this.parent = parent;\n }", "protected void setParent(Group parent) {\n internalGroup.setParent(parent.internalGroup);\n }", "public void setParent( PlanNode parent ) {\n removeFromParent();\n if (parent != null) {\n this.parent = parent;\n this.parent.children.add(this);\n }\n }", "public void setParentLabel(String parentLabel){\n\t\tthis.parentLabel = parentLabel;\n\t}", "@Override\n public void setParentNode(ConfigurationNode parent)\n {\n this.parent = parent;\n }", "@Override\n\tpublic void setParent(Tag parentTag) {\n\t\tthis.parentTag = parentTag;\n\n\t}", "public void setParent(Glyph parent) {\n this.parent = parent;\n }", "public static void setParent(java.awt.Frame newParent) {\n parent = newParent;\n}", "void setParent(UIComponent parent);", "public void setParentable(Boolean parentable);", "public void setParentParamCode(String parentParamCode) {\n this.parentParamCode = parentParamCode;\n }", "public void setParentContinent(String parentContinent) {\n ParentContinent = parentContinent;\n }", "public void setIsParent(Boolean isParent) {\n this.isParent = isParent;\n }", "public Builder setParentMonsterIndex(int value) {\n \n parentMonsterIndex_ = value;\n onChanged();\n return this;\n }", "public void setParentController(HomeController parent) {\n\t\tthis.parent = parent;\n\t}", "public void setParent(IAVLNode node) {\n\t\t\tthis.parent = node; // to be replaced by student code\n\t\t}" ]
[ "0.6868202", "0.6843501", "0.67417026", "0.6580567", "0.6561484", "0.65523577", "0.65523505", "0.6551384", "0.6539927", "0.6531213", "0.6520702", "0.6518873", "0.6501619", "0.64826137", "0.64675295", "0.6450455", "0.64478916", "0.6443247", "0.6424951", "0.6394269", "0.6389405", "0.6383577", "0.63821924", "0.6359844", "0.63498867", "0.63342863", "0.6292041", "0.6291269", "0.6235874", "0.6230525", "0.6228859", "0.61988515", "0.6186169", "0.6176731", "0.61732376", "0.61608905", "0.61559314", "0.61486024", "0.6145083", "0.61371046", "0.6120414", "0.6096482", "0.6095994", "0.60940325", "0.60792476", "0.60679543", "0.6066446", "0.6064598", "0.60523957", "0.6046559", "0.6043168", "0.60373145", "0.60373145", "0.6016171", "0.6000675", "0.59784985", "0.5978233", "0.5974552", "0.5955048", "0.5945652", "0.5945652", "0.59395957", "0.59369284", "0.59121084", "0.59053063", "0.5903657", "0.5899599", "0.58881736", "0.5883916", "0.5866978", "0.5840715", "0.58406186", "0.5834951", "0.5831309", "0.5800381", "0.57961667", "0.57920486", "0.57783145", "0.5773517", "0.5764975", "0.5761915", "0.5758997", "0.57413924", "0.57295346", "0.5726768", "0.5715871", "0.57084775", "0.5704029", "0.56992716", "0.569428", "0.5673124", "0.56604123", "0.56578207", "0.5651555", "0.56481755", "0.5645632", "0.56401867", "0.56371206", "0.5636857", "0.5629162" ]
0.7261844
0
Sets a value to attribute name.
public void setName(String newName) { this.name = newName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setAttributeValue(String name, String value) throws Exception {\n if (!_attributes.containsKey(name)) {\n throw new Exception(name + \" is not a valid attribute name for features in the\" + _layer.getDisplayName() + \" layer\");\n }\n _attributes.setProperty(name, value);\n }", "public void setAttribute(String name, Object value);", "public void setAttrib(String name, String value);", "void setAttribute(String name, Object value);", "void setAttribute(String name, Object value);", "@Override\n\t\tpublic void setAttribute(String name, Object value) {\n\t\t\t\n\t\t}", "final public void setAttr(final String name, final Object value) {\r\n\t\tmOptmizedKey++;\r\n\t\tfor(final Attr attr : mAttributes) {\r\n\t\t\tif(attr.Name.equals(name))\r\n\t\t\t\tattr.Object = value;\r\n\t\t}\r\n\t}", "public void set_attribute(Object instance, String attribute_name, Object value) throws XtumlException;", "String attributeToSetter(String name);", "public synchronized void setAttribute(String key, Object value) {\n if (value == null) {\n attributes.remove(key);\n } else {\n attributes.put(key, value);\n }\n }", "public T set(String name, Object value)\n\t\t\tthrows TablesawException\n\t\t{\n\t\ttry\n\t\t\t{\n\t\t\tif (value instanceof String)\n\t\t\t\t{\n\t\t\t\tm_intHelper.setAttribute(m_project, m_antObject, name, (String)value);\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\tMethod m = m_intHelper.getAttributeMethod(name);\n\t\t\t\tm.invoke(m_antObject, value);\n\t\t\t\t}\n\t\t\t}\n\t\tcatch (IllegalArgumentException iae)\n\t\t\t{\n\t\t\t// TODO: add better error\n\t\t\tthrow new TablesawException(iae);\n\t\t\t}\n\t\tcatch (Exception e)\n\t\t\t{\n\t\t\tthrow new TablesawException(\"Error setting attribute '\"+name+\"' on '\"+m_elementName+\"'\", e);\n\t\t\t}\n\t\t\n\t\treturn ((T)this);\n\t\t}", "public void setAttribute(String key, String value) {\n attributes.put(key, value);\n }", "public void setAttribute(Object key, Object value);", "void setAttributes(String attributeName, String attributeValue);", "public void setAttribute(String name,\n\t\t\t String value)\n\tthrows SdpException {\n\tif (name == null)\n\t throw new SdpException(\"The parameters are null\");\n\telse {\n \n\t int i = 0;\n\t for (i = 0; i < this.attributeFields.size(); i++) {\n\t\tAttributeField af = (AttributeField) \n\t\t this.attributeFields.elementAt(i);\n\t\tif (af.getAttribute().getName().equals(name)) {\n\t\t NameValue nv = af.getAttribute();\n\t\t nv.setValue(value);\n\t\t break;\n\t\t}\n \n\t }\n \n\t if (i == this.attributeFields.size()) {\n\t\tAttributeField af = new AttributeField();\n\t\tNameValue nv = new NameValue(name, value);\n\t\taf.setAttribute(nv);\n\t\tthis.attributeFields.addElement(af);\n\t }\n \n\t}\n }", "public void attribute (final String name, final Object value) {\n session.setAttribute (name, value);\n }", "protected abstract void setContextAttribute(String name, Object value);", "@Override\n\tpublic void setValue(final Attribute att, final String value) {\n\n\t}", "public void setAttribute(String key, Object value)\n {\n final IAttributeEditor editor = editors.get(key);\n if (editor != null)\n {\n editor.setValue(value);\n }\n }", "@Override\n public void setAttribute(String name, Object value) {\n if (name == null)\n throw new IllegalArgumentException(\"standardSession.setAttribute.namenull\");\n // Null value is the same as removeAttribute()\n if (value == null) {\n removeAttribute(name);\n return;\n }\n if (!valid)\n return;\n attributes.put(name, value);\n }", "public void setAttributeValue(final String name, final String value) {\n final Attribute attribute = manifestElement.getAttribute(name);\n if (attribute == null) {\n manifestElement.addAttribute(new Attribute(name, value));\n } else {\n attribute.setAttributeValue(value);\n }\n }", "public void setName(String value)\r\n\t{\r\n\r\n\t\tput(HtmlEnum.name.getAttributeName(), value);\r\n\t}", "public void set(String name, Object value) {\n }", "@Override\n\tpublic void setValue(final int attIndex, final String value) {\n\n\t}", "public void setAttribute_value(String string) {\n this.attribute_value = string;\n }", "public void setName(String value) {\n\t\tname = value;\n\t}", "@Override\n\tpublic void setAttribute(String name, Object value) {\n super.setAttribute(name, value);\n Enumeration<Figure> k = figures();\n while (k.hasMoreElements())\n k.nextElement().setAttribute(name, value);\n }", "public void setAttribute(String attribute, String value)\n\t{\n\t\tattributes.put(attribute, value);\n\t}", "@Override\n\t\tprotected void setAttributeValue(String value) {\n\t\t\ttry {\n\t\t\t\tchanging = true;\n\t\t\t\telement.setAttributeNS(namespaceURI, localName, value);\n\t\t\t} finally {\n\t\t\t\tchanging = false;\n\t\t\t}\n\t\t}", "public static void setAttribute(String name, Object value) {\n\t\tGPortalExecutionContext.getRequest().getSessionContext().setAttribute(name, value);\n\t}", "final public void setAttr(final String name, final float value) {\r\n\t\tmOptmizedKey++;\r\n\t\tfor(final Attr attr : mAttributes) {\r\n\t\t\tif(attr.Name.equals(name))\r\n\t\t\t\tattr.Value = value;\r\n\t\t}\r\n\t}", "@Override\n\t\tprotected void setAttributeValue(String value) {\n\t\t}", "public void setNameValue(String nameValue) throws JNCException {\n setNameValue(new YangString(nameValue));\n }", "public void setNameValue(String nameValue) throws JNCException {\n setNameValue(new YangString(nameValue));\n }", "public void setAttribute(NameValue a) {\n\t\tattribute = a;\n\t\tattribute.setSeparator(Separators.COLON);\n\t}", "public void attribute(String name, String value)\r\n throws IOException, IllegalStateException {\r\n if (!this.isNude) throw new IllegalArgumentException(\"Cannot write attribute: too late!\");\r\n this.writer.write(' ');\r\n this.writer.write(name);\r\n this.writer.write(\"=\\\"\");\r\n writerEscape.writeAttValue(value);\r\n this.writer.write('\"');\r\n }", "public static void attribute(String name, String value) {\n openAttribute(name); Log.write(value); closeAttribute();\n }", "void setString(String attributeValue);", "public Element setAttribute(String name, String value) {\n element.setAttribute(name, value);\n\n return this;\n }", "public BladeController setAttr(String name, Object value) {\n\t\trequest.setAttribute(name, value);\n\t\treturn this;\n\t}", "public void set(String attribute, Object value) {\r\n\t\tput(attribute, value);\r\n\t}", "void setAttribute( String attrName, Object value ) throws FileSystemException;", "@Override\n\t\tpublic void setAttribute(String name, Object o) {\n\t\t\t\n\t\t}", "public void setLocalAttribute(String name, String value) {\n\t\tlocalAttributes.put(name, value);\n\t}", "@Override\r\n\tpublic void setValue(String x) {\r\n\t\tthis.elementWrapper.setAttribute(this.attribute, x);\r\n\t}", "public void setAttribute(java.lang.String attrName, java.lang.String value) {\n\t\ttry {\n\t\t\tGovSteamFV4_primitive_builder attrEnum = GovSteamFV4_primitive_builder.valueOf(attrName);\n\t\t\tupdateAttributeInArray(attrEnum, attrEnum.construct(value));\n\t\t\tSystem.out.println(\"Updated GovSteamFV4, setting \" + attrName + \" to: \" + value);\n\t\t}\n\t\tcatch (IllegalArgumentException iae)\n\t\t{\n\t\t\tsuper.setAttribute(attrName, value);\n\t\t}\n\t}", "public void setValue(final String value) {\n super.setAttributeValue(value);\n }", "@Override\n\tpublic void attribute(QName qName, String value) {\n\t\t\n\t}", "@Override\n\tpublic void setAttribute(String name, Object o) {\n\t\t\n\t}", "void setInternal(ATTRIBUTES attribute, Object iValue);", "void setProperty(String attribute, String value);", "@Override\n\t\tpublic void addAttribute(String name, String value) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void addAttribute(String name, String value) {\n\t\t\t\n\t\t}", "public void setAttribute1(String value)\n {\n setAttributeInternal(ATTRIBUTE1, value);\n }", "public void setName(AXValue name) {\n this.name = name;\n }", "@Override\n\tpublic void setAttribute(String arg0, Object arg1) {\n\n\t}", "public void setName(String value) {\n this.name = value;\n }", "public void setName(java.lang.String name)\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 target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(NAME$26);\r\n }\r\n target.setStringValue(name);\r\n }\r\n }", "@Deprecated\n\tpublic <K> void setAttribute(String attributeName, K value);", "public void attribute(String name, int value)\r\n throws IOException, IllegalStateException {\r\n if (!this.isNude) throw new IllegalArgumentException(\"Cannot write attribute: too late!\");\r\n this.writer.write(' ');\r\n this.writer.write(name);\r\n this.writer.write(\"=\\\"\");\r\n this.writer.write(Integer.toString(value));\r\n this.writer.write('\"');\r\n }", "public void setName(java.lang.String value);", "public void setName(java.lang.String value);", "public void processDefinitionAttribute(String name, String value) {\n\t\tcurrentDefinition.setAttribute(name, value);\n\t}", "public void setName(java.lang.String name)\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$2);\r\n if (target == null)\r\n {\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(NAME$2);\r\n }\r\n target.setStringValue(name);\r\n }\r\n }", "public static void attribute(String name, int value) {\n openAttribute(name); Log.write(value); closeAttribute();\n }", "public synchronized void setAttributeValue(@Nonnull final String value) {\n checkSetterPreconditions();\n attributeValue = Constraint.isNotNull(value, \"attributeValue must not be null\");\n }", "final public void setAttr(final String name, final Vector2 value) {\r\n\t\tmOptmizedKey++;\r\n\t\tfor(final Attr attr : mAttributes) {\r\n\t\t\tif(attr.Name.equals(name)) {\r\n\t\t\t\tif(value == null)\r\n\t\t\t\t\tattr.Vector = null;\r\n\t\t\t\telse\r\n\t\t\t\t\tattr.Vector = value.clone();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void setName(java.lang.String name)\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 target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(NAME$6);\r\n }\r\n target.setStringValue(name);\r\n }\r\n }", "public void setName(java.lang.String name)\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$8);\r\n if (target == null)\r\n {\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(NAME$8);\r\n }\r\n target.setStringValue(name);\r\n }\r\n }", "public final void setAttribute(final String attributeName, final String attributeValue) {\n setAttributeNS(null, attributeName, attributeValue);\n }", "void setValueExpression(String attributeName, ValueExpression valueExpression);", "void setAttribute(String key, Object value)\n throws ProcessingException;", "public void setName(java.lang.String name)\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 target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(NAME$4);\n }\n target.setStringValue(name);\n }\n }", "public void setName(final String nameValue) {\n this.name = nameValue;\n }", "public void setName(final String nameValue) {\n this.name = nameValue;\n }", "public void setName(final String nameValue) {\n this.name = nameValue;\n }", "protected final void addAttribute(final String name, final String value) {\n if(value == null) attributes.remove(name);\n else attributes.put(name, value);\n\t}", "public static void setAttribute(Node node, String attribute, Object value) {\n if (node.getNodeType() == Node.ELEMENT_NODE && attribute != null && value != null) {\n ((Element)node).setAttribute(attribute, String.valueOf(value));\n }\n }", "public static String attr(String name, String value) {\n return attr(name, value, DFLT_QUOTE);\n }", "public void setName(final String nameValue) {\n this.name = nameValue;\n }", "public void setName(final String nameValue) {\n this.name = nameValue;\n }", "public void setName(final String nameValue) {\n this.name = nameValue;\n }", "public synchronized void setAttributeName(@Nonnull final String name) {\n checkSetterPreconditions();\n attributeName = Constraint.isNotNull(name, \"attributeName must not be null\");\n }", "public void setName(String name) throws SdpException {\n\t\tif (name == null)\n\t\t\tthrow new SdpException(\"The name is null\");\n\t\telse {\n\t\t\tNameValue nameValue = getAttribute();\n\t\t\tif (nameValue == null)\n\t\t\t\tnameValue = new NameValue();\n\t\t\tnameValue.setName(name);\n\t\t\tsetAttribute(nameValue);\n\t\t}\n\t}", "private void setName(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n name_ = value;\n }", "public void changeAttrName() {\r\n }", "public void setString(String name, String value)\n/* */ {\n/* 1119 */ XMLAttribute attr = findAttribute(name);\n/* 1120 */ if (attr == null) {\n/* 1121 */ attr = new XMLAttribute(name, name, null, value, \"CDATA\");\n/* 1122 */ this.attributes.addElement(attr);\n/* */ } else {\n/* 1124 */ attr.setValue(value);\n/* */ }\n/* */ }", "private void setName(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n name_ = value;\n }", "private void setName(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n name_ = value;\n }", "private void setName(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n name_ = value;\n }", "public void setValue(String value);", "public void setValue(String value);", "public void setValue(String value);", "public void setValue(String value);", "public void setAttribute(Session ses, String name, Object value);", "public void setAttribute1(String value) {\n setAttributeInternal(ATTRIBUTE1, value);\n }", "public void setAttribute1(String value) {\n setAttributeInternal(ATTRIBUTE1, value);\n }", "public void setAttribute1(String value) {\n setAttributeInternal(ATTRIBUTE1, value);\n }", "public void setAttribute1(String value) {\n setAttributeInternal(ATTRIBUTE1, value);\n }", "public void setAttribute1(String value) {\n setAttributeInternal(ATTRIBUTE1, value);\n }", "public void setAttribute1(String value) {\n setAttributeInternal(ATTRIBUTE1, value);\n }" ]
[ "0.7882644", "0.7811422", "0.75616854", "0.75552857", "0.75552857", "0.7527008", "0.7444901", "0.74023825", "0.7399222", "0.73652816", "0.7363674", "0.7297332", "0.729377", "0.72295594", "0.72279793", "0.72276443", "0.7218082", "0.71754706", "0.7134421", "0.7127274", "0.7090457", "0.7056389", "0.70350903", "0.6967215", "0.69513917", "0.6940107", "0.692262", "0.6918885", "0.6908039", "0.6898791", "0.68880576", "0.6870542", "0.68492395", "0.68492395", "0.6841701", "0.68363005", "0.6831631", "0.68133676", "0.6808862", "0.68013966", "0.67833865", "0.67648166", "0.67613685", "0.67590934", "0.6753228", "0.67422944", "0.67405164", "0.67369914", "0.6724531", "0.6721475", "0.67128307", "0.6710516", "0.6710516", "0.6707824", "0.66664183", "0.6660923", "0.66555285", "0.66552764", "0.6654146", "0.6642368", "0.663476", "0.663476", "0.66307914", "0.6620073", "0.66157883", "0.6601088", "0.6593992", "0.65925926", "0.6588719", "0.65870136", "0.65868944", "0.6586624", "0.657928", "0.6576481", "0.6576481", "0.6576481", "0.65597373", "0.6544128", "0.65370655", "0.6527153", "0.6527153", "0.6527153", "0.6524456", "0.64995396", "0.64925504", "0.64888036", "0.64692384", "0.64684665", "0.64684665", "0.64684665", "0.6456004", "0.6456004", "0.6456004", "0.6456004", "0.6445251", "0.6438871", "0.6438871", "0.6438871", "0.6438871", "0.6438871", "0.6438871" ]
0.0
-1
Sets a value to attribute permission.
public void setPermission(Permission newPermission) { this.permission = newPermission; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void setPermission(String perm, boolean add);", "void setPerm(String name,\n Object value);", "public static void setPermission(String permission) {\n\t\tsetPermission(last[0],last[1], permission);\n\t}", "public void setPermission(String permission)\r\n {\r\n this.permission = permission;\r\n }", "public void setPermissionValue(String permissionValue)\n\t{\n\t\tthis.permissionValue = permissionValue;\n\t}", "public void setPermission(int permission) {\r\n\r\n\t\tif (permission == nPermission)\r\n\t\t\treturn;\r\n\r\n\t\tsetPermissionLocal(permission);\r\n\t}", "public void setUserModificationPermission(int permission) {\n this.permission = permission;\n }", "public abstract void setPermissions(PermissionIFace permissions);", "public void setPermission(Integer permission) {\n\t\tthis.permission = permission;\n\t}", "void setInternal(ATTRIBUTES attribute, Object iValue);", "public void set(AttributeDefinition attribute, Object value)\n throws UnknownAttributeException, ModificationNotPermitedException\n {\n if(builtinAttributes.containsKey(attribute.getName()))\n {\n throw new IllegalArgumentException(\"builtin attribute \"+attribute.getName()+\n \"cannot be modified with set method\"); \n }\n else\n {\n throw new UnknownAttributeException(\"not a builtin attribute\");\n }\n }", "public void setPermission(com.tangosol.net.ClusterPermission permission)\n {\n __m_Permission = permission;\n }", "protected void setPermissionLocal(int permission) {\r\n\t\tif (permission == nPermission)\r\n\t\t\treturn ;\r\n\t\tnPermission = permission;\r\n\t}", "public void setAttrib(String name, String value);", "public void setAttribute(String type, int value) throws AdsException{\r\n\t\tbyte[] values = Convert.IntToByteArr(value);\r\n\r\n\t\tthis.configAttribute( type , values );\r\n\t}", "public Builder setPermissions(\n int index, java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensurePermissionsIsMutable();\n permissions_.set(index, value);\n bitField0_ |= 0x00000040;\n onChanged();\n return this;\n }", "void setInt(int attributeValue);", "private static void setPermission(Path path) throws JulongChainException {\n if(System.getProperty(SYSTEM_PROP_OS).contains(SYSTEM_PROP_VALUE_WINDOWS)) {\n return;\n }\n\n Set<PosixFilePermission> filePermissions = new HashSet<>();\n filePermissions.add(PosixFilePermission.OWNER_READ);\n filePermissions.add(PosixFilePermission.OWNER_WRITE);\n filePermissions.add(PosixFilePermission.OWNER_EXECUTE);\n filePermissions.add(PosixFilePermission.GROUP_READ);\n filePermissions.add(PosixFilePermission.GROUP_EXECUTE);\n filePermissions.add(PosixFilePermission.OTHERS_READ);\n filePermissions.add(PosixFilePermission.OTHERS_EXECUTE);\n try {\n Files.setPosixFilePermissions(path, filePermissions);\n } catch (IOException e) {\n throw new JulongChainException(\"set directory\" + path + \" permission failed \" + e.getMessage());\n }\n }", "public static <T> void setValue(PmAttr<T> attr, T value) {\n assertEnabled(attr);\n attr.setValue(value);\n assertNoMessagesInSubTree(attr);\n assertEquals(value, attr.getValue());\n }", "public T set(String name, Object value)\n\t\t\tthrows TablesawException\n\t\t{\n\t\ttry\n\t\t\t{\n\t\t\tif (value instanceof String)\n\t\t\t\t{\n\t\t\t\tm_intHelper.setAttribute(m_project, m_antObject, name, (String)value);\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\tMethod m = m_intHelper.getAttributeMethod(name);\n\t\t\t\tm.invoke(m_antObject, value);\n\t\t\t\t}\n\t\t\t}\n\t\tcatch (IllegalArgumentException iae)\n\t\t\t{\n\t\t\t// TODO: add better error\n\t\t\tthrow new TablesawException(iae);\n\t\t\t}\n\t\tcatch (Exception e)\n\t\t\t{\n\t\t\tthrow new TablesawException(\"Error setting attribute '\"+name+\"' on '\"+m_elementName+\"'\", e);\n\t\t\t}\n\t\t\n\t\treturn ((T)this);\n\t\t}", "protected abstract void setContextAttribute(String name, Object value);", "public void setAttribute(String name, Object value);", "void setAttribute( String attrName, Object value ) throws FileSystemException;", "public void set_attribute(Object instance, String attribute_name, Object value) throws XtumlException;", "@Override\n\t\tpublic void setAttribute(String name, Object value) {\n\t\t\t\n\t\t}", "public static void attribute(String name, int value) {\n openAttribute(name); Log.write(value); closeAttribute();\n }", "@Column(name = \"PERMISSION_VALUE\")\n\t@AccelaGenerator(generatorClass=\"com.accela.aa.datamanager.service.FilterScreenPermissionModelGeneratorImpl\")\t\n\tpublic String getPermissionValue()\n\t{\n\t\treturn permissionValue;\n\t}", "void changePermissions(Training training, User user, Permission permission, String token) throws AuthenticationException;", "void setAttribute(String name, Object value);", "void setAttribute(String name, Object value);", "@Override\n\tpublic void setValue(final Attribute att, final String value) {\n\n\t}", "@Path(\"{uid}/\")\n @PUT\n @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})\n public void setPermissions(@PathParam(\"uid\") Long uid, JAXBElement<Permissions> jbPermissions) {\n try (Connection cn = catalogue.getConnection()) {\n try {\n LogicalData res = catalogue.getLogicalDataByUid(uid, cn);\n if (res == null) {\n throw new WebApplicationException(Response.Status.NOT_FOUND);\n }\n MyPrincipal mp = (MyPrincipal) request.getAttribute(\"myprincipal\");\n Permissions p = catalogue.getPermissions(uid, res.getOwner(), cn);\n if (!mp.canWrite(p)) {\n throw new WebApplicationException(Response.Status.UNAUTHORIZED);\n }\n Permissions permissions = jbPermissions.getValue();\n catalogue.updateOwner(uid, permissions.getOwner(), cn);\n catalogue.setPermissions(uid, permissions, cn);\n cn.commit();\n } catch (SQLException ex) {\n Logger.getLogger(PermissionsResource.class.getName()).log(Level.SEVERE, null, ex);\n cn.rollback();\n throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR);\n }\n } catch (SQLException ex) {\n Logger.getLogger(PermissionsResource.class.getName()).log(Level.SEVERE, null, ex);\n throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR);\n }\n }", "public void setOtherPermission(TPermissionMode otherP) {\n\n\t\tthis.otherPermission = otherP;\n\t}", "@Test\n public void setPermissions() {\n cleanEntity0();\n\n entity0.setPermissions(permissionsS);\n assertEquals(permissionsS, ReflectionTestUtils.getField(entity0, \"permissions\"));\n }", "public SetPermission() {\n initComponents();\n }", "public static ProcessResult setPermissions(String target, String permissions) {\n String command = \"sudo chmod -R \" + permissions + \" \" + target;\n LOG.debug(\"ics.core.io.FileUtils.setPermissions(): \");\n return ShellUtil.executeShellCommand(command);\n }", "public static void attribute(String name, boolean value) {\n openAttribute(name); Log.write(value); closeAttribute();\n }", "public static void setAttribute(String name, Object value) {\n\t\tGPortalExecutionContext.getRequest().getSessionContext().setAttribute(name, value);\n\t}", "public void setPermissions(List<Permission> permissions)\r\n/* */ {\r\n/* 235 */ this.permissions = permissions;\r\n/* */ }", "private void setPerms() {\n int oPerm = 0; // Owner permissions\n int gPerm = 0; // Group permissions\n int aPerm = 0; // All (other) permissions\n\n // Set owner permissions digit\n if (ownerRead.isSelected()) oPerm += 4; // Read\n if (ownerWrite.isSelected()) oPerm += 2; // Write\n if (ownerExe.isSelected()) oPerm += 1; // Execute\n\n // Set group permissions digit\n if (groupRead.isSelected()) gPerm += 4; // Read\n if (groupWrite.isSelected()) gPerm += 2; // Write\n if (groupExe.isSelected()) gPerm += 1; // Execute\n\n // Set all permissions digit\n if (allRead.isSelected()) aPerm += 4; // Read\n if (allWrite.isSelected()) aPerm += 2; // Write\n if (allExe.isSelected()) aPerm += 1; // Execute\n\n // Concatenate digits into chmod code\n String perms = Integer.toString(oPerm) + Integer.toString(gPerm) + Integer.toString(aPerm);\n //System.out.println(perms); // just for testing\n\n FTPReply chmodReply;\n try {\n // Set file permissions\n chmodReply = client.sendSiteCommand(\"chmod \" + perms + \" \" + theFile);\n System.out.println(chmodReply.toString());\n }\n catch (FTPIllegalReplyException | IOException e) {\n e.printStackTrace();\n }\n }", "int getPermissionWrite();", "public Boolean setFloodPerm(String floodPerm) throws PermissionDeniedException;", "public static void attribute(String name, long value) {\n openAttribute(name); Log.write(value); closeAttribute();\n }", "public void setPermissions(int permissions)\n {\n encryptionDictionary.setInt( \"P\", permissions );\n }", "public void set(V value) {\n Rules.checkAttributeValue(value);\n checkType(value);\n this.value = value;\n isSleeping = false;\n notifyObservers();\n }", "public void setAccession(java.lang.String accession)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(ACCESSION$2, 0);\r\n if (target == null)\r\n {\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(ACCESSION$2);\r\n }\r\n target.setStringValue(accession);\r\n }\r\n }", "public void setValue(final String value) {\n super.setAttributeValue(value);\n }", "void setProperty(String attribute, String value);", "public void setUserPermissionId( Integer userPermissionId ) {\n this.userPermissionId = userPermissionId ;\n }", "public void setNegativePermissions();", "@Override\n\t\tprotected void setAttributeValue(String value) {\n\t\t}", "@Override\n\t\tprotected void setAttributeValue(String value) {\n\t\t\ttry {\n\t\t\t\tchanging = true;\n\t\t\t\telement.setAttributeNS(namespaceURI, localName, value);\n\t\t\t} finally {\n\t\t\t\tchanging = false;\n\t\t\t}\n\t\t}", "@PostMapping(\"/setAttribute\")\n public String setAttribute(String uid, String attribute, String value)\n {\n String returnVal;\n if()\n {\n returnVal = \"uid: \"+ uid + \"\\n\";\n } else\n {\n returnVal = \"uid not found\\n\";\n }\n return returnVal;\n }", "int setCanStatus(int canRegno, int action);", "public void setAttributeValue(final String name, final String value) {\n final Attribute attribute = manifestElement.getAttribute(name);\n if (attribute == null) {\n manifestElement.addAttribute(new Attribute(name, value));\n } else {\n attribute.setAttributeValue(value);\n }\n }", "@Override\n public void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException {\n\n }", "public synchronized void setAttributeValue(@Nonnull final String value) {\n checkSetterPreconditions();\n attributeValue = Constraint.isNotNull(value, \"attributeValue must not be null\");\n }", "public void setValue(IveObject val){\r\n\tvalue = val;\r\n\tnotifyFromAttr();\r\n }", "public void setContactRole(typekey.APDExposureContactRole value);", "public void setValue(int value);", "public void setPermissionAccess(String permissionAccess)\n\t{\n\t\tthis.permissionAccess = permissionAccess;\n\t}", "public void setAttribute(Attribute attribute) \n throws AttributeNotFoundException,\n InvalidAttributeValueException,\n MBeanException, \n ReflectionException {\n if (attribute == null) {\n throw new RuntimeOperationsException(new IllegalArgumentException(\"Attribute cannot be null\"), \n \"Cannot invoke a setter of \" + dClassName + \" with null attribute\");\n }\n String name = attribute.getName();\n if (name == null) {\n throw new RuntimeOperationsException(new IllegalArgumentException(\"Attribute name cannot be null\"), \n \"Cannot invoke the setter of \" + dClassName + \" with null attribute name\");\n }\n\n name = RunTimeSingleton.decode(name, \"US-ASCII\"); // HtmlAdapter made from info/admin -> info%2Fadmin\n // \"logging/org.xmlBlaster.engine.RequestBroker\"\n if (name.startsWith(\"logging/\"))\n name = name.substring(8); // \"org.xmlBlaster.engine.RequestBroker\"\n\n String value = (String)attribute.getValue();\n log.debug(\"Setting log level of name=\" + name + \" to '\" + value + \"'\");\n\n try {\n Level level = Level.toLevel(value);\n this.glob.changeLogLevel(name, level);\n }\n catch (ServiceManagerException e) {\n throw(new AttributeNotFoundException(\"Cannot set log level attribute '\"+ name +\"':\" + e.getMessage()));\n }\n catch (Throwable e) {\n throw(new AttributeNotFoundException(\"Cannot set log level attribute '\"+ name +\"':\" + e.toString()));\n }\n }", "public boolean addPermission(Permission permission);", "public void setAttribute1(String value)\n {\n setAttributeInternal(ATTRIBUTE1, value);\n }", "public void attribute(String name, int value)\r\n throws IOException, IllegalStateException {\r\n if (!this.isNude) throw new IllegalArgumentException(\"Cannot write attribute: too late!\");\r\n this.writer.write(' ');\r\n this.writer.write(name);\r\n this.writer.write(\"=\\\"\");\r\n this.writer.write(Integer.toString(value));\r\n this.writer.write('\"');\r\n }", "public boolean updatePDATApermission (String category, boolean value) {\n Logger.write(\"VERBOSE\", \"DB\", \"updatePDATApermission(...)\");\n try {\n execute(DBStrings.updatePDATApermission.replace(\"__catID__\", category)\n .replace(\"__bool__\", value?\"1\":\"0\"));\n } catch (java.sql.SQLException e) {\n Logger.write(\"ERROR\", \"DB\", \"SQLException: \" + e);\n return false;\n }\n \n return true;\n }", "public void setValue(int value)\n {\n this.value = value;\n }", "public void setValue(final List<String> attrValue) {\r\n if (attrValue != null) {\r\n this.value = attrValue;\r\n }\r\n }", "public void set(int value)\n {\n set(value, true);\n }", "public void set(String attribute, Object value) {\r\n\t\tput(attribute, value);\r\n\t}", "public void setValue(AXValue value) {\n this.value = value;\n }", "public void setValue(A value) {this.value = value; }", "public void setValue(Object value) { this.value = value; }", "public synchronized void setAttribute(String key, Object value) {\n if (value == null) {\n attributes.remove(key);\n } else {\n attributes.put(key, value);\n }\n }", "public void setValue(Object value);", "public Object set(Object value, IMObject parent, NodeDescriptor node, AssertionDescriptor assertion) {\r\n Object result = value;\r\n ActionTypeDescriptor actionType = getActionType(Actions.set.toString());\r\n if (actionType != null) {\r\n try {\r\n result = evaluateAction(Actions.set.toString(), value, parent, node, assertion);\r\n } catch (Exception exception) {\r\n throw new AssertionException(\r\n AssertionException.ErrorCode.FailedToApplyAssertion,\r\n new Object[]{\"assert\", getName()}, exception);\r\n }\r\n }\r\n return result;\r\n }", "public void setValue(int value) {\r\n this.value = value;\r\n }", "public void attribute (final String name, final Object value) {\n session.setAttribute (name, value);\n }", "public void setValue(Object value) {\n\t\tthis.value = value;\n\t\tsetValueAction(value);\n\t}", "@Override\n public void setAttribute(boolean f)\n {\n checkState();\n attribute = f;\n }", "public void setAttribute(Execution exec, String name, Object value);", "public String getPermission()\r\n {\r\n return permission;\r\n }", "public void setValue(int value) {\n this.value = value;\n }", "public void setValue(int value) {\n this.value = value;\n }", "public void setValue(int value) {\n this.value = value;\n }", "public void setMemberValue(String memberName, String value) {\n\n\t\tMethod method = (Method) m_setMethods.get(memberName);\n\t\ttry {\n\t\t\tif (method != null) {\n\t\t\t\tmethod.invoke(this, (new String[] { value }));\n\t\t\t}\n\t\t} catch (IllegalAccessException e) {\n\t\t\t//LOG.error(\"failed to set member value\", e);\n\t\t\tlogger.error(\"failed to set member value\" + e.getMessage());\n\t\t} catch (IllegalArgumentException e) {\n\t\t\t//LOG.error(\"failed to set member value\", e);\n\t\t\tlogger.error(\"failed to set member value\" + e.getMessage());\n\t\t} catch (InvocationTargetException e) {\n\t\t\t//LOG.error(\"failed to set member value\", e);\n\t\t\tlogger.error(\"failed to set member value\" + e.getMessage());\n\t\t}\n\t}", "public void setValue(int value) {\n this.value = value;\n }", "public void setValue(int value) {\n this.value = value;\n }", "public void setAttribute(String key, Object value)\n {\n final IAttributeEditor editor = editors.get(key);\n if (editor != null)\n {\n editor.setValue(value);\n }\n }", "public boolean setProperty(String attName, Object value);", "public void setValue(Object value) {\n this.value = value;\n }", "void setString(String attributeValue);", "@Override\r\n\tpublic int updPermission(Permission perms) {\n\t\treturn 0;\r\n\t}", "public void setAttribute_value(String string) {\n this.attribute_value = string;\n }", "protected void doSetValue(Object _value) {\n\t\tthis.value = (Boolean) _value;\n\t}", "public Boolean setFloodPerm(String dpidStr, String floodPerm) throws PermissionDeniedException;", "public void setAccess(int nAccess)\n {\n ensureLoaded();\n m_flags.setAccess(nAccess);\n setModified(true);\n }", "public static void attribute(String name, String value) {\n openAttribute(name); Log.write(value); closeAttribute();\n }", "public void setAttributeValue(String name, String value) throws Exception {\n if (!_attributes.containsKey(name)) {\n throw new Exception(name + \" is not a valid attribute name for features in the\" + _layer.getDisplayName() + \" layer\");\n }\n _attributes.setProperty(name, value);\n }", "public void setValue(int value) {\n m_value = value;\n }" ]
[ "0.6827849", "0.67893404", "0.6589196", "0.6573097", "0.65621847", "0.65544564", "0.6416563", "0.63307244", "0.63088584", "0.62581843", "0.6154031", "0.6088125", "0.6047017", "0.5956834", "0.59284806", "0.5925885", "0.5914836", "0.58695215", "0.57436925", "0.5702488", "0.5698042", "0.5687448", "0.56699", "0.5662472", "0.5652502", "0.56521225", "0.56487525", "0.56309223", "0.5615836", "0.5615836", "0.5595464", "0.55802184", "0.55707085", "0.555748", "0.5533063", "0.5523335", "0.5518557", "0.55168825", "0.5509725", "0.55074364", "0.5505376", "0.54930425", "0.5483779", "0.54828954", "0.54790914", "0.5462268", "0.54621446", "0.5451341", "0.54471457", "0.54339606", "0.5432971", "0.5424988", "0.5413919", "0.54063827", "0.5405806", "0.54036266", "0.5399618", "0.5397506", "0.53947926", "0.53921884", "0.53911567", "0.53871113", "0.53836596", "0.5374213", "0.53730965", "0.5366368", "0.5348246", "0.53469723", "0.53418356", "0.53382486", "0.5337155", "0.5335658", "0.53293866", "0.532525", "0.5322941", "0.53215456", "0.53191775", "0.53054756", "0.5302763", "0.53010505", "0.5296684", "0.5289851", "0.52875334", "0.52875334", "0.52875334", "0.52873766", "0.5284599", "0.5284599", "0.5282246", "0.5282234", "0.5281213", "0.5269561", "0.52684623", "0.5265176", "0.5259645", "0.5259334", "0.5259176", "0.5258718", "0.5258636", "0.52581686" ]
0.63721067
7
Sets a value to attribute creationDate.
public void setCreationDate(Date newCreationDate) { this.creationDate = newCreationDate; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setCreationDate(Date value)\n {\n setAttributeInternal(CREATIONDATE, value);\n }", "public void setCreationDate(Date value) {\n setAttributeInternal(CREATIONDATE, value);\n }", "public void setCreationDate(Date value) {\n setAttributeInternal(CREATIONDATE, value);\n }", "public void setCreationDate(Date value) {\n setAttributeInternal(CREATIONDATE, value);\n }", "public void setCreationDate(Date value) {\n setAttributeInternal(CREATIONDATE, value);\n }", "public void setCreationDate(Date value) {\n setAttributeInternal(CREATIONDATE, value);\n }", "public void setCreationDate(Date value) {\n setAttributeInternal(CREATIONDATE, value);\n }", "public void setCreationDate(Date value) {\n setAttributeInternal(CREATIONDATE, value);\n }", "public void setCreationDate(Date value) {\n setAttributeInternal(CREATIONDATE, value);\n }", "void setCreateDate(final Date creationDate);", "public void setCreationDate(Date creationDate);", "public void setCreationDate(Date creationDate)\r\n {\r\n m_creationDate = creationDate;\r\n }", "public void setCreatedDate(Date value) {\n setAttributeInternal(CREATEDDATE, value);\n }", "void setCreationDate(Date val)\n throws RemoteException;", "public void setCreationDate(Date creationDate) {\r\n this.creationDate = creationDate;\r\n }", "public void setCreationDate(Date creationDate) {\n }", "public void setCreationDate(\n @Nullable\n final LocalDateTime creationDate) {\n rememberChangedField(\"CreationDate\", this.creationDate);\n this.creationDate = creationDate;\n }", "public void setCreationDate(Date creationDate) {\n \n this.creationDate = creationDate;\n\n }", "void setCreatedDate(Date createdDate);", "public void setCreationDate(final Date creationDate) {\n\t\tthis.creationDate = creationDate;\n\t}", "public void setCreatedDate(Date value) {\n this.createdDate = value;\n }", "public void setCreatedDate(Date value) {\n this.createdDate = value;\n }", "public Builder setCreationDate(long value) {\n \n creationDate_ = value;\n onChanged();\n return this;\n }", "public void setCreationDate(java.util.Date creationDate) {\n this.creationDate = creationDate;\n }", "public void setCreatedAt(Date value) {\n setAttributeInternal(CREATEDAT, value);\n }", "public void setCreatedAt(Date value) {\n setAttributeInternal(CREATEDAT, value);\n }", "public void setCreationDate(Long creationDate)\r\n\t{\r\n\t\tthis.creationDate = creationDate;\r\n\t}", "public void setCreationDate(String creationDate) {\r\n\t\tthis.creationDate = new SimpleStringProperty(creationDate);\r\n\t}", "public void setCreationdate(Date creationdate) {\n this.creationdate = creationdate;\n }", "void setCreateDate(Date date);", "public IBusinessObject setCreationDate(Timestamp creationDate)\n throws ORIOException;", "public Builder setCreateDate(String value) {\n validate(fields()[2], value);\n this.createDate = value;\n fieldSetFlags()[2] = true;\n return this; \n }", "public void setCreatedDate(Date createdDate);", "public void setCreationDate(java.util.Calendar creationDate) {\n this.creationDate = creationDate;\n }", "public void setDateCreated(Date dateCreated);", "public Builder setCreationDate(long value) {\n\n creationDate_ = value;\n bitField0_ |= 0x00000002;\n onChanged();\n return this;\n }", "void setDateCreated(final Date dateCreated);", "public void setCreated(java.util.Date value)\r\n {\r\n getSemanticObject().setDateProperty(swb_created, value);\r\n }", "public void setCreated(java.util.Date value)\r\n {\r\n getSemanticObject().setDateProperty(swb_created, value);\r\n }", "public void setCreated(java.util.Date value)\r\n {\r\n getSemanticObject().setDateProperty(swb_created, value);\r\n }", "public void setCreateDate(Date createDate);", "public void setCreateDate(Date createDate);", "public void setCreateDate(Date createDate);", "public void setCreateDate(String value) {\n this.createDate = value;\n }", "public void setCreatedAt(final Date value)\n\t{\n\t\tsetCreatedAt( getSession().getSessionContext(), value );\n\t}", "public void setCreatedDate(Timestamp value) {\n setAttributeInternal(CREATEDDATE, value);\n }", "public void setNotiCreated(Date value) {\r\n setAttributeInternal(NOTICREATED, value);\r\n }", "public void setCreated(Date v) \n {\n \n if (!ObjectUtils.equals(this.created, v))\n {\n this.created = v;\n setModified(true);\n }\n \n \n }", "public void setCreationDate(Calendar creationDate) {\n/* 248 */ getCOSObject().setDate(COSName.CREATION_DATE, creationDate);\n/* */ }", "public void setCreateDate(Date createDate) { this.createDate = createDate; }", "void setCreationDate( String username, Date creationDate ) throws UserNotFoundException;", "private void setCreateTime(java.util.Date value) {\n __getInternalInterface().setFieldValue(CREATETIME_PROP.get(), value);\n }", "public void setCREATED_DATE(Date CREATED_DATE) {\r\n this.CREATED_DATE = CREATED_DATE;\r\n }", "public void setCreationTime( Date creationTime )\n\t{\n\t\tthis.creationTime\t= creationTime;\n\t}", "public void setCreatedDate(Date createdDate) {\r\n this.createdDate = createdDate;\r\n }", "public void setCreatedDate(Date createdDate) {\r\n this.createdDate = createdDate;\r\n }", "public void setCreateDate(java.util.Date newVal) {\n if ((newVal != null && this.createDate != null && (newVal.compareTo(this.createDate) == 0)) || \n (newVal == null && this.createDate == null && createDate_is_initialized)) {\n return; \n } \n try {\n this.createDate = (java.util.Date)newVal.clone();\n } catch (Exception e) {\n // do nothing\n }\n\n createDate_is_modified = true; \n createDate_is_initialized = true; \n }", "public void setCreationTime(DateTime creationTime) {\n this.created = creationTime;\n }", "@Override\n\tpublic void setCreateDate(Date createDate);", "@Override\n\tpublic void setCreateDate(Date createDate);", "public void setCreationTime(Date creationTime) {\n this.creationTime = creationTime;\n }", "public void setCreationTime(Date creationTime) {\n this.creationTime = creationTime;\n }", "public void setCreateDate(Date createDate)\r\n/* */ {\r\n/* 165 */ this.createDate = createDate;\r\n/* */ }", "public void setCreated(Date created) {\r\n this.created = created;\r\n }", "public void setCreated(Date created) {\r\n this.created = created;\r\n }", "public void setCreatedDate(Date createdDate) {\n this.createdDate = createdDate;\n }", "@Override\n\tpublic void setCreateDate(Date createDate) {\n\t\t_changesetEntry.setCreateDate(createDate);\n\t}", "public Builder setCreateDate(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n createDate_ = value;\n onChanged();\n return this;\n }", "public void setCreatedDate(Timestamp aCreatedDate) {\n createdDate = aCreatedDate;\n }", "public void setCreateDate(Date createDate) {\n this.createDate = createDate;\n }", "public void setCreationDateTime(java.util.Date creationDateTime) {\n this.creationDateTime = creationDateTime;\n }", "public void setCreationDateTime(java.util.Date creationDateTime) {\n this.creationDateTime = creationDateTime;\n }", "public void setCreationTime(DateTime creationTime) {\n this.creationTime = creationTime;\n }", "public void setCreatorDate(Date creatorDate) {\n this.creatorDate = creatorDate;\n }", "public void setCreated(Date created) {\n this.created = created;\n }", "public void setCreated(Date created) {\n this.created = created;\n }", "public void setCreated(Date created) {\n this.created = created;\n }", "public void setCreated(Date created) {\n this.created = created;\n }", "public void setCreateTime(java.util.Date value) {\n __getInternalInterface().setFieldValue(CREATETIME_PROP.get(), value);\n }", "public void setCreated(Date created) {\r\n\t\tthis.created = created;\r\n\t}", "public void setCreated(Date created) {\r\n\t\tthis.created = created;\r\n\t}", "public void setCreateDate(Date createDate) {\r\n this.createDate = createDate;\r\n }", "public void setCreateDate(Date createDate) {\r\n this.createDate = createDate;\r\n }", "public void setCreationTimestamp(java.util.Date creationTimestamp) {\n this.creationTimestamp = creationTimestamp;\n }", "public void setCreatedate(Date createdate) {\r\n this.createdate = createdate;\r\n }", "public void setCreatedate(Date createdate) {\r\n this.createdate = createdate;\r\n }", "public void setCreatedDate(Date createdDate) {\n\t\tthis.createdDate = createdDate;\n\t}", "public void setCreationTime(java.util.Date creationTime) {\n this.creationTime = creationTime;\n }", "public void setCreationTime(java.util.Date creationTime) {\n this.creationTime = creationTime;\n }", "public void setCreationTime(java.util.Date creationTime) {\n this.creationTime = creationTime;\n }", "public void setCreateddate( Date createddate )\n {\n this.createddate = createddate;\n }", "public void setDateCreated(java.util.Date dateCreated){\r\n\t\tthis.dateCreated = dateCreated;\r\n\t}", "public void setDate( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.set(this.model, this.getResource(), DATE, value);\r\n\t}", "public void setCreationDateLocal(Date date) {\r\n\t\toCreationDate = date ;\r\n\t}", "@SuppressWarnings(\"JdkObsolete\")\n public void setCreated(Instant date) {\n this.created = Timestamp.from(date);\n }", "public final void setDateCreated(java.util.Date datecreated)\r\n\t{\r\n\t\tsetDateCreated(getContext(), datecreated);\r\n\t}", "@Override\n\tpublic void setCreateDate(Date createDate) {\n\t\tmodel.setCreateDate(createDate);\n\t}", "@Override\n\tpublic void setCreateDate(Date createDate) {\n\t\tmodel.setCreateDate(createDate);\n\t}", "@Override\n\tpublic void setCreateDate(Date createDate) {\n\t\tmodel.setCreateDate(createDate);\n\t}", "public void setCreatedDate(Date createDate) {\n\t\tthis.createdDate = createDate;\n\t}" ]
[ "0.8624276", "0.8487596", "0.8487596", "0.8487596", "0.8487596", "0.8487596", "0.8487596", "0.8487596", "0.8487596", "0.83126634", "0.82914007", "0.82378733", "0.8221079", "0.8192832", "0.8095892", "0.8081475", "0.80001736", "0.793136", "0.7881454", "0.7861162", "0.77928865", "0.77928865", "0.77635276", "0.7761402", "0.7746667", "0.7746667", "0.76945394", "0.7692089", "0.769185", "0.7687389", "0.764552", "0.76279867", "0.76112497", "0.75670034", "0.75498194", "0.75434995", "0.7541738", "0.7525528", "0.7525528", "0.7525528", "0.75190115", "0.75190115", "0.75190115", "0.747945", "0.7468235", "0.74198115", "0.74133575", "0.73572475", "0.7341814", "0.73405135", "0.72360045", "0.7208293", "0.71792656", "0.7173494", "0.7163498", "0.7163498", "0.71617836", "0.71458846", "0.7130362", "0.7130362", "0.7115847", "0.7115847", "0.7101148", "0.7083813", "0.7083813", "0.7060934", "0.70598596", "0.7036999", "0.70297843", "0.7019658", "0.7013444", "0.7013444", "0.7011905", "0.7009115", "0.6976952", "0.6976952", "0.6976952", "0.6976952", "0.69695216", "0.6966155", "0.6966155", "0.69617605", "0.69617605", "0.6945117", "0.69386405", "0.69386405", "0.6933375", "0.69191456", "0.69191456", "0.69191456", "0.69126", "0.68992555", "0.68752277", "0.6864936", "0.68618494", "0.68536484", "0.6844266", "0.6844266", "0.6844266", "0.6822125" ]
0.7061685
65
Sets a value to attribute board_id.
public void setBoard_id(int newBoard_id) { this.board_id = newBoard_id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setBoard_id(int Board_id){\n this.Board_id=Board_id;\n }", "public void setBoard(int[][] board) {\n this.board = board;\n }", "public void setBoard(Board board) {\n this.board = board;\n }", "public void setBoard(Board board) {\n this.board = board;\n }", "public void setBoard(Board board) {\n\t\tthis.board = board;\n\t\t\n\t}", "void setBoard(Board board);", "private void setRoomId(long value) {\n \n roomId_ = value;\n }", "@Override\r\n\tpublic void setBoard(Board board) {\n\t\t\r\n\t}", "public void setBoard(int row, int col, int value) {\n this.board[row][col] = value;\n }", "public void setBoard(Board board){this.board = board;}", "public void setBoard(GUIBoard board) {\n this.board = board;\n }", "private void setId(int value) {\n \n id_ = value;\n }", "private void setId(int value) {\n \n id_ = value;\n }", "private void setOtherId(int value) {\n \n otherId_ = value;\n }", "public void changeBoard(Board board){\n this.board = board;\n }", "private void setId(int value) {\n \n id_ = value;\n }", "private void setId(int value) {\n \n id_ = value;\n }", "private void setId(int value) {\n \n id_ = value;\n }", "private void setId(int value) {\n \n id_ = value;\n }", "private void setId(int value) {\n \n id_ = value;\n }", "private void setId(int value) {\n \n id_ = value;\n }", "private void setId(int value) {\n \n id_ = value;\n }", "public Builder setCellid(int value) {\n \n cellid_ = value;\n onChanged();\n return this;\n }", "public static void setBoard(char[][] board) {\n\t\tBoard.board = board;\n\t}", "public void setBoard(Board theBoard) {\n\t\tthis.board = theBoard;\n\t}", "public void setBoard(final Board the_board)\n {\n my_board = the_board;\n my_board.addObserver(this);\n }", "public void setBoard(Board theBoard) {\n\t\tthis.board = theBoard;\n\n\t}", "public void setId(byte value) {\r\n this.id = value;\r\n }", "public Builder setMoveId(long value) {\n \n moveId_ = value;\n onChanged();\n return this;\n }", "public void setId(int value) {\r\n this.id = value;\r\n }", "public void setBoard(GameToken[][] board) {\n\t\tif (board == null) {\n\t\t\tthrow new NullPointerException();\n\t\t}\n\t\t\n\t\t// get length of row\n\t\tint size = board.length;\n\t\t// check length of all columns\n\t\tfor (int row = 0; row < size; row++) {\n\t\t\tif (board[row] == null) {\n\t\t\t\tthrow new NullPointerException();\n\t\t\t}\n\t\t\t// does the column length match the row length?\n\t\t\tif (board[row].length != size) {\n\t\t\t\tthrow new IndexOutOfBoundsException();\n\t\t\t}\n\t\t}\n\t\t// all checks passed\n\t\tthis.size = size;\n\t\tthis.board = board;\n\t}", "public void setId(int value) {\n this.id = value;\n }", "public void setId(int value) {\n this.id = value;\n }", "public void setId(int value) {\n this.id = value;\n }", "public void setId(int value) {\n this.id = value;\n }", "public void setId(int value) {\n this.id = value;\n }", "public void setId(int value) {\n this.id = value;\n }", "public void setId(int value) {\n this.id = value;\n }", "public void setId(int value) {\n this.id = value;\n }", "public void setId(int value) {\n this.id = value;\n }", "public void setId(int value) {\n this.id = value;\n }", "public int getBoard_id(){\n return Board_id;\n }", "public void setBoardLocation(int boardLocation) {this.boardLocation = boardLocation;}", "private void setAId(int value) {\n \n aId_ = value;\n }", "public static void setPuzzleId(Integer value, Context context) {\n SharedPreferences prefs = context.getSharedPreferences(PREF, Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = prefs.edit();\n editor.putString(\"PuzzleId\", String.valueOf(value));\n editor.commit();\n }", "public void setId(String value) {\n \tif (value==null)\n \t\tthis.id = \"\";\n \telse\n \t\tthis.id = value;\n }", "private void setBId(int value) {\n \n bId_ = value;\n }", "public void setId(Integer value) {\n set(0, value);\n }", "public static void setPiece(final Board board, final int index, \n\t\t\tfinal String value) {\n\t\tboard.getSpaceByIndex(index).setPiece(\n\t\t\t\tnew BasicPieceHelper(value, null));\n\t}", "public Builder setPlayerId(long value) {\n \n playerId_ = value;\n onChanged();\n return this;\n }", "void setId(int val);", "public void setId(Integer value) {\n this.id = value;\n }", "public void setId(Integer value) {\n this.id = value;\n }", "public Builder setForumId(io.dstore.values.IntegerValue value) {\n if (forumIdBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n forumId_ = value;\n onChanged();\n } else {\n forumIdBuilder_.setMessage(value);\n }\n\n return this;\n }", "public void setId(Integer value) {\n this.id = value;\n }", "private void setProcessId(int value) {\n\t\tthis.processId = value;\n\t}", "private void setUserId(int value) {\n \n userId_ = value;\n }", "public void setValueId(Integer valueId) {\n this.valueId = valueId;\n }", "public void setValueId(Integer valueId) {\n this.valueId = valueId;\n }", "private void setObjId(int value) {\n \n objId_ = value;\n }", "private void setObjId(int value) {\n \n objId_ = value;\n }", "private void setObjId(int value) {\n \n objId_ = value;\n }", "private void setObjId(int value) {\n \n objId_ = value;\n }", "private void setObjId(int value) {\n \n objId_ = value;\n }", "private void setObjId(int value) {\n \n objId_ = value;\n }", "public void setId(long value) {\r\n this.id = value;\r\n }", "public void setId(long value) {\r\n this.id = value;\r\n }", "public void setId(long value) {\n this.id = value;\n }", "public void setId(long value) {\n this.id = value;\n }", "public void setId(long value) {\n this.id = value;\n }", "public void setId(long value) {\n this.id = value;\n }", "public void setId(long value) {\n this.id = value;\n }", "public void setId(long value) {\n this.id = value;\n }", "public void setId(long value) {\n this.id = value;\n }", "public void setTeamId(int value) {\n this.teamId = value;\n }", "void setNumber(int row, int col, int num){\n board[row][col].setNumber(num);\n }", "public void setId(Long value) {\r\n this.id = value;\r\n }", "public void setId(String value) {\n setAttributeInternal(ID, value);\n }", "public void setId(String value) {\n setAttributeInternal(ID, value);\n }", "public void setId(Long value) {\n this.id = value;\n }", "@Override\r\n\tpublic int updateBoard(Board board) {\n\t\treturn session.update(namespace+\"updateBoard\",board);\r\n\t}", "public void set(int x,int y) {\n\tif ( ! (board[x][y] == 9)) {\n\t board[x][y] = 1;\n\t}\n }", "public void setIdUser(int value) {\n this.idUser = value;\n }", "public void setRoomId(int value) {\n this.roomId = value;\n }", "private void setID(gw.pl.persistence.core.Key value) {\n __getInternalInterface().setFieldValue(ID_PROP.get(), value);\n }", "private void setID(gw.pl.persistence.core.Key value) {\n __getInternalInterface().setFieldValue(ID_PROP.get(), value);\n }", "private void setID(gw.pl.persistence.core.Key value) {\n __getInternalInterface().setFieldValue(ID_PROP.get(), value);\n }", "public void setRoomID(int value) {\n this.roomID = value;\n }", "void setID(int val)\n throws RemoteException;", "public Builder setForumId(\n io.dstore.values.IntegerValue.Builder builderForValue) {\n if (forumIdBuilder_ == null) {\n forumId_ = builderForValue.build();\n onChanged();\n } else {\n forumIdBuilder_.setMessage(builderForValue.build());\n }\n\n return this;\n }", "public void setRoomid(Integer newVal) {\n if ((newVal != null && this.roomid != null && (newVal.compareTo(this.roomid) == 0)) || \n (newVal == null && this.roomid == null && roomid_is_initialized)) {\n return; \n } \n this.roomid = newVal; \n roomid_is_modified = true; \n roomid_is_initialized = true; \n }", "public void setID(java.lang.Integer value);", "void setNumber (int col, int row, int number) {\n\t\tboardArray[col][row] = number;\n\t}", "public void setId(int newId) {\n roomId = newId;\n }", "@Override\r\n\tpublic void setCell(Integer x, Integer y, Integer value) {\n\t\tgame[x][y] = value;\r\n\t}", "void setPlayerId(int playerId);", "public void setId(String key, Object value) {\n // remove ID, if empty/0/null\n // if we only skipped it, the existing entry will stay although someone changed it to empty.\n String v = String.valueOf(value);\n if (\"\".equals(v) || \"0\".equals(v) || \"null\".equals(v)) {\n ids.remove(key);\n }\n else {\n ids.put(key, value);\n }\n firePropertyChange(key, null, value);\n\n // fire special events for our well known IDs\n if (Constants.TMDB.equals(key) || Constants.IMDB.equals(key) || Constants.TVDB.equals(key) || Constants.TRAKT.equals(key)) {\n firePropertyChange(key + \"Id\", null, value);\n }\n }", "public Builder setId(int value) {\n \n id_ = value;\n onChanged();\n return this;\n }", "public Builder setId(int value) {\n \n id_ = value;\n onChanged();\n return this;\n }", "public Builder setId(int value) {\n \n id_ = value;\n onChanged();\n return this;\n }" ]
[ "0.728176", "0.66532964", "0.6559913", "0.6559913", "0.644562", "0.6306331", "0.63056415", "0.62911683", "0.6276711", "0.61510044", "0.6145681", "0.60898846", "0.60155493", "0.60139483", "0.6011615", "0.5944357", "0.5944357", "0.5944357", "0.5944357", "0.5944357", "0.5944357", "0.5944357", "0.589285", "0.58711725", "0.5848988", "0.5835491", "0.5792988", "0.579079", "0.57807493", "0.5760245", "0.5759372", "0.5752016", "0.5739013", "0.5739013", "0.5739013", "0.5739013", "0.5739013", "0.5739013", "0.5739013", "0.5739013", "0.5739013", "0.57293946", "0.5722082", "0.57103235", "0.56736445", "0.5670848", "0.56603414", "0.5624074", "0.5609178", "0.5605921", "0.55987996", "0.5589308", "0.5589308", "0.55654144", "0.5552222", "0.5536905", "0.55137897", "0.55037606", "0.55037606", "0.55032736", "0.55032736", "0.55032736", "0.55032736", "0.55032736", "0.55032736", "0.55011857", "0.55011857", "0.54947174", "0.54947174", "0.54947174", "0.54947174", "0.54947174", "0.54947174", "0.54947174", "0.54757655", "0.54593116", "0.54413265", "0.5423981", "0.5423981", "0.5417874", "0.54158556", "0.5415237", "0.5402924", "0.5402773", "0.5391916", "0.5391916", "0.5391916", "0.53861284", "0.5374021", "0.53695786", "0.53572255", "0.5349687", "0.5339115", "0.53282154", "0.53251624", "0.5311032", "0.5309376", "0.5300656", "0.5300656", "0.5300656" ]
0.6036085
12
TODO Autogenerated method stub
@Override public void onNothingSelected(AdapterView<?> arg0) { }
{ "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 onNothingSelected(AdapterView<?> arg0) { }
{ "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
Updates grid data and refresh grid items.
public void setGridData(ArrayList<Photo> mGridData) { this.mGridData = mGridData; notifyDataSetChanged(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void reloadGridsData() {\n \n }", "private void updateAdapter() {\n iga = new IngredientGridAdapter(getApplicationContext(), ingredientList);\n gridView.setAdapter(iga);\n iga.notifyDataSetChanged();\n }", "public void updateComponents(){\n adapter.updateItems();\n }", "private void refresh() {\n updatePopulationInfo();\n\n // Update current production info\n updateProductionInfo();\n\n // Update the building grid\n updateBuildingInfo();\n\n // Update the warehouse display\n updateWarehouse();\n\n // Update the list of ships/carriers in port\n updateInPortInfo();\n\n // Update the list of cargo on the selected carrier\n updateCargoInfo();\n }", "private void refreshItem() {\n\t\tboundSwagForm.getField(\"isFetchOnly\").setValue(true);\r\n\t\tboundSwagForm.saveData(new DSCallback() {\r\n\t\t\t//reselect selected tile (call to saveData de-selects it)\r\n\t\t\tpublic void execute(DSResponse response,\r\n\t\t\t\t\tObject rawData, DSRequest request) {\r\n\t\t\t\t//get updated record\r\n\t\t\t\tfinal TileRecord rec = new TileRecord(request.getData());\r\n\t\t\t\t//Note: selectRecord seems to only work on the tile index\r\n\t\t\t\titemsTileGrid.selectRecord(itemsTileGrid.getRecordIndex(rec));\r\n\t\t\t\t//saveData adds tileRecord to the end.\r\n\t\t\t\t//make sure sort order is preserved\r\n\t\t\t\tdoSort();\r\n\t\t\t}});\r\n\t}", "public void update() {\r\n\t\tremoveAll();\r\n\t\tdrawGrid();\r\n\t\tplotDecades();\r\n\t\tgetEntries();\r\n\t}", "synchronized void refresh() {\n\n\t\t// We must not call fireTableDataChanged, because that would clear the\n\t\t// selection in the task window\n\t\tfireTableRowsUpdated(0, size - 1);\n\n\t}", "public void refresh() {\n\t\tgetData();\n\t\trender();\n\t}", "public void refreshData() {\n\n if (!mUpdatingData) {\n new RefreshStateDataTask().execute((Void) null);\n }\n }", "public void refreshData() {\r\n\t\tfireTableDataChanged();\r\n\t\tgetTable().tableChanged(new TableModelEvent(this));\r\n\t}", "public abstract void update(Grid theOldGrid, Grid theNewGrid);", "public void updateGridX();", "public void updateDataCell();", "@Override\n protected void onProgressUpdate(Integer... values) {\n super.onProgressUpdate(values);\n ((ArrayAdapter) gridView.getAdapter()).notifyDataSetChanged();\n }", "public void update() {\n\t\tfor (Entry<String, Integer> entry : countMap.entrySet()) {\n\t\t\tcountMap.put(entry.getKey(), 0);\n\t\t}\n\t\tfor (int i = 0; i < numRows; i++) {\n\t\t\tfor (int j = 0; j < numCols; j++) {\n\t\t\t\tCell c = newGrid[i][j];\n\t\t\t\tc.setRow(i);\n\t\t\t\tc.setCol(j);\n\t\t\t\tblocks[i][j].setFill(c.getColor());\n\t\t\t\tcurrentGrid[i][j] = newGrid[i][j];\n\t\t\t}\n\t\t}\n\t\tempty(newGrid);\n\t}", "public void refresh(){\n\n data2.clear();\n data2=getActionsList(\"\");\n //actionsAdapter=new ActionsAdapter(data2,getContext());\n //myList.setAdapter(actionsAdapter);\n //actionsAdapter.notifyDataSetChanged();\n }", "public void notifyDataSetChanged() {\n generateDataList();\n mSectionedExpandableGridAdapter.notifyDataSetChanged();\n }", "@Override\n public void onRefresh() {\n updateListings();\n new GetDataTask().execute();\n }", "public void processSnapToGrid() {\n dataManager.snapToGrid();\n }", "public abstract void refreshItem();", "public void refresh() {\n calcDataInTable();\n fireTableDataChanged();\n\n}", "public void updateData() {}", "public void setDataAndRefresh(List<T> data) {\n this.data = data;\n// views = new ArrayList<>(data.size());\n// // builder data set of all item view\n// for (int i = 0; i < data.size(); i++) {\n// int itemLayoutId = getItemLayoutId();\n// LayoutInflater inflater = LayoutInflater.from(getContext());\n// View itemView = inflater.inflate(itemLayoutId, null);\n// fillData(itemView, data.get(i));\n// // add item titleView\n// views.add(itemView);\n// }\n notifyDataSetChanged();\n }", "public void updategrid(int[][] grid) {\n this.grid = grid;\n }", "private void refreshData() {\n\r\n\t SfJdRecordFileModel model = (SfJdRecordFileModel) listCursor.getCurrentObject();\r\n\r\n\t if (model != null && !\"\".equals(ZcUtil.safeString(model.getModelId()))) {//列表页面双击进入\r\n\r\n\t this.pageStatus = ZcSettingConstants.PAGE_STATUS_BROWSE;\r\n\r\n\t model = getModel(model.getModelId());\r\n\t listCursor.setCurrentObject(model);\r\n\t this.setEditingObject(model);\r\n\t } else {//新增按钮进入\r\n\r\n\t this.pageStatus = ZcSettingConstants.PAGE_STATUS_NEW;\r\n\r\n\t model = new SfJdRecordFileModel();\r\n\t \r\n\t setDefaultValue(model);\r\n\r\n\t listCursor.getDataList().add(model);\r\n\r\n\t listCursor.setCurrentObject(model);\r\n\r\n\t this.setEditingObject(model);\r\n\r\n\t }\r\n\r\n\t refreshSubData();\r\n\t \r\n\t setOldObject();\r\n\r\n\t setButtonStatus();\r\n\r\n\t updateFieldEditorsEditable();\r\n\r\n\t }", "@FXML private void refreshData(){\n\t\tclearFields();\n\t\treadUsers();\n\t\tshowUsers();\n\t\trefreshInformationsFromTableView(null);\n\t}", "public void refresh(List<T> list) {\n this.items = list;\n notifyDataSetChanged();\n }", "private void updateWhereItemListData() {\n ModelWhereItem itemDB = new ModelWhereItem(database);\n ArrayList<WhereItem> itemList = itemDB.WSfindItemsByFields(selectedCityId,selectedDistrictId,selectedStreetId,selectedCategoryId);\n RecyclerViewAdapter recyclerViewAdapter = new RecyclerViewAdapter(getContext(),itemList,gridViewMenuAdapter,viewPagerSlideAdapter);\n recyclerView.setAdapter(recyclerViewAdapter);\n\n // tweaks cho recycler view\n recyclerView.setHasFixedSize(true);\n //recyclerView.setItemViewCacheSize(20);\n recyclerView.setDrawingCacheEnabled(true);\n //recyclerView.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH);\n\n changeTab(0);\n }", "private void updateUI() {\n swipeRefreshLayout.setRefreshing(false);\n adapter.clearItems();\n itemList.addAll(DatabaseController.getInstance(getApplicationContext()).getItems());\n if (itemList.size() > 0){\n emptyTextView.setVisibility(View.GONE);\n adapter.notifyDataSetChanged();\n } else {\n emptyTextView.setVisibility(View.VISIBLE);\n }\n }", "@Override\n public void refreshDataEntries() {\n }", "private void refreshData() {\n\t\tif (error == null) {\n\t\t\terror = \"\";\n\t\t}\n\t\terrorLabel.setText(error);\n\t\tif (error.trim().length() > 0) {\n\t\t\terror = \"\";\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Get instance of system\n\t\tFoodTruckManagementSystem ftms = FoodTruckManagementSystem.getInstance();\n\t\t\n\t\t// Populate info\n\t\tlblItemname.setText(item.getName());\n\t\tlblItemPrice.setText(String.format(\"$%.2f\", item.getPrice()/100.0));\n\t\t\n\t\t\n\t\t// Populate list\n\t\tString prev = supplyList.getSelectedValue();\n\t\tlistModel.clear();\n\t\tIterator<Supply> its = item.getSupplies().iterator();\n\t\tSupply current;\n\t\twhile(its.hasNext()) {\n\t\t\tcurrent = its.next();\n\t\t\tlistModel.addElement(String.format(\"%.20s %.2f\", current.getSupplyType().getName(), current.getQuantity()));\n\t\t}\n\t\tif(prev != null) supplyList.setSelectedValue(prev, true);\n\t\t\n\t\t// Populate combo box\n\t\tprev = (String) ingredientsComboBox.getSelectedItem();\n\t\tingredientsComboBox.removeAllItems();\n\t\tIterator<SupplyType> itst = ftms.getSupplyTypes().iterator();\n\t\twhile(itst.hasNext()) {\n\t\t\tingredientsComboBox.addItem(itst.next().getName());\n\t\t}\n\t\tif(prev != null) ingredientsComboBox.setSelectedItem(prev);\n\t\t\n\t\t// Reset text field\n\t\tqtyTextField.setText(\"\");\n\t}", "void updateData();", "public void reloadData() {\n\t\tinitializeStormData();\n\t\tsuper.reloadData();\n\t}", "public void update(){\r\n\t\tthis.loadRecords();\r\n\t}", "public void updateProducts()\n {\n ObservableList<Product> inventoryProducts = this.inventory.getAllProducts();\n\n // Configure product table and bind with inventory products\n productIDColumn.setCellValueFactory(new PropertyValueFactory<Product, String>(\"id\"));\n productNameColumn.setCellValueFactory(new PropertyValueFactory<Product, String>(\"name\"));\n productInventoryColumn.setCellValueFactory(new PropertyValueFactory<Product, String>(\"stock\"));\n productPriceColumn.setCellValueFactory(new PropertyValueFactory<Product, String>(\"price\"));\n\n productTable.setItems(inventoryProducts);\n // Unselect parts in table after part is updated\n productTable.getSelectionModel().clearSelection();\n productTable.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);\n }", "public void notifyDataSetChanged() {\n viewState.setShouldRefreshEvents(true);\n invalidate();\n }", "public void refresh()\n\t{\n\t\tLogger.debug(\"Updating executors table\", Level.GUI, this);\n\t\tm_executorsTable.refreshAll();\n\t\tupdateButtons();\n\t}", "private void update()\n {\n\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n //System.out.println(\"UPDATE\");\n updateHumanPlayerMoney();\n updateListViewDoctorItems();\n updateListViewHospitalItems();\n updateListViewLogWindow();\n updateListViewComputerPlayer();\n load_figure();\n updateComputerPlayerMoney();\n }\n });\n }", "private void updateAll() {\n updateAction();\n updateQueryViews();\n }", "private void updateGrid() {\n\t\tfor (Neighbor neighbor : upsetNeighbors) {\n\t\t\tClear vacated_cell = new Clear(neighbor.getCoordsX(), neighbor.getCoordsY());\n\t\t\tgrid.setGridIndex(vacated_cell, vacated_cell.getCoordsX(), vacated_cell.getCoordsY());\n\t\t\tCell new_location = availableSpaces.get((int) (Math.random() * (availableSpaces.size() - 1)));\n\t\t\tint new_x = new_location.getCoordsX();\n\t\t\tint new_y = new_location.getCoordsY();\n\t\t\tif (neighbor.getClass().equals(Group1.class))\n\t\t\t\tgrid.setGridIndex(new Group1(new_x, new_y, percentSimilar), new_x, new_y);\n\t\t\telse\n\t\t\t\tgrid.setGridIndex(new Group2(new_x, new_y, percentSimilar), new_x, new_y);\n\t\t\tavailableSpaces.remove(new_location);\n\t\t\tavailableSpaces.add(vacated_cell);\n\t\t}\n\t}", "@Override\n public void onRefresh() {\n refreshData();\n }", "@Override\n\tpublic void refreshData(){\n\t\tpageNum = 1;\n\t\tlist.clear();\n\t\tloadData();\n\t}", "public void refresh() {\r\n\t\tneeds.setText(needs());\r\n\t\tproduction.setText(production());\r\n\t\tjobs.setText(jobs());\r\n\t\tmarketPrices.setText(marketPrices());\r\n\t\tmarketSellAmounts.setText(marketSellAmounts());\r\n\t\tmarketBuyAmounts.setText(marketBuyAmounts());\r\n\t\tcompanies.setText(companies());\r\n\t\tmoney.setText(money());\r\n\t\ttileProduction.setText(tileProduction());\r\n\t\tcapital.setText(capital());\r\n\t\thappiness.setText(happiness());\r\n\t\tland.setText(land());\r\n\t\t//ArrayList of Agents sorted from lowest to highest in money is retrieved from Tile\r\n\t\tagents=tile.getAgentsByMoney();\r\n\t\tgui3.refresh();\r\n\t\tsliderPerson.setText(\"\"+agents.get(slider.getValue()).getMoney());\r\n\t\ttick.setText(tick());\r\n\t\tthis.pack();\r\n\t}", "@Override\n\tpublic void refresh() {\n\t\tSwingUtilities.invokeLater(new Runnable() {\n\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\t// Create local copy so table not backed by map ensuring thread\n\t\t\t\t// safety. This is done as an alternative to locking customers\n\t\t\t\t// whilst refreshing due to the reduced time the lock is required.\n\t\t\t\tCollection<Customer> customers;\n\t\t\t\tsynchronized (model.customers) {\n\t\t\t\t\t// Convert collection of values to set so serialisable\n\t\t\t\t\tfinal Set<Customer> modelCustomers = new HashSet<>(model.customers.values());\n\t\t\t\t\t// Cast safe due to known functionality of deep clone\n\t\t\t\t\tcustomers = (Collection<Customer>) SerializationUtils.deepClone(modelCustomers);\n\t\t\t\t}\n\t\t\t\t// Refresh using local copy\n\t\t\t\trefreshTable(new ArrayList<>(customers));\n\t\t\t}\n\t\t});\n\t}", "private void refreshTableForUpdate()\n {\n //Was updating the values but don't believe this is necessary, as like budget items\n //a loss amount will stay the same unless changed by the user (later on it might be the\n //case that it can increase/decrease by a percentage but not now...)\n /*\n BadBudgetData bbd = ((BadBudgetApplication) this.getApplication()).getBadBudgetUserData();\n for (MoneyLoss loss : bbd.getLosses())\n {\n TextView valueView = valueViews.get(loss.expenseDescription());\n valueView.setText(BadBudgetApplication.roundedDoubleBB(loss.lossAmount()));\n }\n */\n }", "public void updateParts()\n {\n ObservableList<Part> inventoryParts = this.inventory.getAllParts();\n\n // Configure part table and bind with inventory parts\n partIDColumn.setCellValueFactory(new PropertyValueFactory<Part,String>(\"id\"));\n partNameColumn.setCellValueFactory(new PropertyValueFactory<Part, String>(\"name\"));\n partInventoryColumn.setCellValueFactory(new PropertyValueFactory<Part, String>(\"stock\"));\n partCostColumn.setCellValueFactory(new PropertyValueFactory<Part, String>(\"price\"));\n\n partTable.setItems(inventory.getAllParts());\n // Unselect parts in table after part is deleted\n partTable.getSelectionModel().clearSelection();\n partTable.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);\n }", "public void reload(){\n populateList();\n }", "private void refreshTable() {\n data = getTableData();\n updateTable();\n }", "public void refreshList() {\n mCursor.requery();\n mCount = mCursor.getCount() + mExtraOffset;\n notifyDataSetChanged();\n }", "public void refreshList()\n {\n final ArrayAdapter adapter = (ArrayAdapter)this.foodListAdapter;\n this.getActivity().runOnUiThread(new Runnable() {\n public void run() {\n adapter.notifyDataSetChanged();\n }\n });\n }", "public void updateLinesAndGrid() {\n\t\tutilities.redrawAllLines(0, false);\n\t\ttableDisplay.setGrid(utilities.getOrderedWayPoints());\n\t}", "@Override\n public void onRefresh() {\n loadData();\n }", "public void notifyChanged() {\n notifyDataSetChanged();\n }", "public void updateDataComp() {\n\t\tdataEntryDao.updateDataComp();\n\t}", "private void updateUI() {\n mLatestFeedsAdapter.notifyDataSetChanged();\n }", "public void refresh() {\n\t\tscroll.refresh();\n\n\t}", "public void refresh() {\n\t\tgetTableViewer().refresh();\n\t}", "public void update()\n\t{\n\t\t//update the view's list of movies...\n\t\tthis.getRemoveButton().setEnabled((this.database.getNumberOfMovies()>0));\n\t\tthis.movieList.setListData(this.database.toList());\n\t}", "public void refresh(List<DataFeed> newData) {\n clear();\n addAll(newData);\n notifyDataSetChanged();\n }", "public void refresh() {\n }", "protected void refresh() {\n\t}", "public void update() {\n manager.update();\n }", "public void imageUpdate() {\n this.notifyDataSetChanged();\n }", "public void notifyDataSetChanged() {\n if (noxItemCatalog != null) {\n noxItemCatalog.recreate();\n createShape();\n initializeScroller();\n refreshView();\n }\n }", "@Override\r\n\tpublic void updateData() {\n\t\t\r\n\t}", "public void updateData(List<AddingTopItem> mList){\n mData.clear();\n mData.addAll(mList);\n this.notifyDataSetChanged();\n }", "private void updateList() {\n Model.instace.getAllArticles(new ArticleFirebase.GetAllArticlesAndObserveCallback() {\n @Override\n public void onComplete(List<Article> list) {\n data.clear();\n data = list;\n adapter.notifyDataSetChanged();\n }\n\n @Override\n public void onCancel() {\n\n }\n });\n }", "public void refresh() {\n \t\n /* Attach a rotating ImageView to the refresh item as an ActionView */\n LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n ImageView iv = (ImageView) inflater.inflate(R.layout.refresh_action_view, null);\n\n Animation rotation = AnimationUtils.loadAnimation(mContext, R.anim.clockwise_refresh);\n rotation.setRepeatCount(Animation.INFINITE);\n iv.startAnimation(rotation);\n\n mSGV.setVisibility(View.INVISIBLE);\n mProgress.setVisibility(View.VISIBLE);\n \n mRefreshItem.setActionView(iv);\n refreshGoodsItems();\n \n }", "private void refreshList() {\n List<PullRequest> storedPullRequests = mDataManager.getPullRequests();\n\n mPullRequests.clear();\n\n for (PullRequest pullRequest : storedPullRequests) {\n mPullRequests.add(pullRequest);\n }\n\n mAdapter.notifyDataSetChanged();\n\n mDialog.dismiss();\n }", "public void refresh() {\n\t\tdisp.refresh();\n\t\tdisp.repaint();\n\t}", "protected void updateSummaries() { }", "protected void updateSummaries() { }", "public void reload() {\n waiterNotifications.clear();\n waiterNotifications.addAll(Local.getInstance().getWaiterNotificationList());\n notifyDataSetChanged();\n\n }", "public void update() {\n\t\tremoveAll();\n\t\tdrawGraph();\n\t\tplotEntries();\n\t}", "protected void refresh()\n {\n refresh(System.currentTimeMillis());\n }", "private void refreshData() {\n // Prevent unnecessary refresh.\n if (mRefreshDataRequired) {\n // Mark all entries in the contact info cache as out of date, so\n // they will be looked up again once being shown.\n mAdapter.invalidateCache();\n fetchCalls();\n mRefreshDataRequired = false;\n }\n }", "public void updateGrid() {\n\t\tfor (int row = 0; row < Sudoku.ROWS; row++ ) {\n\t\t\tfor (int col = 0; col < Sudoku.COLUMNS; col++) {\n\t\t\t\tVariable var = Sudoku.grid[row][col];\n\t\t\t\tif (!var.isFound() && var.domain.size() == 1) {\n\t\t\t\t\tvar.setValue(var.domain.get(0)); // only one value available in domain\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void update() {\n // Set for each cell\n for (Cell cell : this.view.getGamePanel().getViewCellList()) {\n cell.setBackground(BKGD_DARK_GRAY);\n cell.setForeground(Color.WHITE);\n cell.setFont(new Font(\"Halvetica Neue\", Font.PLAIN, 36));\n cell.setBorder(new LineBorder(Color.BLACK, 0));\n cell.setHorizontalAlignment(JTextField.CENTER);\n cell.setCaretColor(new Color(32, 44, 53));\n cell.setDragEnabled(false);\n cell.setTransferHandler(null);\n\n // Add subgrid separators\n CellPosition pos = cell.getPosition();\n if (pos.getColumn() == 2 || pos.getColumn() == 5) {\n cell.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 2, new Color(146, 208, 80)));\n } else if (pos.getRow() == 2 || pos.getRow() == 5) {\n cell.setBorder(BorderFactory.createMatteBorder(0, 0, 2, 0, new Color(146, 208, 80)));\n }\n if ((pos.getColumn() == 2 && pos.getRow() == 2) || (pos.getColumn() == 5 && pos.getRow() == 5)\n || (pos.getColumn() == 2 && pos.getRow() == 5) || (pos.getColumn() == 5 && pos.getRow() == 2)) {\n cell.setBorder(BorderFactory.createMatteBorder(0, 0, 2, 2, new Color(146, 208, 80)));\n }\n\n // Validate User's Cell Input + Mouse Listeners\n cell.removeKeyListener(cellKeyListener);\n cell.removeMouseListener(cellMouseListener);\n if (cell.isLocked()) {\n cell.setEditable(false);\n cell.setHighlighter(null);\n } else {\n cell.setBackground(BKGD_LIGHT_GRAY);\n cell.addMouseListener(cellMouseListener);\n cell.addKeyListener(cellKeyListener);\n }\n if (cell.isEmpty()) {\n cell.setText(\"\");\n } else {\n cell.setText(String.valueOf(cell.getUserValue()));\n }\n\n // Adds cell to the view's grid\n this.view.getGamePanel().getGrid().add(cell);\n }\n\n }", "public void refreshDatas(GsonNews requestNews){\n if (newsItems != null){\n Log.e(\"xx\", \"suaxinshuju\");\n// newsItems.setAdapter(newsAdapter);\n newsAdapter.setItems(requestNews.getData());\n// newsAdapter.notifyDataSetChanged();\n }\n }", "public void refreshListView() {\n if (recyclerViewAdapter != null) {\n recyclerViewAdapter.notifyDataSetChanged();\n }\n }", "private void updateItems()\n\t{\t\n\t\tupdatePizzaTypes(items);\n\t\tupdateSidesTypes(items);\n\t\tupdateDrinksTypes(items);\n\t}", "public void run() {\n updateBtn.reset();\n notifyDataSetChanged();\n }", "@Override\n public void onRefresh() {\n getData();\n }", "public void refreshAdapter() {\n\t\tadapter.notifyDataSetChanged();\n\t\tthis.listView.onRefreshComplete();\n\t}", "public void updateContent(){\r\n\t\tthis.initRecords();\r\n\t\tlist.show(records);\r\n\t}", "private void refreshScreen() {\n app.getMainMenu().getTextField().clear();\n for (int key = 0; key < 96; key++) {\n app.getWorkSpace().getGridCell(key).unhighlightGridCell();\n app.getWorkSpace().getGridCell(key).updateState(app);\n }\n Storage.getInstance().writeObject(\"workspace\", app.getWorkSpace().getWorkSpaceMap());\n app.show();\n }", "public abstract void refreshing();", "private void refreshData(){\n filempty.setVisibility(View.GONE);\n adapter = new FoundRecyclerviewAdapter(FoundActivity.this, data);\n v.setAdapter(adapter);\n emptyView();\n }", "public void refreshAll() {\n\t\tdrawingPanel.repaint();\n\t}", "private void refreshList() {\n\n Requester.getInstance().cancelPendingRequests(BrowseCoursesNew.TAG);\n mWishListAdapter.clearData();\n\n refreshView();\n\n wishCourses = new WishCourses(mHandler);\n wishCourses.sendWishlistCoursesRequest();\n }", "private void refreshData(){\n Log.d(LOG_TAG, \"refreshData()\");\n mRVAdapter.setData(null);\n loadData();\n }", "public void refreshDataSource(ArrayList<Restroom> newSource){\n\t\tRestroomList = newSource;\n\t\tnotifyDataSetChanged();\n\t}", "public void refreshAll() {\n}", "@Override\n\tpublic void notifyDataSetChanged() {\n\t\tsuper.notifyDataSetChanged();\n\t\tsetIndexer(list);\n\t}", "public void refreshLists() {\n refreshCitizenList();\n refreshPlayerList();\n }", "public void refresh() {\n\n // Show message if theNews are empty\n if (this.theNews.getValue() == null || this.theNews.getValue().size() == 0) {\n log.warn(\"No news, fetching from contracts...\");\n }\n\n // Background thread\n\n {\n Executors.newSingleThreadExecutor()\n .execute(\n () -> {\n List<News> news = this.contracts.retrieveNews(50);\n\n // GUI thread\n new Handler(Looper.getMainLooper())\n .post(\n () -> {\n this.theNews.setValue(news);\n });\n });\n }\n }", "@Override\n\tpublic void update(DhtmlxGridForm f) throws Exception {\n\t\t\n\t}", "private void populateGrid()\n\t{\n\t\tif(mApps == null || mApps.size() == 0)\n\t\t\treturn;\n\t\t\n\t\tmGrid = (GridView) findViewById(R.id.appGrid);\n\t\tmAdapter = new RequestAdapter(this, mApps);\n\t\tmGrid.setAdapter(mAdapter);\n\n\t\t// Set basic listener to your ListView\n\t\tmGrid.setOnItemClickListener(new OnItemClickListener () {\n\t\t\t@Override\n\t\t\tpublic void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\t\t\t\t// Mark the app as selected\n\t\t\t\tAppInfo mApp = mApps.get(position);\n\t\t\t\tmApp.setSelected(!mApp.isSelected());\n\t\t\t\tmApps.set(position, mApp);\n\t\t\t\t\n\t\t\t\t// Let the adapter know you selected something\n\t\t\t\tmAdapter.notifyDataSetChanged();\n\t\t\t}\n\t\t});\n\t}", "private void update()\n {\n // update the grid square panels\n Component[] components = pnlIsland.getComponents();\n for ( Component c : components )\n {\n // all components in the panel are GridSquarePanels,\n // so we can safely cast\n GridSquarePanel gsp = (GridSquarePanel) c;\n gsp.update();\n }\n \n // update player information\n int[] playerValues = game.getPlayerValues();\n txtPlayerName.setText(game.getPlayerName());\n progPlayerStamina.setMaximum(playerValues[Game.MAXSTAMINA_INDEX]);\n progPlayerStamina.setValue(playerValues[Game.STAMINA_INDEX]);\n progBackpackWeight.setMaximum(playerValues[Game.MAXWEIGHT_INDEX]);\n progBackpackWeight.setValue(playerValues[Game.WEIGHT_INDEX]);\n progBackpackSize.setMaximum(playerValues[Game.MAXSIZE_INDEX]);\n progBackpackSize.setValue(playerValues[Game.SIZE_INDEX]);\n \n //Update Kiwi and Predator information\n txtKiwisCounted.setText(Integer.toString(game.getKiwiCount()) );\n txtPredatorsLeft.setText(Integer.toString(game.getPredatorsRemaining()));\n \n // update inventory list\n listInventory.setListData(game.getPlayerInventory());\n listInventory.clearSelection();\n listInventory.setToolTipText(null);\n btnUse.setEnabled(false);\n btnDrop.setEnabled(false);\n \n // update list of visible objects\n listObjects.setListData(game.getOccupantsPlayerPosition());\n listObjects.clearSelection();\n listObjects.setToolTipText(null);\n btnCollect.setEnabled(false);\n btnCount.setEnabled(false);\n \n // update movement buttons\n btnMoveNorth.setEnabled(game.isPlayerMovePossible(MoveDirection.NORTH));\n btnMoveEast.setEnabled( game.isPlayerMovePossible(MoveDirection.EAST));\n btnMoveSouth.setEnabled(game.isPlayerMovePossible(MoveDirection.SOUTH));\n btnMoveWest.setEnabled( game.isPlayerMovePossible(MoveDirection.WEST));\n }", "void refresh(Collection<? extends BaseModel> objects);", "public void refresh()\n {\n refresh( null );\n }" ]
[ "0.77883905", "0.70579016", "0.68671983", "0.68004996", "0.67056024", "0.6591687", "0.655834", "0.65033853", "0.6499551", "0.6495271", "0.64850724", "0.64824104", "0.64703023", "0.6426632", "0.641878", "0.6359362", "0.63475114", "0.6345846", "0.6344354", "0.6342783", "0.6340937", "0.6321502", "0.63185376", "0.631316", "0.629249", "0.6282041", "0.62814426", "0.6270894", "0.6226833", "0.62247956", "0.62038183", "0.62024295", "0.61973226", "0.6187898", "0.61878705", "0.6178439", "0.6159878", "0.615572", "0.61401516", "0.61299634", "0.61241966", "0.6121402", "0.6120039", "0.6095671", "0.60912186", "0.60831535", "0.6062176", "0.6025528", "0.5980492", "0.5975528", "0.5974547", "0.59686905", "0.59664524", "0.59497225", "0.59470236", "0.5945052", "0.59370583", "0.5936505", "0.5934265", "0.5932241", "0.59300095", "0.5912188", "0.5910253", "0.5905515", "0.5904844", "0.59034574", "0.58947366", "0.5893431", "0.5892425", "0.589077", "0.589043", "0.589043", "0.5889083", "0.5886956", "0.5886912", "0.58824515", "0.58764124", "0.5872006", "0.5864948", "0.58566904", "0.5847951", "0.5840627", "0.5839044", "0.5837488", "0.58251905", "0.5811588", "0.58102745", "0.5806664", "0.58052546", "0.58046335", "0.58004713", "0.57977855", "0.57933277", "0.57930404", "0.5790653", "0.5781701", "0.5778022", "0.5777477", "0.57757616", "0.5769432", "0.57619745" ]
0.0
-1
this will be called from RFImageActivity
public void addImageToView(String imagePath) { ImageMeta newImageMeta = new ImageMeta(); newImageMeta.fullImagePath = imagePath; String thumbnail = getThumbNailImage(imagePath); String[] tokens = thumbnail.split(saperator); newImageMeta.thumbnailImagePath = tokens[0]; newImageMeta.thumbnail64 = tokens[1]; newImageMeta.awsPath = null; fieldImages.add(newImageMeta); reRenderImageList(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void onImageAvailable(android.media.ImageReader r15) {\n /*\n r14 = this;\n com.android.camera.imageprocessor.FrameProcessor r0 = com.android.camera.imageprocessor.FrameProcessor.this\n java.lang.Object r0 = r0.mAllocationLock\n monitor-enter(r0)\n com.android.camera.imageprocessor.FrameProcessor r1 = com.android.camera.imageprocessor.FrameProcessor.this // Catch:{ all -> 0x0172 }\n android.renderscript.Allocation r1 = r1.mOutputAllocation // Catch:{ all -> 0x0172 }\n if (r1 != 0) goto L_0x0011\n monitor-exit(r0) // Catch:{ all -> 0x0172 }\n return\n L_0x0011:\n android.media.Image r15 = r15.acquireLatestImage() // Catch:{ IllegalStateException -> 0x0170 }\n if (r15 != 0) goto L_0x0019\n monitor-exit(r0) // Catch:{ all -> 0x0172 }\n return\n L_0x0019:\n com.android.camera.imageprocessor.FrameProcessor r1 = com.android.camera.imageprocessor.FrameProcessor.this // Catch:{ IllegalStateException -> 0x0170 }\n boolean r1 = r1.mIsActive // Catch:{ IllegalStateException -> 0x0170 }\n if (r1 != 0) goto L_0x0026\n r15.close() // Catch:{ IllegalStateException -> 0x0170 }\n monitor-exit(r0) // Catch:{ all -> 0x0172 }\n return\n L_0x0026:\n com.android.camera.imageprocessor.FrameProcessor r1 = com.android.camera.imageprocessor.FrameProcessor.this // Catch:{ IllegalStateException -> 0x0170 }\n r2 = 1\n r1.mIsAllocationEverUsed = r2 // Catch:{ IllegalStateException -> 0x0170 }\n android.media.Image$Plane[] r1 = r15.getPlanes() // Catch:{ IllegalStateException -> 0x0170 }\n r3 = 0\n r1 = r1[r3] // Catch:{ IllegalStateException -> 0x0170 }\n java.nio.ByteBuffer r1 = r1.getBuffer() // Catch:{ IllegalStateException -> 0x0170 }\n android.media.Image$Plane[] r4 = r15.getPlanes() // Catch:{ IllegalStateException -> 0x0170 }\n r5 = 2\n r4 = r4[r5] // Catch:{ IllegalStateException -> 0x0170 }\n java.nio.ByteBuffer r11 = r4.getBuffer() // Catch:{ IllegalStateException -> 0x0170 }\n byte[] r4 = r14.yvuBytes // Catch:{ IllegalStateException -> 0x0170 }\n if (r4 == 0) goto L_0x0062\n int r4 = r14.width // Catch:{ IllegalStateException -> 0x0170 }\n com.android.camera.imageprocessor.FrameProcessor r6 = com.android.camera.imageprocessor.FrameProcessor.this // Catch:{ IllegalStateException -> 0x0170 }\n android.util.Size r6 = r6.mSize // Catch:{ IllegalStateException -> 0x0170 }\n int r6 = r6.getWidth() // Catch:{ IllegalStateException -> 0x0170 }\n if (r4 != r6) goto L_0x0062\n int r4 = r14.height // Catch:{ IllegalStateException -> 0x0170 }\n com.android.camera.imageprocessor.FrameProcessor r6 = com.android.camera.imageprocessor.FrameProcessor.this // Catch:{ IllegalStateException -> 0x0170 }\n android.util.Size r6 = r6.mSize // Catch:{ IllegalStateException -> 0x0170 }\n int r6 = r6.getHeight() // Catch:{ IllegalStateException -> 0x0170 }\n if (r4 == r6) goto L_0x009e\n L_0x0062:\n android.media.Image$Plane[] r4 = r15.getPlanes() // Catch:{ IllegalStateException -> 0x0170 }\n r4 = r4[r3] // Catch:{ IllegalStateException -> 0x0170 }\n int r4 = r4.getRowStride() // Catch:{ IllegalStateException -> 0x0170 }\n r14.stride = r4 // Catch:{ IllegalStateException -> 0x0170 }\n com.android.camera.imageprocessor.FrameProcessor r4 = com.android.camera.imageprocessor.FrameProcessor.this // Catch:{ IllegalStateException -> 0x0170 }\n android.util.Size r4 = r4.mSize // Catch:{ IllegalStateException -> 0x0170 }\n int r4 = r4.getWidth() // Catch:{ IllegalStateException -> 0x0170 }\n r14.width = r4 // Catch:{ IllegalStateException -> 0x0170 }\n com.android.camera.imageprocessor.FrameProcessor r4 = com.android.camera.imageprocessor.FrameProcessor.this // Catch:{ IllegalStateException -> 0x0170 }\n android.util.Size r4 = r4.mSize // Catch:{ IllegalStateException -> 0x0170 }\n int r4 = r4.getHeight() // Catch:{ IllegalStateException -> 0x0170 }\n r14.height = r4 // Catch:{ IllegalStateException -> 0x0170 }\n int r4 = r14.stride // Catch:{ IllegalStateException -> 0x0170 }\n com.android.camera.imageprocessor.FrameProcessor r6 = com.android.camera.imageprocessor.FrameProcessor.this // Catch:{ IllegalStateException -> 0x0170 }\n android.util.Size r6 = r6.mSize // Catch:{ IllegalStateException -> 0x0170 }\n int r6 = r6.getHeight() // Catch:{ IllegalStateException -> 0x0170 }\n int r4 = r4 * r6\n r14.ySize = r4 // Catch:{ IllegalStateException -> 0x0170 }\n int r4 = r14.ySize // Catch:{ IllegalStateException -> 0x0170 }\n int r4 = r4 * 3\n int r4 = r4 / r5\n byte[] r4 = new byte[r4] // Catch:{ IllegalStateException -> 0x0170 }\n r14.yvuBytes = r4 // Catch:{ IllegalStateException -> 0x0170 }\n L_0x009e:\n com.android.camera.imageprocessor.FrameProcessor r4 = com.android.camera.imageprocessor.FrameProcessor.this // Catch:{ IllegalStateException -> 0x0170 }\n java.util.ArrayList r4 = r4.mPreviewFilters // Catch:{ IllegalStateException -> 0x0170 }\n java.util.Iterator r12 = r4.iterator() // Catch:{ IllegalStateException -> 0x0170 }\n r13 = r3\n L_0x00a9:\n boolean r4 = r12.hasNext() // Catch:{ IllegalStateException -> 0x0170 }\n if (r4 == 0) goto L_0x0128\n java.lang.Object r4 = r12.next() // Catch:{ IllegalStateException -> 0x0170 }\n r5 = r4\n com.android.camera.imageprocessor.filter.ImageFilter r5 = (com.android.camera.imageprocessor.filter.ImageFilter) r5 // Catch:{ IllegalStateException -> 0x0170 }\n boolean r4 = r5.isFrameListener() // Catch:{ IllegalStateException -> 0x0170 }\n if (r4 == 0) goto L_0x00f0\n com.android.camera.imageprocessor.FrameProcessor r4 = com.android.camera.imageprocessor.FrameProcessor.this // Catch:{ IllegalStateException -> 0x0170 }\n com.android.camera.imageprocessor.FrameProcessor$ListeningTask r4 = r4.mListeningTask // Catch:{ IllegalStateException -> 0x0170 }\n com.android.camera.imageprocessor.FrameProcessor r6 = com.android.camera.imageprocessor.FrameProcessor.this // Catch:{ IllegalStateException -> 0x0170 }\n android.util.Size r6 = r6.mSize // Catch:{ IllegalStateException -> 0x0170 }\n int r8 = r6.getWidth() // Catch:{ IllegalStateException -> 0x0170 }\n com.android.camera.imageprocessor.FrameProcessor r6 = com.android.camera.imageprocessor.FrameProcessor.this // Catch:{ IllegalStateException -> 0x0170 }\n android.util.Size r6 = r6.mSize // Catch:{ IllegalStateException -> 0x0170 }\n int r9 = r6.getHeight() // Catch:{ IllegalStateException -> 0x0170 }\n int r10 = r14.stride // Catch:{ IllegalStateException -> 0x0170 }\n r6 = r1\n r7 = r11\n boolean r4 = r4.setParam(r5, r6, r7, r8, r9, r10) // Catch:{ IllegalStateException -> 0x0170 }\n if (r4 == 0) goto L_0x0121\n com.android.camera.imageprocessor.FrameProcessor r4 = com.android.camera.imageprocessor.FrameProcessor.this // Catch:{ IllegalStateException -> 0x0170 }\n android.os.Handler r4 = r4.mListeningHandler // Catch:{ IllegalStateException -> 0x0170 }\n com.android.camera.imageprocessor.FrameProcessor r5 = com.android.camera.imageprocessor.FrameProcessor.this // Catch:{ IllegalStateException -> 0x0170 }\n com.android.camera.imageprocessor.FrameProcessor$ListeningTask r5 = r5.mListeningTask // Catch:{ IllegalStateException -> 0x0170 }\n r4.post(r5) // Catch:{ IllegalStateException -> 0x0170 }\n goto L_0x0121\n L_0x00f0:\n com.android.camera.imageprocessor.FrameProcessor r4 = com.android.camera.imageprocessor.FrameProcessor.this // Catch:{ IllegalStateException -> 0x0170 }\n android.util.Size r4 = r4.mSize // Catch:{ IllegalStateException -> 0x0170 }\n int r4 = r4.getWidth() // Catch:{ IllegalStateException -> 0x0170 }\n com.android.camera.imageprocessor.FrameProcessor r6 = com.android.camera.imageprocessor.FrameProcessor.this // Catch:{ IllegalStateException -> 0x0170 }\n android.util.Size r6 = r6.mSize // Catch:{ IllegalStateException -> 0x0170 }\n int r6 = r6.getHeight() // Catch:{ IllegalStateException -> 0x0170 }\n int r7 = r14.stride // Catch:{ IllegalStateException -> 0x0170 }\n int r8 = r14.stride // Catch:{ IllegalStateException -> 0x0170 }\n r5.init(r4, r6, r7, r8) // Catch:{ IllegalStateException -> 0x0170 }\n boolean r4 = r5 instanceof com.android.camera.imageprocessor.filter.BeautificationFilter // Catch:{ IllegalStateException -> 0x0170 }\n if (r4 == 0) goto L_0x0118\n java.lang.Boolean r4 = new java.lang.Boolean // Catch:{ IllegalStateException -> 0x0170 }\n r4.<init>(r3) // Catch:{ IllegalStateException -> 0x0170 }\n r5.addImage(r1, r11, r3, r4) // Catch:{ IllegalStateException -> 0x0170 }\n goto L_0x0120\n L_0x0118:\n java.lang.Boolean r4 = new java.lang.Boolean // Catch:{ IllegalStateException -> 0x0170 }\n r4.<init>(r2) // Catch:{ IllegalStateException -> 0x0170 }\n r5.addImage(r1, r11, r3, r4) // Catch:{ IllegalStateException -> 0x0170 }\n L_0x0120:\n r13 = r2\n L_0x0121:\n r1.rewind() // Catch:{ IllegalStateException -> 0x0170 }\n r11.rewind() // Catch:{ IllegalStateException -> 0x0170 }\n goto L_0x00a9\n L_0x0128:\n com.android.camera.imageprocessor.FrameProcessor r2 = com.android.camera.imageprocessor.FrameProcessor.this // Catch:{ IllegalStateException -> 0x0170 }\n boolean r2 = r2.mIsFirstIn // Catch:{ IllegalStateException -> 0x0170 }\n if (r2 == 0) goto L_0x014e\n com.android.camera.imageprocessor.FrameProcessor r2 = com.android.camera.imageprocessor.FrameProcessor.this // Catch:{ IllegalStateException -> 0x0170 }\n boolean r2 = r2.mIsVideoOn // Catch:{ IllegalStateException -> 0x0170 }\n if (r2 == 0) goto L_0x014e\n com.android.camera.imageprocessor.FrameProcessor r2 = com.android.camera.imageprocessor.FrameProcessor.this // Catch:{ IllegalStateException -> 0x0170 }\n boolean r2 = r2.isFrameListnerEnabled() // Catch:{ IllegalStateException -> 0x0170 }\n if (r2 == 0) goto L_0x014e\n com.android.camera.imageprocessor.FrameProcessor r2 = com.android.camera.imageprocessor.FrameProcessor.this // Catch:{ IllegalStateException -> 0x0170 }\n r2.mIsFirstIn = r3 // Catch:{ IllegalStateException -> 0x0170 }\n com.android.camera.imageprocessor.FrameProcessor r2 = com.android.camera.imageprocessor.FrameProcessor.this // Catch:{ IllegalStateException -> 0x0170 }\n com.android.camera.CaptureModule r2 = r2.mModule // Catch:{ IllegalStateException -> 0x0170 }\n r2.startMediaRecording() // Catch:{ IllegalStateException -> 0x0170 }\n L_0x014e:\n if (r13 == 0) goto L_0x016d\n byte[] r2 = r14.yvuBytes // Catch:{ IllegalStateException -> 0x0170 }\n int r4 = r1.remaining() // Catch:{ IllegalStateException -> 0x0170 }\n r1.get(r2, r3, r4) // Catch:{ IllegalStateException -> 0x0170 }\n byte[] r1 = r14.yvuBytes // Catch:{ IllegalStateException -> 0x0170 }\n int r2 = r14.ySize // Catch:{ IllegalStateException -> 0x0170 }\n int r3 = r11.remaining() // Catch:{ IllegalStateException -> 0x0170 }\n r11.get(r1, r2, r3) // Catch:{ IllegalStateException -> 0x0170 }\n com.android.camera.imageprocessor.FrameProcessor r1 = com.android.camera.imageprocessor.FrameProcessor.this // Catch:{ IllegalStateException -> 0x0170 }\n android.os.Handler r1 = r1.mOutingHandler // Catch:{ IllegalStateException -> 0x0170 }\n r1.post(r14) // Catch:{ IllegalStateException -> 0x0170 }\n L_0x016d:\n r15.close() // Catch:{ IllegalStateException -> 0x0170 }\n L_0x0170:\n monitor-exit(r0) // Catch:{ all -> 0x0172 }\n return\n L_0x0172:\n r14 = move-exception\n monitor-exit(r0) // Catch:{ all -> 0x0172 }\n throw r14\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.camera.imageprocessor.FrameProcessor.ProcessingTask.onImageAvailable(android.media.ImageReader):void\");\n }", "@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n if(resultCode == RESULT_OK && requestCode ==200){\n Uri uri_img=data.getData();\n try{\n assert uri_img != null;\n InputStream input_img = updateView.getContext().getContentResolver().openInputStream(uri_img);\n DecodeImage_stream = BitmapFactory.decodeStream(input_img);\n chooseImage.setImageBitmap(DecodeImage_stream);\n }catch (FileNotFoundException f){\n Log.d(\"add new file not found:\",f.getMessage());\n }\n }\n }", "@Override\n public void onActivityResult(int requestCode, int resultCode, Intent intent)\n {\n if(requestCode==REQUEST_IMAGE_CAPTURE && resultCode==RESULT_OK)\n {\n mCurFaceImg.process();\n }\n super.onActivityResult(requestCode, resultCode, intent);\n }", "@Override\n public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {\n }", "@Override\n public void onProgressUpdate(String imageUri, View view,\n int current, int total) {\n }", "private void setPhotoAttcher() {\n\n }", "@Override\n public void onFailure(@NonNull Exception e) {\n e.printStackTrace();\n Toast.makeText(context, \"Image process failed\", Toast.LENGTH_SHORT).show();\n }", "public void onFinalImageSet(java.lang.String r3, @javax.annotation.Nullable com.facebook.imagepipeline.image.ImageInfo r4, @javax.annotation.Nullable android.graphics.drawable.Animatable r5) {\r\n /*\r\n r2 = this;\r\n r3 = 0;\r\n r4 = com.airbnb.android.react.maps.AirMapMarker.this;\t Catch:{ all -> 0x007e }\r\n r4 = r4.dataSource;\t Catch:{ all -> 0x007e }\r\n r4 = r4.getResult();\t Catch:{ all -> 0x007e }\r\n r4 = (com.facebook.common.references.CloseableReference) r4;\t Catch:{ all -> 0x007e }\r\n r3 = 1;\r\n if (r4 == 0) goto L_0x003b;\r\n L_0x0010:\r\n r5 = r4.get();\t Catch:{ all -> 0x0039 }\r\n r5 = (com.facebook.imagepipeline.image.CloseableImage) r5;\t Catch:{ all -> 0x0039 }\r\n if (r5 == 0) goto L_0x003b;\r\n L_0x0018:\r\n r0 = r5 instanceof com.facebook.imagepipeline.image.CloseableStaticBitmap;\t Catch:{ all -> 0x0039 }\r\n if (r0 == 0) goto L_0x003b;\r\n L_0x001c:\r\n r5 = (com.facebook.imagepipeline.image.CloseableStaticBitmap) r5;\t Catch:{ all -> 0x0039 }\r\n r5 = r5.getUnderlyingBitmap();\t Catch:{ all -> 0x0039 }\r\n if (r5 == 0) goto L_0x003b;\r\n L_0x0024:\r\n r0 = android.graphics.Bitmap.Config.ARGB_8888;\t Catch:{ all -> 0x0039 }\r\n r5 = r5.copy(r0, r3);\t Catch:{ all -> 0x0039 }\r\n r0 = com.airbnb.android.react.maps.AirMapMarker.this;\t Catch:{ all -> 0x0039 }\r\n r0.iconBitmap = r5;\t Catch:{ all -> 0x0039 }\r\n r0 = com.airbnb.android.react.maps.AirMapMarker.this;\t Catch:{ all -> 0x0039 }\r\n r5 = com.google.android.gms.maps.model.BitmapDescriptorFactory.fromBitmap(r5);\t Catch:{ all -> 0x0039 }\r\n r0.iconBitmapDescriptor = r5;\t Catch:{ all -> 0x0039 }\r\n goto L_0x003b;\r\n L_0x0039:\r\n r3 = move-exception;\r\n goto L_0x0082;\r\n L_0x003b:\r\n r5 = com.airbnb.android.react.maps.AirMapMarker.this;\r\n r5 = r5.dataSource;\r\n r5.close();\r\n if (r4 == 0) goto L_0x0049;\r\n L_0x0046:\r\n com.facebook.common.references.CloseableReference.closeSafely(r4);\r\n L_0x0049:\r\n r4 = com.airbnb.android.react.maps.AirMapMarker.this;\r\n r4 = r4.markerManager;\r\n if (r4 == 0) goto L_0x0078;\r\n L_0x0051:\r\n r4 = com.airbnb.android.react.maps.AirMapMarker.this;\r\n r4 = r4.imageUri;\r\n if (r4 == 0) goto L_0x0078;\r\n L_0x0059:\r\n r4 = com.airbnb.android.react.maps.AirMapMarker.this;\r\n r4 = r4.markerManager;\r\n r5 = com.airbnb.android.react.maps.AirMapMarker.this;\r\n r5 = r5.imageUri;\r\n r4 = r4.getSharedIcon(r5);\r\n r5 = com.airbnb.android.react.maps.AirMapMarker.this;\r\n r5 = r5.iconBitmapDescriptor;\r\n r0 = com.airbnb.android.react.maps.AirMapMarker.this;\r\n r0 = r0.iconBitmap;\r\n r4.updateIcon(r5, r0);\r\n L_0x0078:\r\n r4 = com.airbnb.android.react.maps.AirMapMarker.this;\r\n r4.update(r3);\r\n return;\r\n L_0x007e:\r\n r4 = move-exception;\r\n r1 = r4;\r\n r4 = r3;\r\n r3 = r1;\r\n L_0x0082:\r\n r5 = com.airbnb.android.react.maps.AirMapMarker.this;\r\n r5 = r5.dataSource;\r\n r5.close();\r\n if (r4 == 0) goto L_0x0090;\r\n L_0x008d:\r\n com.facebook.common.references.CloseableReference.closeSafely(r4);\r\n L_0x0090:\r\n throw r3;\r\n */\r\n throw new UnsupportedOperationException(\"Method not decompiled: com.airbnb.android.react.maps.AirMapMarker.1.onFinalImageSet(java.lang.String, com.facebook.imagepipeline.image.ImageInfo, android.graphics.drawable.Animatable):void\");\r\n }", "private void manuallyPushImageToImageReader(){\n mImageReader = VNCUtility.createImageReader(this);\n mImageReader.setOnImageAvailableListener(new ImageReader.OnImageAvailableListener() {\n @Override\n public void onImageAvailable(ImageReader reader) {\n Log.d(TAG, \"NEW IMAGE AVAILABLE\");\n\n DisplayMetrics metrics = getResources().getDisplayMetrics();\n\n\n Image image = reader.acquireLatestImage();\n VNCUtility.printReaderFormat(image.getFormat());\n Log.d(TAG, \"IMAGE FORMAT: \" + image.getFormat());\n final Image.Plane[] planes = image.getPlanes();\n final ByteBuffer buffer = planes[0].getBuffer();\n int pixelStride = planes[0].getPixelStride();\n int rowStride = planes[0].getRowStride();\n int rowPadding = rowStride - pixelStride * mWidth;\n int w = mWidth + rowPadding / pixelStride;\n Bitmap bmp = Bitmap.createBitmap(mWidth, mHeight, Bitmap.Config.RGB_565);\n bmp.copyPixelsFromBuffer(buffer);\n mBmp = bmp;\n\n Thread t = new Thread(new Runnable() {\n @Override\n public void run() {\n try {\n //saveScreen(mBmp);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }\n });\n t.start();\n\n image.close();\n\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n mImageView.setImageBitmap(mBmp);\n }\n });\n\n\n /*\n Image img = reader.acquireLatestImage();\n Image.Plane[] planes = img.getPlanes();\n int width = img.getWidth();\n int height = img.getHeight();\n int pixelStride = planes[0].getPixelStride();\n int rowStride = planes[0].getRowStride();\n int rowPadding = rowStride - pixelStride * width;\n ByteBuffer buffer = planes[0].getBuffer();\n byte[] data = new byte[buffer.capacity()];\n buffer.get(data);\n\n for(int i = 10000; i < 100; i++){\n Log.d(TAG, getColourForInt(data[i]));\n }\n\n int offset = 0;\n Bitmap bitmap = Bitmap.createBitmap(metrics, width, height, Bitmap.Config.ARGB_8888);\n for (int i = 0; i < height; ++i) {\n for (int j = 0; j < width; ++j) {\n int pixel = 0;\n pixel |= (buffer.get(offset) & 0xff) << 16; // R\n pixel |= (buffer.get(offset + 1) & 0xff) << 8; // G\n pixel |= (buffer.get(offset + 2) & 0xff); // B\n pixel |= (buffer.get(offset + 3) & 0xff) << 24; // A\n bitmap.setPixel(j, i, pixel);\n offset += pixelStride;\n }\n offset += rowPadding;\n }\n mBmp = bitmap;\n img.close();\n\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n mImageView.setImageBitmap(mBmp);\n }\n });\n */\n }\n }, null);\n Surface surface = mImageReader.getSurface();\n if(surface == null){\n Log.d(TAG, \"SURFACE IS NULL\");\n }\n else{\n Log.d(TAG, \"SURFACE IS NOT NULL\");\n Canvas canvas = surface.lockCanvas(null);\n\n int[] ints = new int[mWidth * mHeight];\n for (int i = 0; i < mWidth * mHeight; i++) {\n ints[i] = Color.MAGENTA;//0x00FF0000;\n }\n\n //final Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0, ints.length);\n Bitmap bitmap = Bitmap.createBitmap(ints, mWidth, mHeight, Bitmap.Config.RGB_565);\n //canvas.drawARGB(255, 255, 0, 255);\n canvas.drawBitmap(bitmap,0,0,null);\n surface.unlockCanvasAndPost(canvas);\n }\n }", "private void enhanceImage(){\n }", "@SuppressWarnings(\"deprecation\")\r\n\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\tpublic void onLoadingComplete(String imageUri,\r\n\t\t\t\t\t\t\t\tView view, Bitmap loadedImage) {\n\t\t\t\t\t\t\tLog.e(\"loadImage\", \"onLoadingComplete \");\r\n\r\n\t\t\t\t\t\t\t// TODO UPDATE CODE HERE SHIHAB\r\n\t\t\t\t\t\t\t// relative_restaurent_info\r\n\t\t\t\t\t\t\t// .setBackground(new BitmapDrawable(\r\n\t\t\t\t\t\t\t// loadedImage));\r\n\t\t\t\t\t\t}", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n if (resultCode == RESULT_OK) {\n if (requestCode == CommenString.TAKE_PHOTO) {\n cameraUtil.photoZoomFromTake(CropperImageScale.square);\n } else if (requestCode == CommenString.LOCAL_PHOTO) {\n List<String> selectedImage = data.getStringArrayListExtra(\"paths\");\n cameraUtil.photoZoomFromMapStorage(selectedImage.get(0),\n CropperImageScale.square);\n } else if (requestCode == CommenString.PHOTO_RESULT) {\n Bundle extras = data.getExtras();\n if (extras != null) {\n headBitmap = extras.getParcelable(\"data\");\n image_up.setImageBitmap(headBitmap);\n }\n } else {\n }\n }\n }", "@Override\n public void run() {\n imgFinger.setImageBitmap(bitmap);\n }", "private void processAndSetImage() {\n\n // Resample the saved image to fit the ImageView\n mResultsBitmap = resamplePic(this, mTempPhotoPath);\n\n// tv.setText(base64conversion(photoFile));\n//\n// Intent intent = new Intent(Intent.ACTION_SEND);\n// intent.setType(\"text/plain\");\n// intent.putExtra(Intent.EXTRA_TEXT, base64conversion(photoFile));\n// startActivity(intent);\n\n /**\n * UPLOAD IMAGE USING RETROFIT\n */\n\n retroFitHelper(base64conversion(photoFile));\n\n // Set the new bitmap to the ImageView\n imageView.setImageBitmap(mResultsBitmap);\n }", "@Override\n public void imageFromCamera() {\n Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n if (takePictureIntent.resolveActivity(getPackageManager()) != null) {\n startActivityForResult(takePictureIntent, REQUEST_IMAGE_CAPTURE);\n }\n }", "protected void onReloadImage() {\n String url = DataProvider.SCREEN + DataProvider.SCREEN_INDEX + mScreenId + \"&time=\" + System.currentTimeMillis();\n image.setUrl(url); //just to avoid caching\n loadTree();\n }", "@Override\r\n\tprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\tsuper.onActivityResult(requestCode, resultCode, data);\r\n\t\t\r\n\t\tif(resultCode!=RESULT_OK){\r\n\t\t\tSystem.out.println(\"error\");\r\n\t\t}if(requestCode==SLE_PH){\r\n\t\t\tif(imageuri!=null){\r\n\t\t\t\ttry {\r\n\t\t\t\t\tis= getContentResolver().openInputStream(imageuri);\r\n\t\t\t\t\tBitmap bm=BitmapFactory.decodeStream(is);\r\n\t\t\t\t\tBitmap bm2= toRoundBitmap(bm);\r\n\t\t\t\t\tself_headimg.setImageBitmap(bm2);\r\n\t\t\t\t\tsaveMyBitmap(bm2);\r\n\t\t\t\t\tpath=Environment.getExternalStorageDirectory()+\"/head.png\";\r\n\t\t\t\t\tmyApplication my=(myApplication) Main_Activity.this.getApplication();\r\n//\t\t\t\t\tToast.makeText(Main_Activity.this, \"\"+my.getUser_name(), Toast.LENGTH_SHORT).show();\r\n\t\t\t\t\tNetUtil.uploadDataByHttpClientFile(Main_Activity.this,f);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (FileNotFoundException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}}", "void onPhotoError();", "@Override\n public void onClick(View arg0) {\n try {\n mPreview.captureImage();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "@Override\n public void renderNextImage() {\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {\n // choose a image\n if (requestCode == RequestCode.CHOOSE_IMAGE) {\n if (resultCode == RESULT_OK) {\n if (data != null) {\n Uri dataUri = data.getData();\n if (dataUri != null) {\n // get a random name\n File imgFile = SpaceUtils.newUsableFile();\n mSelectPath = imgFile.getPath();\n Log.v(\"path\",mSelectPath);\n // the image intent just return a simple image\n // the Ucrop(裁剪) is solved after the image intent\n UCrop.Options options = new UCrop.Options();\n options.setCompressionQuality(100);\n UCrop.of(dataUri, Uri.fromFile(imgFile))\n .withOptions(options)\n .withMaxResultSize(mImageSize.x, mImageSize.y)\n .withAspectRatio(3, 4)\n .start(this, RequestCode.CROP_IMAGE);\n }\n }\n }\n } else if (requestCode == RequestCode.CROP_IMAGE) {\n // crop a image\n if (resultCode == RESULT_OK) {\n if (data != null) {\n Glide.with(this).load(mSelectPath).into(mImageViews.get(mCurrentIndex));\n startDetectFaceInfo();\n }\n }\n }\n super.onActivityResult(requestCode, resultCode, data);\n }", "@Override\n public void onLoadingFailed(String imageUri, View view, FailReason failReason) {\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n try {\n\n if (requestCode == IMG_RESULT && resultCode == RESULT_OK\n && null != data) {\n\n\n imageeUri = data.getData();\n\n mInsertImage.setImageURI(imageeUri);\n }\n }\n catch (Exception e) {\n Toast.makeText(this, \"Please try again\", Toast.LENGTH_LONG)\n .show();\n }\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n if (resultCode == RESULT_OK) {\n if (requestCode == 1) {\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;\n BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n int photoW = bmOptions.outWidth;\n int photoH = bmOptions.outHeight;\n\n bmOptions.inJustDecodeBounds = false;\n bmOptions.inPurgeable = true;\n\n Bitmap bitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n String txt = getTextFromImage(bitmap);\n searchByPhoto(txt);\n }else if(requestCode == 2){\n Bitmap bm=null;\n if (data != null) {\n try {\n bm = MediaStore.Images.Media.getBitmap(getApplicationContext().getContentResolver(), data.getData());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n String txt = getTextFromImage(bm);\n searchByPhoto(txt);\n }\n }\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n if (requestCode == PICK_IMAGE && resultCode == RESULT_OK && data != null && data.getData() != null) {\n filePath = data.getData();\n try {\n Bitmap bitmap = MediaStore.Images.Media.getBitmap(getContentResolver(), filePath);\n Image_brand.setImageBitmap(bitmap);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }", "@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n if (requestCode == 234 && data != null && data.getData() != null) {\n filePath = data.getData();\n Uri uri = data.getData();\n try {\n Bitmap bitmap = MediaStore.Images.Media.getBitmap(this.getContentResolver(), uri);\n ImageView imageView = findViewById(R.id.displayPicture);\n imageView.setImageBitmap(bitmap);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }\n }", "@Override\n protected void onActivityResult(int requestCode,int resultCode, Intent data){\n if (requestCode == 0x1 && resultCode == RESULT_OK) {\n if (data != null) {\n imageuri=data.getData();\n imageView.setImageURI(imageuri);\n changeUri(imageuri.toString());\n }\n }\n super.onActivityResult(requestCode, resultCode, data);\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {\n if(resultCode == RESULT_OK) {\n imgView.setImageURI(image_uri);\n// image_uri = data.getData();\n// try {\n// InputStream inputStream = getContentResolver().openInputStream(image_uri);\n// bitmap = BitmapFactory.decodeStream(inputStream);\n// imgView.setImageBitmap(bitmap);\n//// imgView.setVisibility(View.VISIBLE);\n//// btnUpload.setVisibility(View.VISIBLE);\n// } catch (IOException e) {\n// e.printStackTrace();\n// }\n// Toast.makeText(GambarActivity.this, \"o\", Toast.LENGTH_SHORT).show();\n }\n// super.onActivityResult(requestCode, resultCode, data);\n }", "public void m2261I() {\n try {\n if (this.f2513n != null) {\n this.f2513n.setImageDrawable(C5150d.m3784a(mo61159b().getResources(), \"iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA39pVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDY3IDc5LjE1Nzc0NywgMjAxNS8wMy8zMC0yMzo0MDo0MiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozODRkZTAxYi00OWRkLWM4NDYtYThkNC0wZWRiMDMwYTZlODAiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QkE0Q0U2MUY2QzA0MTFFNUE3MkJGQjQ1MTkzOEYxQUUiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QkE0Q0U2MUU2QzA0MTFFNUE3MkJGQjQ1MTkzOEYxQUUiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjlkZjAyMGU0LTNlYmUtZTY0ZC04YjRiLWM5ZWY4MTU4ZjFhYyIgc3RSZWY6ZG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOmU1MzEzNDdlLTZjMDEtMTFlNS1hZGZlLThmMTBjZWYxMGRiZSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PngNsEEAAANeSURBVHjatFfNS1tBEH+pUZOQ0B4i3sTSxHMRFNQoFBEP7dHgvyDiKWgguQra9F+oxqNiwOTQ+oFI1ZM3jSf1YK5FL41ooaKZzu+x+4gv2bx9Rgd+JNn5zO7s7IzH0CQiCvLHZ8YnxkfGe8ZbwS4zSowTxi/GT4/Hc2u8BLHjCOM745b06VboRJpx7GN8ZfyDxUqlQgcHB5RMJmloaIg6Ozupra3NBL5jDTzIQFYQdDOw5db5B8YxLDw+PtLKygr19PQQWDqIRqOUzWZNXUHH2rvBgr2M39C6uLig/v5+bcd2QLdUKskgYLNX57yvIL2zs0OhUOjZziU6Ojro8PBQBnGl3Alm+BknkMI54mybdS4BW3t7ezKIInzVCwDJYm4Zon4p5xLYzfPzcxlEpl7S3SNpmjlznZwQiXn/5CjEnTUzt5GBsbExamlpUfLBg0wjG8vLy3IXlqTzEAoH7m4kElEqTk1Nmfd7bW2tbhBYAw8ykFXZgQ9RJ1CsQghgEr/29/eVStPT09XFhdbX18nr9Vr81tZWyuVyFh+yMzMzSnvwJWjyDS+MYic2NzeV17O7u9vg2m79jsfjBv9bg7PbxOrqqjExMWHxIdvV1aW0V+VrFDtwhFCGh4cbnl0mk6kp+BsbGybsBNlGtkZGRqToEQK4xjfUc6csXlhYcHyFFhcXHe3Al6BrQz427e3tWldpfn5e6Rw83cIkHyvXAUAZb4SdsKZbPe0BaB+Bz+cjTiDlDmxtbZkybo9AKwn9fj9tb2875gBkINvIFnzJJMQ1PMV9GBgYUF6bQCBgFAoFY3x8/Ml6KpUy0un0kzXIQBY6KqrydapViPL5fM0/Rfcj+fhuJw5CqxBpleJYLEY3NzeW8dnZ2RoZrEmCLHQcSvGdWYrFe7CEFTwUqqjR85XLZUokEkoZ8CADWe3HqKoTcnyOdW5KI5m+vj56eHiQz3G0bkNyeXn5ag3J2dmZ/PffVC1Z8bVast3d3eqWLKDVlAaDwaadh8Nhvaa0XluOHg7n9lzn0MWRarfltp0oysEErRqGDTeDCbK9ajApuh7TxGiWERlrjWZzc3M0ODhYM5phDTzbaHb/rNHMFkhUNK13LobTv6K2RJ3se1yO519s4/k7wf5jG89/6I7n/wUYAGo3YtcprD4sAAAAAElFTkSuQmCC\"));\n this.f2513n.setScaleType(ScaleType.FIT_CENTER);\n }\n } catch (Exception e) {\n C5017f.m3256a(mo61159b(), C5015d.EXCEPTION, \"MraidMode.showDefaultCloseButton\", e.getMessage(), \"\");\n }\n }", "@Override\n\tprotected void onPhotoTaked(String photoPath) {\n\t\t\n\t}", "@Override\n public void onClick(View v) {\n Cam.takePicture(shutterCallback, null, mPicture);\n// Cam.takePicture();\n }", "private void showImageDetail() {\n }", "@Override\n public void onLoadingStarted(String imageUri, View view) {\n }", "@Override\n\tprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\tsuper.onActivityResult(requestCode, resultCode, data);\n\t\tif (requestCode == camera.IMAGE_CAPTURE) {\n\n\t\t\tif (resultCode == RESULT_OK){\n\t\t\t\tCommon.PATH=BitmapUtils.getAbsoluteImagePath(Preview.this, camera.getImageUri());\n\t\t\t\tIntent intent = new Intent(Preview.this,Preview.class);\n\t\t\t\tstartActivity(intent);\n\t\t\t}\n\n\t\t\t}\n\t\n\t}", "@Override\r\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\r\n Bitmap b=(Bitmap)data.getExtras().get(\"data\");\r\n i1.setImageBitmap(b);\r\n\r\n }", "@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)\n @Override\n public void run() {\n Boolean hasBarcodes = barcodes > 0;\n if (hasBarcodes) {\n // Keep local image\n\n //handlePrivateImage(bitmap);\n context.get().finish();\n }\n else {\n // Delete local image and push to cloud\n if (imageFile.exists())\n imageFile.delete();\n handlePublicImage(bitmap);\n }\n }", "private void initAreaImageFilm() {\n\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {\n\n if (requestCode == CAPTURE_IMAGE_REQUEST && resultCode == RESULT_OK) {\n Bitmap myBitmap = BitmapFactory.decodeFile(photoFile.getAbsolutePath());\n imgDisplay.setImageBitmap(myBitmap);\n textPath.setText(photoFile.getName());\n } else {\n displayMessage(getBaseContext(), \"Request cancelled or something went wrong.\");\n }\n\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n if(requestCode==1&&resultCode==RESULT_OK&&data!=null&&data.getData()!=null){\n imguri=data.getData();\n picIv.setImageURI(imguri);\n }\n }", "@Override\n public void run() {\n try {\n Drawable drawable = Drawable.createFromStream(new URL(image_path).openStream(), \"\");\n\n Message message = Message.obtain();\n message.obj = drawable;\n handler.sendMessage(message);\n } catch (MalformedURLException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "private void onImageProcessed() {\n /* creating random bitmap and then using in TextureView.getBitmap(bitmap) instead of simple TextureView.getBitmap() will not cause lags & memory leaks */\n if (captureBitmap == null) {\n captureBitmap = Bitmap.createBitmap(100, 100, Bitmap.Config.ARGB_8888);\n }\n captureBitmap = Bitmap.createScaledBitmap(targetView.getBitmap(captureBitmap), captureW, captureH, false);\n\n if (captureProcessor != null) {\n if (isThreadingEnabled) {\n cameraThreadHandler.Queue(captureBitmap);\n }\n else {\n captureProcessor.process(captureBitmap, targetView, parentActivity);\n }\n /*\n else if (!skipNextFrame){\n long time = System.currentTimeMillis();\n captureProcessor.process(captureBitmap, targetView, parentActivity);\n time = System.currentTimeMillis() - time;\n if (time > 0.035)\n skipNextFrame = true;\n }\n else {\n skipNextFrame = false;\n }*/\n }\n }", "private void displayImage() {\n if (currentPhotoPath != null) {\n // checkPicture = true; depreciated, try catch to catch if photo exists\n Bitmap temp = fixOrientation(BitmapFactory.decodeFile(currentPhotoPath));\n bitmapForAnalysis = temp;\n imageView.setImageBitmap(temp);\n } else {\n Toast.makeText(this, \"Image Path is null\", Toast.LENGTH_LONG).show();\n }\n }", "private void onUpdate(FrameTime frameTime) {\n Frame frame = arFragment.getArSceneView().getArFrame();\n Collection<AugmentedImage> images = frame.getUpdatedTrackables(AugmentedImage.class);\n //Iterate through the image database\n for (AugmentedImage image : images) {\n // Check if scanned image existed in the image database\n if (image.getTrackingMethod() == AugmentedImage.TrackingMethod.FULL_TRACKING) {\n //Set the scene\n RelativeLayout gallery = findViewById(R.id.gallery);\n ArFragment arFragment = (ArFragment) getSupportFragmentManager().findFragmentById(R.id.arFragment);\n String name = image.getName();\n //check which image was scanned\n switch (name) {\n case \"argon.png\":\n //Set string\n string = \"argon.sfb\";\n //Set the text that appears to the student\n text=getString(R.string.argon2);\n //call the 3D object\n callAR();\n break;\n case \"bromine.png\":\n string = \"bariumatom.sfb\";\n text=getString(R.string.bromine2);\n callAR();\n break;\n case \"calcium.png\":\n string = \"calcium.sfb\";\n text=getString(R.string.calcium2);\n callAR();\n break;\n case \"chlorine.png\":\n string = \"chlorineatom.sfb\";\n text=getString(R.string.chlorine2);\n callAR();\n break;\n case \"fluorine.png\":\n string = \"fluorineatom.sfb\";\n text=getString(R.string.fluorine2);\n callAR();\n break;\n case \"helium.png\":\n string = \"heliumatom.sfb\";\n text=getString(R.string.helium2);\n callAR();\n break;\n case \"hydrogen.png\":\n string = \"hydrogen.sfb\";\n text=getString(R.string.hydrogen2);\n callAR();\n break;\n case \"lithium.png\":\n string = \"Lithiumatom.sfb\";\n text=getString(R.string.lithium2);\n callAR();\n break;\n case \"magnesium.png\":\n string = \"magnesiumatomm.sfb\";\n text=getString(R.string.magnesium2);\n callAR();\n break;\n case \"neon.png\":\n string = \"neonn.sfb\";\n text=getString(R.string.neon2);\n callAR();\n break;\n case \"sodium.png\":\n string = \"sodium.sfb\";\n text=getString(R.string.sodium2);\n callAR();\n break;\n }\n\n\n }\n }\n }", "protected void setPic() {\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n //here we are applying the condition\n if(requestCode==50 && resultCode==RESULT_OK){\n //here it will Get the url from data\n Uri selectedImageUri = data.getData();\n if (null != selectedImageUri) {\n //displays image\n imageView.setImageURI(selectedImageUri);\n }\n }\n }", "public void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n\n if (resultCode == RESULT_OK) {\n\n // compare the resultCode with the\n // SELECT_PICTURE constant\n if (requestCode == SELECT_PICTURE) {\n Uri selectedImageURI = data.getData();\n// File imageFile = new File(getRealPathFromURI(selectedImageURI));\n Uri selectedImageUri = data.getData( );\n String picturePath = getPath( getApplicationContext( ), selectedImageUri );\n Log.d(\"Picture Path\", picturePath);\n\n // Get the url of the image from data\n selectedImageUri = data.getData();\n if (null != selectedImageUri) {\n bitmap = null;\n // update the preview image in the layout\n try {\n bitmap = MediaStore.Images.Media.getBitmap(this.getContentResolver(), selectedImageUri);\n } catch (IOException e) {\n e.printStackTrace();\n }\n// IVPreviewImage.setImageURI(selectedImageUri);\n// runTextRecognition(bitmap);\n IVPreviewImage.setImageBitmap(bitmap);\n\n }\n }\n\n if (requestCode == 123) {\n\n\n Bitmap photo = (Bitmap) data.getExtras()\n .get(\"data\");\n\n // Set the image in imageview for display\n IVPreviewImage.setImageBitmap(photo);\n runTextRecognition(photo);\n\n }\n\n }\n }", "@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n switch (requestCode) {\n case SELECT_PHOTO:\n if (resultCode == RESULT_OK) {\n // imABoolean=true;\n try {\n filePath = data.getData();\n bitmap = MediaStore.Images.Media.getBitmap(getActivity().getContentResolver(), filePath);\n\n logo.setImageBitmap(bitmap);\n\n\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n break;\n }\n }\n\n\n }", "@Override\r\n protected void onActivityResult(int requestCode, int resultCode, Intent returnedIntent) {\r\n super.onActivityResult(requestCode, resultCode, returnedIntent);\r\n try {\r\n // When an Image is picked\r\n if (resultCode == RESULT_OK && null != returnedIntent) {\r\n // Get the Image from data\r\n Uri imageLocation = returnedIntent.getData();\r\n InputStream imageStream = getContentResolver().openInputStream(imageLocation);\r\n Bitmap selectedImage = BitmapFactory.decodeStream(imageStream);\r\n selectedImage = getResizedBitmap(selectedImage,1080/4,1920/4);\r\n currentUserEdit.setImageBitmap(selectedImage);\r\n currentSaveCharacter.setImage(selectedImage);\r\n saveCharacters(context);\r\n }\r\n } catch (Exception e) {\r\n Toast.makeText(this, \"ImageGet ERROR\", Toast.LENGTH_LONG)\r\n .show();\r\n Log.d(\"ImageGet ERROR\", e.toString());\r\n }\r\n\r\n }", "@Override\r\n public void onPrepareLoad(Drawable arg0) {\n\r\n }", "@Override\r\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\r\n //jika image picker membawa sebuah data berupa foto maka\r\n if (ImagePicker.shouldHandle(requestCode, resultCode, data)) {\r\n //ambil data foto yang dipilih\r\n Image image = ImagePicker.getFirstImageOrNull(data);\r\n //ambil path/lokasi dari foto/gambar yang dipilih\r\n File imgFile = new File(image.getPath());\r\n if (imgFile.exists()) {\r\n //convert path ke bitmap dan tampilkan pada imageview\r\n Bitmap myBitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath());\r\n imgTranscript.setImageBitmap(myBitmap);\r\n\r\n //set variabel change true karena gambar telah diupdate\r\n isPicChange = true;\r\n }\r\n }\r\n\r\n super.onActivityResult(requestCode, resultCode, data);\r\n }", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t\tif(!IrishreloAccess.imagePath.equals(\"\"))\n\t\t\tshowImage(IrishreloAccess.imagePath);\n\t\telse if(!IrishreloAccess.captbyCam.equals(\"\"))\n\t\t\tshowImage(IrishreloAccess.captbyCam);\n\t}", "private void captureImage() {\n //Information about intents: http://developer.android.com/reference/android/content/Intent.html\n //Basically used to start up activities or send data between parts of a program\n Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n //Obtains the unique URI which sets up and prepares the image file to be taken, where it is to be placed,\n //and errors that may occur when taking the image.\n fileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE);\n //Stores this information in the Intent (which can be usefully passed on to the following Activity)\n intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);\n // start the image capture Intent (opens up the camera application)\n startActivityForResult(intent, CAMERA_CAPTURE_IMAGE_REQUEST_CODE);\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_deneme2);\n ImageView imageView = findViewById(R.id.imageView);\n\n\n path= getExternalFilesDir(null)+\"/aa/\"+\"/ScreenShot\"+(MainActivity.PHOTO_COUNT-1+\".jpg\");\n File imgFile= new File(path);\n if(imgFile.exists())\n {\n imageView.setImageURI(Uri.fromFile(imgFile));\n\n }\n }", "@Override\n public void onClick(View v) {\n\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent,\n \"Select Picture\"), IMG_RESULT);\n\n }", "public abstract void setUpBitmap(Context context);", "@Override\n public void onLoadingFailed(String imageUri, View view, FailReason failReason) {\n }", "@Override\n\t\t\t\t\t\tpublic void onLoadingComplete(String arg0, View arg1, Bitmap arg2) {\n\t\t \t\t\t\tDrawable drawable = iv_details_poster.getDrawable();\n\t\t \t\t\t\tBitmap bitmap = ImageUtil.drawableToBitmap(drawable);\n\t\t \t\t\t\tBitmap bit = Reflect3DImage.skewImage(bitmap, 60);\n\t\t \t\t\t\tiv_details_poster.setImageBitmap(bit);\n\t\t\t\t\t\t}", "@Override\r\n public void onResponse(String response) {\n loadImageInGUI(response);\r\n Utility.writeOnPreferences(activity, \"image\", response);\r\n Utility.reloadActivity(activity);\r\n\r\n }", "@Override\n\tpublic void onRxImage(String name, ImageMessage image) {\n\t\t\n\t}", "private void galleryAddPic() {\n\t}", "@Override\n\tpublic void init() {\n\t\tthis.image = Helper.getImageFromAssets(AssetConstants.IMG_ROAD_NORMAL);\n\t}", "private void drawImage(){\n Integer resourceId = imageId.get(this.name);\n if (resourceId != null) {\n drawAbstract(resourceId);\n } else {\n drawNone();\n }\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n if (resultCode == RESULT_OK && data.getData()!=null) {\n if (requestCode == 2) {\n Uri selectedImage = data.getData();\n String[] filePath = { MediaStore.Images.Media.DATA };\n Cursor c = getContentResolver().query(selectedImage,filePath, null, null, null);\n c.moveToFirst();\n int columnIndex = c.getColumnIndex(filePath[0]);\n String picturePath = c.getString(columnIndex);\n c.close();\n Bitmap thumbnail = (BitmapFactory.decodeFile(picturePath));\n thumbnail= AppUtils.getResizedBitmap(thumbnail, 400);\n ivPic.setImageBitmap(thumbnail);\n\n //either update existing thumbnail\n if(thumbnailImage != null){\n thumbnailImage.setImage(thumbnail);\n viewModel.updateThumbnail(thumbnailImage);\n }\n //or create a new thumbnail\n else{\n contactGroup.setThumbnailId((int) viewModel.addThumbnailGetId(new ThumbnailImage(thumbnail)));\n viewModel.updateGroup(contactGroup);\n }\n }\n }\n }", "void imageChooser() {\n\n // create an instance of the\n // intent of the type image\n Intent i = new Intent();\n i.setType(\"image/*\");\n i.setAction(Intent.ACTION_GET_CONTENT);\n\n\n // pass the constant to compare it\n // with the returned requestCode\n startActivityForResult(Intent.createChooser(i, \"Select Picture\"), SELECT_PICTURE);\n }", "public void mo60894a() {\n int i;\n this.f61656f = new SmartAvatarImageView(getContext());\n if (C6399b.m19946v()) {\n ((C13438a) this.f61656f.getHierarchy()).mo32891a((int) R.color.a5q, C13423b.f35599g);\n }\n addView(this.f61656f, getAvatarLayoutParams());\n LayoutParams a = m76775a(getVerifyIconSize());\n this.f61651a = new ImageView(getContext());\n int i2 = R.drawable.amq;\n try {\n this.f61651a.setImageDrawable(getResources().getDrawable(R.drawable.amq));\n } catch (NotFoundException unused) {\n }\n this.f61651a.setVisibility(8);\n LayoutParams a2 = m76775a(getVerifyIconSize());\n this.f61652b = new ImageView(getContext());\n try {\n this.f61652b.setImageDrawable(getResources().getDrawable(R.drawable.amq));\n } catch (NotFoundException unused2) {\n }\n this.f61652b.setVisibility(8);\n this.f61653c = new ImageView(getContext());\n try {\n ImageView imageView = this.f61653c;\n Resources resources = getResources();\n if (C6399b.m19944t()) {\n i = R.drawable.amp;\n } else {\n i = R.drawable.amq;\n }\n imageView.setImageDrawable(resources.getDrawable(i));\n } catch (NotFoundException unused3) {\n }\n this.f61653c.setVisibility(8);\n this.f61654d = new ImageView(getContext());\n try {\n this.f61654d.setImageDrawable(getResources().getDrawable(R.drawable.amm));\n } catch (NotFoundException unused4) {\n }\n this.f61654d.setVisibility(8);\n this.f61655e = new ImageView(getContext());\n try {\n ImageView imageView2 = this.f61655e;\n Resources resources2 = getResources();\n if (C6399b.m19944t()) {\n i2 = R.drawable.amp;\n }\n imageView2.setImageDrawable(resources2.getDrawable(i2));\n } catch (NotFoundException unused5) {\n }\n this.f61655e.setVisibility(8);\n addView(this.f61651a, a);\n addView(this.f61652b, a2);\n addView(this.f61653c, a2);\n addView(this.f61654d, a2);\n addView(this.f61655e, a2);\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == ACTIVITY_START_CAMERA_APP && resultCode == RESULT_OK){\n /*//Todo: Mensaje para mostrar al usuario al capturar la fotografia\n// Toast.makeText(this,\"Picture taken successfully\",Toast.LENGTH_LONG).show();\n\n //Todo: Se crea el objeto Bundle con el nombre extras\n Bundle extras = data.getExtras();\n //Todo: Devuelve el bundle que contenga el intent\n Bitmap photoCaptureBitmap = (Bitmap) extras.get(\"data\");\n //Todo: Se asigna a mPhotoCapturedImageView el valor que contenga el Bitmap photoCaptureBitmap\n mPhotoCapturedImageView.setImageBitmap(photoCaptureBitmap);\n*/\n //Bitmap photoCaptureBitmap = BitmapFactory.decodeFile(mImageFileLocation);\n //mPhotoCapturedImageView.setImageBitmap(photoCaptureBitmap);\n rotateImage(setReduceImageSize());\n }\n }", "@Override\n\tpublic void onImageDownloadFinish(Bitmap googleimagebitmap) {\n\n\t}", "@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n\n if (requestCode == 1 && resultCode == getActivity().RESULT_OK && data != null && data.getData() != null) {\n\n Uri uri = data.getData();\n\n try {\n ByteArrayOutputStream boas = new ByteArrayOutputStream();\n\n\n Bitmap btmap = MediaStore.Images.Media.getBitmap(getActivity().getContentResolver(), uri);\n\n btmap.compress(Bitmap.CompressFormat.JPEG, 70, boas); //bm is the bitmap object\n byte[] byteArrayImage = boas.toByteArray();\n\n\n BitmapFactory.Options opt;\n\n opt = new BitmapFactory.Options();\n opt.inTempStorage = new byte[16 * 1024];\n opt.inSampleSize = 2;\n Bitmap bitmap = BitmapFactory.decodeByteArray(byteArrayImage, 0, byteArrayImage.length, opt);\n\n ImageView imageView = (ImageView) getActivity().findViewById(R.id.profile_back);\n CircleImageView dp = (CircleImageView) getActivity().findViewById(R.id.dp1);\n dp.setImageBitmap(bitmap);\n Bitmap bitmap1=grayscale(bitmap);\n Bitmap blurred = blurRenderScript(bitmap1, 25);\n imageView.setImageBitmap(blurred);\n } catch (OutOfMemoryError a) {\n Toast.makeText(getActivity().getApplicationContext(), \"Image size high\", Toast.LENGTH_SHORT).show();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }", "void onPictureCompleted();", "@Override\r\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\r\n super.onActivityResult(requestCode, resultCode, data);\r\n mImageUri = data.getData();\r\n if (requestCode == GALLERY_REQUEST && resultCode == Activity.RESULT_OK) {\r\n mImageUri = data.getData();\r\n if (data.getData() == null) {\r\n Toast.makeText(this, \"Failed to load Image,try again\", Toast.LENGTH_LONG).show();\r\n return;\r\n }\r\n try {\r\n outputUri =new getFileName(context).getDataFilesThumbnailUriPath(String.valueOf(System.currentTimeMillis()),context);\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n CropImage.activity(mImageUri)\r\n .setGuidelines(CropImageView\r\n .Guidelines.ON)\r\n .setAspectRatio(1, 1)\r\n .setBackgroundColor(getApplicationContext().getResources().getColor(R.color.background))\r\n .setActivityMenuIconColor(getApplicationContext().getResources().getColor(R.color.colorPrimary))\r\n .setOutputUri(outputUri)\r\n .start(this);\r\n }\r\n if (requestCode == CropImage.CROP_IMAGE_ACTIVITY_REQUEST_CODE) {\r\n CropImage.ActivityResult result = CropImage.getActivityResult(data);\r\n if (resultCode == RESULT_OK) {\r\n resultUri =Uri.fromFile(new File(new CompressingImage5kb(String.valueOf(System.currentTimeMillis()),context).compressImage(String.valueOf(result.getUri()),\"\",true)));\r\n mCircleImageView.setImageURI(resultUri);\r\n } else if (requestCode == CropImage.CROP_IMAGE_ACTIVITY_RESULT_ERROR_CODE) {\r\n Exception error = result.getError();\r\n }\r\n }\r\n }", "void mo36482a(ImageView imageView, Uri uri);", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n try {\n // When an Image is picked\n if (requestCode == RESULT_LOAD_IMG && resultCode == RESULT_OK\n && null != data) {\n // Get the Image from data\n checkbit = 1;\n Uri selectedImage = data.getData();\n bitmap = scaleImage(this,selectedImage);\n origmap = bitmap;\n\n String[] filePathColumn = {MediaStore.Images.Media.DATA};\n\n // Get the cursor\n Cursor cursor = getContentResolver().query(selectedImage,\n filePathColumn, null, null, null);\n // Move to first row\n cursor.moveToFirst();\n\n int columnIndex = cursor.getColumnIndex(filePathColumn[0]);\n imgPath = cursor.getString(columnIndex);\n cursor.close();\n imgView.setImageBitmap(bitmap);\n\n Calendar c = Calendar.getInstance();\n SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n int amorpmint = c.get(Calendar.AM_PM);\n String amorpm;\n if (amorpmint == 0)\n {\n amorpm = \"AM\";\n } else {\n amorpm = \"PM\";\n }\n\n lastUpdated = df.format(c.getTime()) + \" \" + amorpm;\n SimpleDateFormat timef = new SimpleDateFormat(\"HH:mm\");\n time = timef.format(c.getTime()) + \" \" + amorpm;\n\n fileName = user + \"orig\";\n params = new ArrayList<>();\n // Put file name in Async Http Post Param which will used in Php web app\n params.add(new BasicNameValuePair(\"filename\", fileName));\n params.add(new BasicNameValuePair(\"username\", user));\n params.add(new BasicNameValuePair(\"Time\", time));\n params.add(new BasicNameValuePair(\"LastUpdated\", lastUpdated));\n\n } else {\n Toast.makeText(this, \"You haven't picked Image\",\n Toast.LENGTH_LONG).show();\n }\n } catch (Exception e) {\n Toast.makeText(this, \"Something went wrong\", Toast.LENGTH_LONG)\n .show();\n }\n\n }", "@Override\n public void onCameraPreviewStopped() {\n }", "@Override\n \n \n public void initialize(URL url, ResourceBundle rb) {\n retornararImg();\n\n }", "public void escolherImagem(int requestCode) {\n\n Intent i = new Intent(Intent.ACTION_PICK,\n MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n startActivityForResult(i, requestCode);\n\n }", "@Override\r\n public boolean onLongClick(View v) {\n WebView.HitTestResult hitTestResult = ImageResultActivity.this.webView.getHitTestResult();\r\n final String path = resourceUrl = hitTestResult.getExtra();\r\n switch (hitTestResult.getType()) {\r\n case WebView.HitTestResult.IMAGE_TYPE://获取点击的标签是否为图片\r\n Toast.makeText(ImageResultActivity.this, \"当前选定的图片的URL是\" + path, Toast.LENGTH_LONG).show();\r\n case WebView.HitTestResult.SRC_IMAGE_ANCHOR_TYPE://获取点击的标签是否为图片\r\n Toast.makeText(ImageResultActivity.this, \"当前选定的图片的URL是\" + path, Toast.LENGTH_LONG).show();\r\n//\t\t\t\t\t\r\n break;\r\n }\r\n return false;\r\n }", "private void getImage() {\n\n Intent intent = new Intent(\n Intent.ACTION_PICK,\n android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n\n //intent.setType(\"text/xls\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n\n try {\n startActivityForResult(\n Intent.createChooser(intent, \"Complete action using\"),\n MY_INTENT_CLICK);\n }catch (Exception e) {\n e.getMessage();\n }\n }", "public void onCreate(Bundle bundle) {\n super.onCreate(bundle);\n SystemBar.m33556a((Activity) this, 0);\n SystemBar.m33562b((Activity) this, 0);\n SystemBar.m33561b((Activity) this);\n SystemBar.m33561b((Activity) this);\n if (bundle != null) {\n this.f26280d = bundle.getInt(\"INSTANCE_CAMERA_FUNCTION\");\n this.f26281e = bundle.getString(\"INSTANCE_CAMERA_FILE_PATH\");\n this.f26282f = bundle.getInt(\"INSTANCE_CAMERA_QUALITY\");\n this.f26283j = bundle.getLong(\"INSTANCE_CAMERA_DURATION\");\n this.f26284k = bundle.getLong(\"INSTANCE_CAMERA_BYTES\");\n return;\n }\n Bundle extras = getIntent().getExtras();\n if (f26279c || extras != null) {\n this.f26280d = extras.getInt(\"KEY_INPUT_FUNCTION\");\n this.f26281e = extras.getString(\"KEY_INPUT_FILE_PATH\");\n this.f26282f = extras.getInt(\"KEY_INPUT_CAMERA_QUALITY\");\n this.f26283j = extras.getLong(\"KEY_INPUT_CAMERA_DURATION\");\n this.f26284k = extras.getLong(\"KEY_INPUT_CAMERA_BYTES\");\n int i = this.f26280d;\n if (i == 0) {\n if (TextUtils.isEmpty(this.f26281e)) {\n this.f26281e = AlbumUtils.m33548b((Context) this);\n }\n mo37679a(f26328g, 1);\n } else if (i == 1) {\n if (TextUtils.isEmpty(this.f26281e)) {\n this.f26281e = AlbumUtils.m33552c((Context) this);\n }\n mo37679a(f26329h, 2);\n } else {\n throw new AssertionError(\"This should not be the case.\");\n }\n } else {\n throw new AssertionError();\n }\n }", "void mo36483b(int i, ImageView imageView, Uri uri);", "private void prepararImagenYStorage() {\n mImageBitmap = null;\n\n //this.capturarFotoButton = (Button) findViewById(R.id.capturarFotoButton);\n// setBtnListenerOrDisable(\n// this.capturarFotoButton,\n// mTakePicSOnClickListener,\n// MediaStore.ACTION_IMAGE_CAPTURE\n// );\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO) {\n mAlbumStorageDirFactory = new FroyoAlbumDirFactory();\n } else {\n mAlbumStorageDirFactory = new BaseAlbumDirFactory();\n }\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n if (requestCode == GALLERY_INTENT && resultCode == RESULT_OK) {\n uriImage = data.getData();\n }\n }", "@Override\n public void onCameraOpenFailed(Exception e) {\n }", "public void drawImage() {\n ImageView imageView = (ImageView) findViewById(R.id.photo);\n imageView.setVisibility(View.VISIBLE);\n Glide.with(MainActivity.this).load(iURI).fitCenter().into(imageView);\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n if (requestCode == REQUEST_IMAGE_CAPTURE && resultCode == RESULT_OK) {\n Bundle extras = data.getExtras();\n Bitmap imageBitmap = (Bitmap) extras.get(\"data\");\n\n detextTextFromImage(imageBitmap);\n\n }\n }", "private void drawImages() {\n\t\t\r\n\t}", "public void onLaunchCamera(View view) {\n Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);\n\n\n data.insertAnImage(OptionID.get(alg), null);\n Cursor imageCursor = data.getImageData(OptionID.get(alg));\n imageCursor.moveToNext();\n intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(getPhotoFileUri(imageCursor.getString(0))))); // set the image file name\n\n // If you call startActivityForResult() using an intent that no app can handle, your app will crash.\n // So as long as the result is not null, it's safe to use the intent.\n if (intent.resolveActivity(getPackageManager()) != null) {\n // Start the image capture intent to take photo\n startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);\n }\n }", "@Override\n\t\t\tprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\t\t\tsuper.onActivityResult(requestCode, resultCode, data);\n\n\t\t\t\tif (SdCardUtil.checkSdCard() == true) {\n\t\t\t\t\tif (requestCode == 1 && resultCode==RESULT_OK) {\n\t\t\t\t\t\tLog.e(\"ERROR\",\"准备显示\");\n\t\t\t\t\t\tgetImaged(data);\n\t\t\t\t\t} else if (requestCode == 2 && resultCode==RESULT_OK) {\n\t\t\t\t\t\tgetImaged(data);\n\t\t\t\t\t} else if (requestCode == 3 && resultCode==RESULT_OK) {\n\t\t\t\t\t\tgetImaged(data);\n\t\t\t\t\t} else if (requestCode == 4 && resultCode==RESULT_OK) {\n\t\t\t\t\t\tgetImaged(data);\n\t\t\t\t\t} else if (requestCode == 5 && resultCode==RESULT_OK) {\n\t\t\t\t\t\tgetImaged(data);\n\t\t\t\t\t} else if (requestCode == 6 && resultCode==RESULT_OK) {\n\t\t\t\t\t\tgetImaged(data);\n\t\t\t\t\t}else if(requestCode==7 && resultCode==RESULT_OK){\n\t\t\t\t\t\tContentResolver resolver = getContentResolver();\n\t\t\t\t\t\tUri uri=data.getData();\n\t\t\t\t\t\tBitmap bm=null;\n\t\t\t\t\t\tif(uri!=null){\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tbm = MediaStore.Images.Media.getBitmap(resolver, uri);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tLog.e(\"ERROR\",\"获取路径成功\");\n\t\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t\t// TODO 自动生成的 catch 块\n\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(bm!=null){\n\t\t\t\t\t\t\tBitmap resizeBmp = ThumbnailUtils.extractThumbnail(bm, 88, 88); \n\t\t\t\t\t\t\tallImages.add(allImages.size()-1,resizeBmp);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tgridAdapter.notifyDataSetChanged();\n\t\t\t\t\t\t\tLog.e(\"ERROR\",\"GirdView显示成功\");\n\t\t\t\t\t\t\tsaveImageToFile(bm);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/*String[] proj = {MediaStore.Images.Media.DATA};\n\t\t\t\t\t\t \n\t\t\t\t //好像是android多媒体数据库的封装接口,具体的看Android文档\n\t\t\t\t Cursor cursor = managedQuery(uri, proj, null, null, null); \n\t\t\t\t //按我个人理解 这个是获得用户选择的图片的索引值\n\t\t\t\t int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);\n\t\t\t\t //将光标移至开头 ,这个很重要,不小心很容易引起越界\n\t\t\t\t cursor.moveToFirst();\n\t\t\t\t //最后根据索引值获取图片路径\n\t\t\t\t String path = cursor.getString(column_index);\n\t\t\t\t imageUrl.add(path);*/\n\t\t\t\t\t\t//getImaged(data);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//显得到bitmap图片\n\t\t\t\t\t\t/*\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcropImage(uri, 150, 150, 8);\n\t\t\t\t\t\t} catch (Exception 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}/**\n\t\t\t\t\t\t裁剪完图片\n\t\t\t\t\t*/\n\t\t\t\t\telse if(requestCode==8 && resultCode==RESULT_OK){\n\t\t\t\t\t\t\n\t\t\t\t\t\tBitmap photo = null;\n\t\t\t\t\t\tUri photoUri = data.getData();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (photoUri != null) {\n\t\t\t\t\t\t\tphoto = BitmapFactory.decodeFile(photoUri.getPath());\n\t\t\t\t\t\t\tLog.e(\"ERROR\",\"没图片\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (photo == null) {\n\t\t\t\t\t\t\tBundle extra = data.getExtras();\n\t\t\t\t\t\t\tif (extra != null) {\n\t\t\t\t photo = (Bitmap)extra.get(\"data\"); \n\t\t\t\t Log.e(\"ERROR\",\"传入失败\");\n\t\t\t\t ByteArrayOutputStream stream = new ByteArrayOutputStream(); \n\t\t\t\t photo.compress(Bitmap.CompressFormat.JPEG, 100, stream);\n\t\t\t\t } \n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(photo!=null){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tBitmap resizeBmp = ThumbnailUtils.extractThumbnail(photo, 88, 88); \n\t\t\t\t\t\t\tallImages.add(allImages.size()-1,resizeBmp);\n\t\t\t\t\t\t\tLog.e(\"ERROR\",\"传入成功\");\n\t\t\t\t\t\t\tgridAdapter.notifyDataSetChanged();\n\t\t\t\t\t\t\tsaveImageToFile(photo);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\tToast.makeText(context, \"SD卡不存在,请检查您的sd卡\",\n\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t\t}\n\t\t\t}", "@Override\n\tprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\tsuper.onActivityResult(requestCode, resultCode, data);\n\t\tif (resultCode == RESULT_OK) {\n\t\t\tswitch (requestCode) {\n//\t\t\tcase EDIT_FROM_EDITOR:\n//\t\t\t\tbyte[] bb = data.getByteArrayExtra(\"bitmap\");\n//\t\t\t\tBitmap tmp_bitmap = BitmapFactory.decodeByteArray(bb, 0,\n//\t\t\t\t\t\tbb.length);\n//\t\t\t\tcur_bitmap_list.add(tmp_bitmap);\n//\t\t\t\tiv_seller_reply_img.setImageBitmap(cur_bitmap_list.get(0));\n//\t\t\t\tbreak;\n\t\t\tcase PICK_FROM_ALBUM :\n//\t\t\t\tIntent intent = new Intent(Consumer_post.this, ImageEditActivity.class);\n//\t\t\t\tintent.putExtra(\"output\", data.getData());\n//\t\t\t\tintent.putExtra(\"flag\", \"album\");\n//\t\t\t\tstartActivityForResult(intent, EDIT_FROM_EDITOR);\n\t\t\t\tif (!addImage(data)) {\n\t\t\t\t\tToast.makeText(Seller_reply.this, \"사진 첨부 실패\",\n\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t\t}\n\t\t\t\tbreak;\n//\t\t\tcase PICK_FROM_CAMERA:\n//\t\t\t\tIntent intent2 = new Intent(Seller_reply.this,\n//\t\t\t\t\t\tImageEditActivity.class);\n//\t\t\t\tintent2.putExtra(\"output\", path + \"/\" + TEMP_IMAGE);\n//\t\t\t\tintent2.putExtra(\"flag\", \"camera\");\n//\t\t\t\tstartActivityForResult(intent2, EDIT_FROM_EDITOR);\n//\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n\tprotected void updateImage(final IScope scope) {\n\t}", "@Override\n public void onImgClick(int pos, int reviewPos) {\n startPreviewImgActivity(pos, reviewPos);\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tif (mProImage != null) {\n\t\t\t\t\tMediaStore.Images.Media.insertImage(getContentResolver(),\n\t\t\t\t\t\t\tmProImage, \"QRImage\", \"QRImage\");\n\t\t\t\t\tToast.makeText(ImageShareActivity.this, \"生成成功,请到相册查看\",\n\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t} else {\n\t\t\t\t\tToast.makeText(ImageShareActivity.this, \"图片生成错误,请返回重试\",\n\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t}\n\t\t\t}", "private void getSampleImage() {\n\t\t_helpingImgPath = \"Media\\\\\"+_camType.toString()+_downStream.toString()+_camProfile.toString()+\".bmp\";\n//\t\tswitch( _downStream ){\n//\t\tcase DownstreamPage.LEVER_NO_DOWNSTREAM:\n//\t\t\tswitch ( _camProfile )\n//\t\t\t{\n//\t\t\tcase CamProfilePage.LEVER_BEAD_CAM:\n//\t\t\t\tbreak;\n//\t\t\tcase CamProfilePage.LEVER_DOUBLE_CAM:\n//\t\t\t\tbreak;\n//\t\t\tcase CamProfilePage.LEVER_GROOVE_CAM:\n//\t\t\t\tbreak;\n//\t\t\tcase CamProfilePage.LEVER_OUTER_CAM:\n//\t\t\t\tbreak;\t\n//\t\t\t}\n//\t\t\tbreak;\n//\t\tcase DownstreamPage.LEVER_CRANK:\n//\t\t\tbreak;\n//\t\tcase DownstreamPage.LEVER_FOUR_JOIN:\n//\t\t\tbreak;\n//\t\tcase DownstreamPage.LEVER_PUSHER_TUGS:\n//\t\t\tbreak;\n//\t\tcase DownstreamPage.CAMS_CRANK:\n//\t\t\tswitch ( _camProfile )\n//\t\t\t{\n//\t\t\tcase CamProfilePage.SLIDER_BEAD_CAM:\n//\t\t\t\tbreak;\n//\t\t\tcase CamProfilePage.SLIDER_DOUBLE_CAM:\n//\t\t\t\tbreak;\n//\t\t\tcase CamProfilePage.SLIDER_GROOVE_CAM:\n//\t\t\t\tbreak;\n//\t\t\tcase CamProfilePage.SLIDER_OUTER_CAM:\n//\t\t\t\tbreak;\n//\t\t\t}\n//\t\t\tbreak;\n//\t\tcase DownstreamPage.CAMS_DOUBLE_SLIDE:\n//\t\t\tbreak;\n//\t\tcase DownstreamPage.CAMS_NO_DOWNSTREAM:\n//\t\t\tbreak;\n//\t\t}\n\t\t\n\t}", "@Override\n protected void onActivityResult(int id, int result, Intent data) {\n if(result == RESULT_OK)\n {\n //check if its the choose image activity\n if(id == CHOOSE_IMAGE_ID)\n {\n Uri imageAddress = data.getData();\n //used to read image data\n InputStream inStream;\n\n try\n {\n inStream = getContentResolver().openInputStream(imageAddress);\n\n teamLogo = BitmapFactory.decodeStream(inStream);\n imageButton.setImageBitmap(teamLogo);\n }\n catch (FileNotFoundException e)\n {\n e.printStackTrace();\n }\n }\n }\n }", "@Override\n public void onCreate(Bundle savedInstanceState){\n super.onCreate(savedInstanceState);\n\n //do nothing. Will try to load images at this point for now. Failed\n\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == CAMERA_CAPTURE_IMAGE_REQUEST_CODE) {\n if (resultCode == RESULT_OK) {\n // successfully captured the image\n // display it in image view\n Utils.previewCapturedImage(this, realm, Integer.valueOf(station.getId()));\n //Toast.makeText(getApplicationContext(),intent.getStringExtra(\"id_station\"), Toast.LENGTH_SHORT).show();\n } else if (resultCode == RESULT_CANCELED) {\n // user cancelled Image capture\n Toast.makeText(getApplicationContext(),\n \"User cancelled image capture\", Toast.LENGTH_SHORT)\n .show();\n } else {\n // failed to capture image\n Toast.makeText(getApplicationContext(),\n \"Sorry! Failed to capture image\", Toast.LENGTH_SHORT)\n .show();\n }\n }\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n switch (requestCode) {\n case REQUEST_SELECT_IMAGE_1:\n if (resultCode == RESULT_OK) {\n // If image is selected successfully, set the image URI and bitmap.\n mImageUri1 = null;\n mBitmap1 = null;\n mImageUri1 = data.getData();\n mBitmap1 = ImageHelper.loadSizeLimitedBitmapFromUri(\n mImageUri1, getContentResolver());\n if (mBitmap1 != null) {\n // Show the image on screen.\n ImageView imageView = (ImageView) findViewById(R.id.image_0);\n imageView.setImageBitmap(mBitmap1);\n\n }\n // Clear the information panel.\n setInfo(\"\");\n\n // Enable button \"show baby\" as the image to detect is not selected.\n setShowButtonsEnabledStatus(true);\n }\n break;\n case REQUEST_SELECT_IMAGE_2:\n if (resultCode == RESULT_OK) {\n // If image is selected successfully, set the image URI and bitmap.\n mImageUri2 = null;\n mBitmap2 = null;\n mImageUri2 = data.getData();\n mBitmap2 = ImageHelper.loadSizeLimitedBitmapFromUri(\n mImageUri2, getContentResolver());\n if (mBitmap2 != null) {\n // Show the image on screen.\n ImageView imageView = (ImageView) findViewById(R.id.image_1);\n imageView.setImageBitmap(mBitmap2);\n\n }\n // Clear the information panel.\n setInfo(\"\");\n\n // Enable button \"show baby\" as the image to detect is not selected.\n setShowButtonsEnabledStatus(true);\n }\n break;\n default:\n break;\n }\n }", "public void imageclick(View view)\n {\n //for logo image upload\n\n\n Intent i =new Intent();\n i.setType(\"image/*\");\n i.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(i,\"select an image\"),imagerequestcode);\n\n }", "@Override\n\tpublic void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\tsuper.onActivityResult(requestCode, resultCode, data);\n\t\tLog.e(\"on success\", \"on success\");\n\t\tBitmap s = null;\n\n\t\tif (resultCode == getActivity().RESULT_OK) {\n\t\t\t// user is returning from capturing an image using the camera\n\t\t\tif (requestCode == CAMERA_CAPTURE) {\n\t\t\t\tLog.e(\"camera\", \"camera\");\n\t\t\t\tpicUri = data.getData();\n\t\t\t\tBundle extras = data.getExtras();\n\t\t\t\t// get the cropped bitmap\n\t\t\t\tBitmap thePic = extras.getParcelable(\"data\");\n\t\t\t\tsavetoaFileLocation(thePic);\n\t\t\t\tthePic = getResizedBitmap(thePic, 200, 200);\n\t\t\t\tcameraBitmap = thePic;\n\t\t\t\t// ImageView picView = (ImageView)\n\t\t\t\t// findViewById(R.id.img_userimage);\n\t\t\t\t// display the returned cropped image\n\t\t\t\tprofileimageeditflag=\"true\";\n\t\t\t\tGraphicsUtil graphicUtil = new GraphicsUtil();\n\t\t\t\t// picView.setImageBitmap(graphicUtil.getRoundedShape(thePic));\n\t\t\t\t\n\t\t\t\tpicview1.setImageBitmap(graphicUtil.getCircleBitmap(thePic, 16));\n\t\t\t\t//picview1.setImageBitmap(cameraBitmap);\n\t\t\t} else if (requestCode == GALLERY_CAPTURE) {\n\n\n\n\n\t\t\t\tUri selectedImage = data.getData();\n\n\t\t\t\tString stringUri;\n\t\t\t\tstringUri = selectedImage.toString();\n\t\t\t\tif ((stringUri != \"\") || stringUri != null) {\n\n\t\t\t\t\tString selectedImagePath = getPath(selectedImage);\ntry {\n\tExifInterface exifInterface = new ExifInterface(selectedImagePath);\n\torientation = exifInterface.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);\n\n}\ncatch (Exception e){}\n\n\n\n\t\t\t\t\tString[] filePathColumn = { MediaStore.Images.Media.DATA };\n\t\t\t\t\tCursor cursor = getActivity().getContentResolver().query(\n\t\t\t\t\t\t\tselectedImage, filePathColumn, null, null, null);\n\t\t\t\t\tcursor.moveToFirst();\n\t\t\t\t\tint columnIndex = cursor.getColumnIndex(filePathColumn[0]);\n\t\t\t\t\tString selectedimage_path = cursor.getString(columnIndex);\n\t\t\t\t\tLog.e(\"selected path\",selectedimage_path);\n\t\t\t\t\tcursor.close();\n\t\t\t\t\tif (selectedimage_path.startsWith(\"https://\")) {\n\t\t\t\t\t\tgetBiymapFromGoogleLocation(selectedimage_path);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts = getBitmapFromFile(selectedimage_path);\n\t\t\t\t\t}\n\t\t\t\t\ts = getResizedBitmap(s, 200, 200);\n\t\t\t\t\tcameraBitmap = s;\n\n\t\t\t\t\tswitch(orientation) {\n\t\t\t\t\t\tcase ExifInterface.ORIENTATION_ROTATE_90:\n\t\t\t\t\t\t\tcorrectedBitMap = rotateImage(cameraBitmap, 90);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase ExifInterface.ORIENTATION_ROTATE_180:\n\t\t\t\t\t\t\tcorrectedBitMap = rotateImage(cameraBitmap, 180);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase ExifInterface.ORIENTATION_ROTATE_270:\n\t\t\t\t\t\t\tcorrectedBitMap = rotateImage(cameraBitmap, 270);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tcorrectedBitMap=cameraBitmap;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\n\n\n\n\n\n\n\n\n\t\t\t\t\t// ImageView picView = (ImageView)\n\t\t\t\t\t// findViewById(R.id.img_userimage);\n\t\t\t\t\t// display the returned cropped image\nprofileimageeditflag=\"true\";\n\t\t\t\t\tGraphicsUtil graphicUtil = new GraphicsUtil();\n\n\n\t/*\t\t\t\tif(correctedBitMap!= null)\n\t\t\t\t\t{\n\t\t\t\t\t\tpicView.setImageBitmap(graphicUtil.getCircleBitmap(\n\t\t\t\t\t\t\t\tcorrectedBitMap, 16));\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t// picView.setImageBitmap(graphicUtil.getRoundedShape(thePic));\n\t\t\t\t\t\tpicView.setImageBitmap(graphicUtil.getCircleBitmap(\n\t\t\t\t\t\t\t\tcameraBitmap, 16));\n\t\t\t\t\t}\n\n*/\n\n\t\t\t\t\tif (correctedBitMap != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tpicview1.setImageBitmap(graphicUtil.getCircleBitmap(correctedBitMap, 16));\n\t\t\t\t\t\tsavetoaFileLocation(correctedBitMap);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tpicview1.setImageBitmap(graphicUtil.getCircleBitmap(s, 16));\n\t\t\t\t\t\tsavetoaFileLocation(s);\n\t\t\t\t\t}\n\n\n\n\t\t\t\t\t// picView.setImageBitmap(graphicUtil.getRoundedShape(thePic));\n\t\t\t\n\t\t\t\t//\tpicview1.setImageBitmap(graphicUtil.getCircleBitmap(s, 16));\n\t\t\t\t//\tpicview1.setImageBitmap(cameraBitmap);\n\t\t\t\t//\tsavetoaFileLocation(s);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}", "void mo36481a(int i, ImageView imageView, Uri uri);", "public void initImage() {\n if (isInited())\n return;\n //获取大图的游标\n Cursor cursor = context.getContentResolver().query(\n MediaStore.Images.Media.EXTERNAL_CONTENT_URI, // 大图URI\n STORE_IMAGES, // 字段\n null, // No where clause\n null, // No where clause\n MediaStore.Images.Media.DATE_TAKEN + \" DESC\"); //根据时间升序\n Log.e(\"eeeeeeeeeeeeeeeeeee\", \"------cursor:\" + cursor);\n if (cursor == null)\n return;\n while (cursor.moveToNext()) {\n int id = cursor.getInt(0);//大图ID\n String path = cursor.getString(1);//大图路径\n LogTool.setLog(\"大图路径1\", path);\n File file = new File(path);\n //判断大图是否存在\n if (file.exists()) {\n //小图URI\n String thumbUri = getThumbnail(id, path);\n //获取大图URI\n String uri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI.buildUpon().\n appendPath(Integer.toString(id)).build().toString();\n LogTool.setLog(\"大图路径2\", uri);\n if (Tools.isEmpty(uri))\n continue;\n if (Tools.isEmpty(thumbUri))\n thumbUri = uri;\n //获取目录名\n String folder = file.getParentFile().getName();\n String appFile = context.getResources().getString(R.string.app_name);\n if (!folder.equals(appFile)) {\n LocalFile localFile = new LocalFile();\n localFile.setPath(path);\n localFile.setOriginalUri(uri);\n localFile.setThumbnailUri(thumbUri);\n int degree = cursor.getInt(2);\n if (degree != 0) {\n degree = degree + 180;\n }\n localFile.setOrientation(360 - degree);\n\n\n paths.add(localFile);\n\n\n //判断文件夹是否已经存在\n if (folders.containsKey(folder)) {\n folders.get(folder).add(localFile);\n } else {\n List<LocalFile> files = new ArrayList<>();\n files.add(localFile);\n folders.put(folder, files);\n }\n }\n }\n }\n folders.put(\"所有图片\", paths);\n cursor.close();\n isRunning = false;\n }", "private void reanderImage(ImageData data) {\n \n }" ]
[ "0.66031927", "0.65891594", "0.64500546", "0.64445585", "0.6426221", "0.6419445", "0.6374339", "0.6353671", "0.6330666", "0.6296851", "0.62797916", "0.62538886", "0.62302285", "0.6228939", "0.6213444", "0.6210674", "0.6179723", "0.61598986", "0.61568594", "0.61445767", "0.61241585", "0.6109688", "0.6095562", "0.60906", "0.60615957", "0.6044949", "0.6041913", "0.60394937", "0.60365766", "0.60265446", "0.6023347", "0.6020189", "0.60119635", "0.6009504", "0.60051376", "0.59931254", "0.59913915", "0.5978998", "0.59757465", "0.5972802", "0.59715474", "0.59709203", "0.59661674", "0.59659123", "0.5960128", "0.59588176", "0.5956485", "0.5941369", "0.59385735", "0.59380174", "0.59335566", "0.5920657", "0.591434", "0.5913478", "0.5895161", "0.5891743", "0.5890514", "0.5890459", "0.5889796", "0.5887736", "0.5887719", "0.5887424", "0.5883386", "0.58813757", "0.58812594", "0.5881103", "0.5874111", "0.5870992", "0.5869549", "0.58644456", "0.5863235", "0.58631116", "0.5860899", "0.5860176", "0.58592355", "0.5859041", "0.58582765", "0.5856377", "0.58522296", "0.5849524", "0.5846256", "0.5845027", "0.5844447", "0.58438116", "0.5843741", "0.5842097", "0.58409023", "0.58404154", "0.5839064", "0.5837981", "0.583648", "0.58357304", "0.58346766", "0.5826907", "0.58217365", "0.5820299", "0.5818075", "0.58157825", "0.5814186", "0.5813915", "0.5812766" ]
0.0
-1
Permite revisar si alguno de los campos para ingresar la ip de RMI se encuentra vacio
public boolean verificarCamposVaciosIPRMI(TextField campoIPRMI1, TextField campoIPRMI2, TextField campoIPRMI3, TextField campoIPRMI4) { boolean camposLlenos = true; if (campoIPRMI1.getText().isEmpty() || campoIPRMI2.getText().isEmpty() || campoIPRMI3.getText().isEmpty() || campoIPRMI4.getText().isEmpty()) { camposLlenos = false; } return camposLlenos; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean verificarCamposVaciosIPNode(TextField campoIPNode1, TextField campoIPNode2, TextField campoIPNode3, TextField campoIPNode4, TextField campoPuertoNode) {\n boolean camposLlenos = true;\n if (campoIPNode1.getText().isEmpty() || campoIPNode2.getText().isEmpty() || campoIPNode3.getText().isEmpty() || campoIPNode4.getText().isEmpty() || campoPuertoNode.getText().isEmpty()) {\n camposLlenos = false;\n }\n return camposLlenos;\n }", "public void setValues() throws UnknownHostException\n\t{\n\t\tipInsurance.setText(getIPAddress());\n\t\tipInsurance.setEnabled(false);\n\t\tipInsurance.setEditable(false);\n\t\tportInsurance.setText(\"\"+Constants.RMI_PORT_INSURANCE);\n\t\t\n\t\tipHospital.setText(\"\"+Constants.RMI_ADDRESS_HOSPITAL);\n\t\tportHospital.setText(\"\"+Constants.RMI_PORT_HOSPITAL);\n\t\t\n\t}", "private void clearInIp() {\n \n inIp_ = 0;\n }", "private void clearInIp() {\n \n inIp_ = 0;\n }", "private void checkAddress() {\n\t\t// if \"Set Address\" has not been performed then give the message to set\n\t\t// it first\n\t\tif (null == oscPort) {\n\t\t\tshowError(\"Please set an address first\");\n\t\t}\n\t}", "public boolean isSetStrIP() {\n return this.strIP != null;\n }", "public boolean isSetClient_ip() {\n return this.client_ip != null;\n }", "public void remplireListeIp(){\r\n bddIp.add(\"id\");\r\n bddIp.add(\"ip\");\r\n bddIp.add(\"nom\");\r\n bddIp.add(\"latence\");\r\n bddIp.add(\"etat\");\r\n bddIp.add(\"popup\");\r\n bddIp.add(\"mac\");\r\n bddIp.add(\"bdext_perte\");\r\n bddIp.add(\"port\");\r\n }", "boolean hasIp();", "boolean hasIp();", "boolean hasIp();", "boolean hasIp();", "public void setIp(java.lang.String param){\r\n localIpTracker = true;\r\n \r\n this.localIp=param;\r\n \r\n\r\n }", "public void setIp(java.lang.String param){\r\n localIpTracker = true;\r\n \r\n this.localIp=param;\r\n \r\n\r\n }", "private void clearIp() {\n \n ip_ = 0;\n }", "private void clearIp() {\n \n ip_ = 0;\n }", "public boolean verifyFields()\n\t{\n\t\t// check name first\n\t\tif (!validateUserName(username.getText()))\n\t\t\treturn false;\n\n\t\t// check address if name is valid\n\t\tif (!validateIP(address.getText()))\n\t\t{\n\t\t\tsetWarning(\"invalid address\");\n\t\t\treturn false;\n\t\t}\n\n\t\t// only check port if name and address are okay\n\t\ttry\n\t\t{\n\t\t\tInteger.parseInt(port.getText());\n\t\t}\n\t\tcatch (NumberFormatException e)\n\t\t{\n\t\t\tsetWarning(\"invalid port number\");\n\t\t\treturn false;\n\t\t}\n\n\t\tstatus.setTextFill(GREEN);\n\t\tstatus.setText(\"attempting connection\");\n\n\t\treturn true;\n\t}", "public boolean salvarIPDAO() throws ClassNotFoundException, UnknownHostException, SQLException {\n\n conectar();\n ValidaIP vip = new ValidaIP();\n if (vip.getIpLocalhost() != null) {\n String sql = \"INSERT INTO tbl_ip(\"\n + \"codigo_ip) \"\n + \"VALUES (?)\";\n PreparedStatement preparedStatement = criarPreparedStatement(sql, Statement.RETURN_GENERATED_KEYS);\n try {\n\n preparedStatement.setString(1, vip.getIpLocalhost());\n preparedStatement.executeUpdate();\n } catch (SQLException ex) {\n Logger.getLogger(DAOValidaIP.class.getName()).log(Level.SEVERE, null, ex);\n return false;\n }\n }\n desconectar();\n return true;\n }", "@Override\n protected void onResume() {\n super.onResume();\n // 保存周期\n // editor.putInt(\"cycle\", cycl[timeCycle.getSelectedItemPosition()]);\n // editor.commit();\n\n // boolean isIP = Util.isIpv4(ip.getText().toString());\n // if(isIP==false)\n // {\n // new\n // AlertDialog.Builder(Set.this).setTitle(\"提示\").setMessage(\"IP地址不合法,请重新输入!\")\n // .setCancelable(false)\n // .setPositiveButton(\"确定\", new DialogInterface.OnClickListener() {\n // @Override\n // public void onClick(DialogInterface dialog, int which) {\n // // TODO Auto-generated method stub\n // dialog.dismiss();\n // ip.setText(\"\");\n // }\n // }).create().show();\n // }\n // else\n // {\n // editor.putString(\"server_ip\", ip.getText().toString());\n // editor.commit();\n // }\n }", "public boolean hasIp() {\n return ((bitField0_ & 0x00000100) == 0x00000100);\n }", "public boolean hasIp() {\n return ((bitField0_ & 0x00000100) == 0x00000100);\n }", "public void checkAndUpdateIPAddresses() {\n\n List<IPAddresses> ipAddressesFromDB = ipAddressRepository.findAll();\n String ipAddressesFromPropertyFile = environment.getProperty(\"ipAddresses\");\n LinkedList<String> ipAddList = new LinkedList<String>(Arrays.asList(ipAddressesFromPropertyFile.split(\",\")));\n\n List<String> dbIPAddresses = new ArrayList<String>();\n\n ipAddressesFromDB.forEach(ipAddressObj -> {\n dbIPAddresses.add(ipAddressObj.getIpaddress());\n });\n\n CMADLogger.logInfo(this.getClass().getName(), \"dbIPAddresses \" + dbIPAddresses);\n CMADLogger.logInfo(this.getClass().getName(), \"ipAddList \" + ipAddList);\n\n ipAddList.removeAll(dbIPAddresses);\n\n CMADLogger.logInfo(this.getClass().getName(), \"IPAddresses to Save is: \" + ipAddList);\n\n List<IPAddresses> ipAddressesToSave = new ArrayList<IPAddresses>();\n\n CMADLogger.logInfo(this.getClass().getName(), \"IPAddress will update to db are:\");\n\n ipAddList.forEach(ipAddress -> {\n IPAddresses ipAddressObject = new IPAddresses();\n CMADLogger.logInfo(this.getClass().getName(), ipAddress.trim());\n ipAddressObject.setIpaddress(ipAddress.trim());\n ipAddressesToSave.add(ipAddressObject);\n });\n CMADLogger.logInfo(this.getClass().getName(), \"IPAddress update to db done.\");\n\n if (ipAddressesToSave.size() > 0) {\n ipAddressRepository.saveAll(ipAddressesToSave);\n latch1.countDown();\n }\n\n try {\n latch1.await();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n }", "public boolean hasIp() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "public boolean hasIp() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "public boolean hasIp() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "private boolean hayCamposVacios() {\r\n\t\tif(nomTextField.getText().isEmpty()\r\n\t\t\t|| claveTextField.getText().isEmpty()\r\n\t\t\t\t|| reingresoTextField.getText().isEmpty()\r\n\t\t\t\t\t|| preguntaTextField.getText().isEmpty()\r\n\t\t\t\t\t\t|| respuestaTextField.getText().isEmpty())\r\n\t\t\treturn true;\t\t\r\n\t\treturn false;\r\n\t}", "public boolean hasIp() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "private boolean checkAddrInputFields(){\n \tboolean same = textFieldCurrents.get(jTextFieldStart).equals(jTextFieldStart.getText()) &&\n\t\t\t\ttextFieldCurrents.get(jTextFieldEnd).equals(jTextFieldEnd.getText()) &&\n\t\t\t\tjComboBoxFormat.getSelectedIndex() == selectedFormat &&\n\t\t\t\tjCheckBoxQuickSearch.isSelected() == quickSearch;\n \t\n \tif(DEBUG){\n \t\toutputResults(\"lasts:\");\n \t\toutputResults(textFieldCurrents.get(jTextFieldStart));\n\t\t\toutputResults(textFieldCurrents.get(jTextFieldEnd));\n\t\t\toutputResults(\"\"+jComboBoxFormat.getSelectedIndex()); \n\t\t\toutputResults(\"nows:\");\n\t\t\toutputResults(jTextFieldEnd.getText());\n\t\t\toutputResults(jTextFieldStart.getText());\n\t\t\toutputResults(\"\"+selectedFormat);\n \t}\n \t\n \tif(!same){\n \t\tjButtonGetDirections.setText(\"Find Directions!\");\n \t}else{\n \t\tjButtonGetDirections.setText(\"Refresh Map\");\n \t}\n \treturn same;\n }", "public boolean hasIp() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "private void init() {\n ip = SPUtils.get(this, Constant.SP_SERVICE_IP, \"\").toString();\n port = SPUtils.get(this, Constant.SP_SERVICE_PORT, \"\").toString();\n\n if (TextUtils.isEmpty(ip) || TextUtils.isEmpty(port)){\n editPort.setText(getResources().getString(R.string.default_port));\n editIp.setText(getResources().getString(R.string.default_ip));\n }else{\n editIp.setText(ip);\n editPort.setText(port);\n }\n }", "public boolean hasIp() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "private boolean checkHostAddressesFieldsChanged() {\n boolean changed = false;\n for (final Host host : getBrowser().getClusterHosts()) {\n final GuiComboBox cb = addressComboBoxHash.get(host);\n if (cb == null) {\n continue;\n }\n final String haSaved = savedHostAddresses.get(host);\n final Object value = cb.getValue();\n if (!Tools.areEqual(haSaved, value)) {\n changed = true;\n }\n cb.setBackground(null, haSaved, false);\n }\n /* port */\n final GuiComboBox pcb = portComboBox;\n if (pcb != null) {\n if (!Tools.areEqual(savedPort, pcb.getValue())) {\n changed = true;\n }\n pcb.setBackground(null,\n savedPort,\n false);\n }\n return changed;\n }", "public void setIp(String ip) {\n this.ip = ip;\n }", "@Override\n\t\tpublic void ipChange() {\n\t\t\t\n\t\t}", "public boolean isSetUserIp() {\n return this.userIp != null;\n }", "public boolean isSetUserIp() {\n return this.userIp != null;\n }", "public void setIp(String ip) {\n this.ip = ip;\n }", "public void setIp(String ip) {\n this.ip = ip;\n }", "boolean known() {\n\t\t\treturn !varAddress && !varMask;\n\t\t}", "private void validateFields() {\n\t\t// TODO validate ID\n\t\tboolean valid = (mEdtAddress.getText().length() > 2)\n\t\t\t\t&& (mEdtPassword.getText().length() > 0);\n\t\tmBtnNext.setEnabled(valid);\n\t}", "public boolean hasReqRemoteAddr() {\n return fieldSetFlags()[3];\n }", "private void verifyExistIp(String ip){\n List ips = logRepositoy.findByIp(ip);\n if(ips.isEmpty()){\n throw new ResourceNotFoundException(\"Ip address not found\");\n }\n }", "public void setIp(String ip) {\n this.ip = ip;\n }", "private void setInIp(int value) {\n \n inIp_ = value;\n }", "private void setInIp(int value) {\n \n inIp_ = value;\n }", "private void checkAndUpdate() {\n if (csProposeEnter.get()) {\n if (numRepliesReceived.get() == (config.getNumNodes() - 1)\n && requestQueue.peek().getFromID().equals(nodeID)) {\n csProposeEnter.set(false);\n csAllowEnter.set(true);\n }\n }\n }", "public boolean verificarLongitudCamposIPNode(TextField campoIPNode1, TextField campoIPNode2, TextField campoIPNode3, TextField campoIPNode4) {\n boolean camposCorrectos = true;\n if (campoIPNode1.getText().length() > 3 || campoIPNode2.getText().length() > 3 || campoIPNode3.getText().length() > 3 || campoIPNode4.getText().length() > 3) {\n camposCorrectos = false;\n }\n return camposCorrectos;\n }", "private boolean needPIN() {\n return datafacade.getInt(\"pin\")!=-1;\n }", "public void queryServer()\n {\n if(!getPassword().equals(getPasswordConfirm()))\n {\n Toast.makeText( (getActivity() ) .getBaseContext(), \"Password Mismatch.\", Toast.LENGTH_SHORT).show();\n passwordEdit.setText(\"\");\n passwordConfirmEdit.setText(\"\");\n }\n else if(!noNullUserInput())\n {\n //TODO highlight unfished fields.\n Toast.makeText( (getActivity() ) .getBaseContext(), \"Finish filling out the data!\", Toast.LENGTH_SHORT).show();\n }\n else if(Model.instance().getServerHost() == null || Model.instance().getServerHost() == null )\n {\n ((FamilyMap) getActivity() ).createServerInfoQuery(this); //easy...\n }\n else\n {\n //try it out. if it fails\n WebAccess wa = new WebAccess();\n RegisterRequest rr = new RegisterRequest(this.getUserName(),this.getPassword(),this.getEmail(), this.getFirstName(), this.getLastName(), this.getGender());\n wa.execute(rr);\n deactivateButtons();\n }\n }", "private boolean checkFields() {\n\t\tboolean status = true;\n\n\t\treturn status;\n\t}", "private boolean verificarCamposVacios() {\n \n boolean bandera = false; // false = campos no vacios\n \n if(this.jTextFieldDigiteCodigo.getText().equals(\"\") || this.jTextFieldDigiteCodigo.getText().equals(\"Digite Código\"))\n {\n mostrarError(jLabelErrorDigiteCodigo, \"Rellenar este campo\",jTextFieldDigiteCodigo);\n bandera=true;\n }\n return bandera;\n }", "@FXML\n\tpublic void fifoMasterSlaveAddressValidation() {\n\t\tvalidateFifoMasterSlaveAddress(false);\n\t}", "private boolean validateFields() {\r\n\t\tif (txUsuario.getText().equals(\"\") || txPassword.getText().equals(\"\")\r\n\t\t\t\t|| checkAdmin.isIndeterminate()|| checkTPV.isIndeterminate())\r\n\t\t\treturn false;\r\n\t\treturn true;\r\n\t}", "public boolean setIP(String IP) {\n try {\n mIP = IP;\n return true;\n } catch (Exception ex) {\n return false;\n }\n }", "public void setIp(String ip) {\r\n this.ip = ip == null ? null : ip.trim();\r\n }", "public void connect_NoPERequest(BOOL newIV){\n NoPERequest = newIV;\n }", "boolean hasCanIpForward();", "public void setVIP(boolean VIP);", "@Test\n public void testInterfaceIp() throws Exception {\n isisNeighbor.setInterfaceIp(interfaceIp);\n result2 = isisNeighbor.interfaceIp();\n assertThat(result2, is(interfaceIp));\n }", "void retrieveServerIP(boolean flag) // flag is false when it is executed for first time, else label is updated\n {\n try\n {\n tempAddress = InetAddress.getLocalHost().toString().substring(InetAddress.getLocalHost().toString().lastIndexOf(\"/\")+1);\n }\n catch(Exception e)\n {\n JOptionPane.showMessageDialog(this,\"Unable to Retrieve System IP, Restart the Application and Retry\",\"Runtime Error !\",0); // EIWQ\n System.exit(0);\n }\n if(!(tempAddress.equals(serverAddress)))\n {\n serverAddress=tempAddress;\n if(flag)\n SwingUtilities.invokeLater(new Runnable()\n {\n public void run()\n {\n address.setText(\"Type this in client app : \"+serverAddress+\" \");\n }\n });\n }\n }", "public void setIp(String ip) {\n this.ip = ip == null ? null : ip.trim();\n }", "public void setIp(String ip) {\n this.ip = ip == null ? null : ip.trim();\n }", "public void setIp(String ip) {\n this.ip = ip == null ? null : ip.trim();\n }", "@Override public boolean requireAllPresenceValues() throws android.os.RemoteException\n{\nandroid.os.Parcel _data = android.os.Parcel.obtain();\nandroid.os.Parcel _reply = android.os.Parcel.obtain();\nboolean _result;\ntry {\n_data.writeInterfaceToken(DESCRIPTOR);\nmRemote.transact(Stub.TRANSACTION_requireAllPresenceValues, _data, _reply, 0);\n_reply.readException();\n_result = (0!=_reply.readInt());\n}\nfinally {\n_reply.recycle();\n_data.recycle();\n}\nreturn _result;\n}", "@FXML\n public void checkMail() throws IOException {\n if (SameAddressRadioButton.isSelected()) {\n Name9Field.setEditable(false);\n Name9Field.setDisable(true);\n Name9Field.setText(\"\");\n State9ComboBox.setDisable(true);\n State9ComboBox.setPromptText(\"State\");\n Address9Field.setEditable(false);\n Address9Field.setText(\"\");\n Address9Field.setDisable(true);\n City9Field.setEditable(false);\n City9Field.setText(\"\");\n City9Field.setDisable(true);\n Zip9Field.setEditable(false);\n Zip9Field.setText(\"\");\n Zip9Field.setDisable(true);\n } else {\n Name9Field.setEditable(true);\n Name9Field.setDisable(false);\n State9ComboBox.setDisable(false);\n State9ComboBox.setPromptText(\"State\");\n Address9Field.setEditable(true);\n Address9Field.setDisable(false);\n City9Field.setEditable(true);\n City9Field.setDisable(false);\n Zip9Field.setEditable(true);\n Zip9Field.setDisable(false);\n }\n }", "public boolean agregarServidor(String nombre,String ip){\n query=\"INSERT INTO ipServidor ('servidor','ips') VALUES ('%s','%s');\";\n System.out.print(\"Agregando servidor \"+nombre+\" \"+ip+\": \");\n query= String.format(query,nombre,ip);\n try{\n if(miBaseDatos.executeNonQuery(query)){\n System.out.println(\"Servidor agregado exitosamente\");\n return true;\n }else{\n System.out.println(\"Error al agregar servidor\");\n return false;\n }\n }catch(Exception e){\n System.out.println(e.getClass());\n System.out.println(e.getMessage());\n e.printStackTrace();\n }\n return false;\n }", "public void setDeviceIP(String argIp){\n\t deviceIP=argIp;\n }", "private void checkFieldsForEmptyValues() {\n String s1 = edtEmail.getText().toString();\n String s2 = edtDisplayName.getText().toString();\n String s3 = edtPaswd.getText().toString();\n\n if (s1.equals(\"\") || s2.equals(\"\") || s3.equals(\"\")) { //disables the button\n btnRegister.setEnabled(false);\n } else { //enables the button\n btnRegister.setEnabled(true);\n }\n }", "boolean hasBitcoinAddress();", "@Override\r\n\t@Test(groups = {\"function\",\"setting\"} ) \r\n\tpublic boolean checkInfoPort() {\n\t\tboolean flag = oTest.checkInfoPort();\r\n\t\tAssertion.verifyEquals(flag, true);\r\n\t\treturn flag;\r\n\t}", "public java.lang.String getIp(){\r\n return localIp;\r\n }", "public java.lang.String getIp(){\r\n return localIp;\r\n }", "public static void localVotouEleitor() {\n\t\tScanner sc = new Scanner(System.in);\n\t\tRegistoVoto ans = null;\n\t\tString cc, idEleicao;\n\t\tSystem.out.println(\"Insira o CC do eleitor que pretende pesquisar: \");\n\t\tcc = sc.nextLine();\n\t\tSystem.out.println(\"Insira o ID da eleicao que pretende pesquisar: \");\n\t\tidEleicao = sc.nextLine();\n\t\t\n\t\tint check = 0;\n\t\tint tries = 0;\n\t\tdo {\n\t\t\ttry {\n\t\t\t\tans = rmiserver.pesquisaLocalVoto(cc, idEleicao);\n\t\t\t\tif(ans != null) {\n\t\t\t\t\tSystem.out.println(\"\\nCC: \"+ans.cc+\"\\nID Eleicao: \"+idEleicao+\"\\nLocal: \"+ans.nomeDep+\"Data/Hora: \"+ans.dataVoto.toString());\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.println(\"Voto nao encontrado.\");\n\t\t\t\t}\n\t\t\t\tcheck = 1;\n\t\t\t} catch (RemoteException e1) {\n\t\t\t\t// Tratamento da Excepcao da chamada RMI addCandidatos\n\t\t\t\tif(tries == 0) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(6000);\n\t\t\t\t\t\t//faz novo lookup\n\t\t\t\t\t\trmiserver = (RMI_S_I) Naming.lookup(\"rmi://\"+registryIP+\":\"+registryPort+\"/rmi\");\n\t\t\t\t\t\trmiserver.subscribeConsola((ADMIN_C_I)consola);\n\t\t\t\t\t\ttries = 0;\n\t\t\t\t\t} catch (RemoteException | InterruptedException | MalformedURLException | NotBoundException e) {\n\t\t\t\t\t\t// FailOver falhou\n\t\t\t\t\t\ttries++;\n\t\t\t\t\t}\n\t\t\t\t}else if(tries > 0 && tries < 24) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(1000);\n\t\t\t\t\t\t//faz novo lookup\n\t\t\t\t\t\trmiserver = (RMI_S_I) Naming.lookup(\"rmi://\"+registryIP+\":\"+registryPort+\"/rmi\");\n\t\t\t\t\t\trmiserver.subscribeConsola((ADMIN_C_I)consola);\n\t\t\t\t\t\ttries = 0;\n\t\t\t\t\t} catch (RemoteException | InterruptedException | MalformedURLException | NotBoundException e) {\n\t\t\t\t\t\t// FailOver falhou\n\t\t\t\t\t\ttries++;\n\t\t\t\t\t}\n\t\t\t\t}else if(tries >= 24) {\n\t\t\t\t\tSystem.out.println(\"Impossivel realizar a operacao devido a falha tecnica (Servidores RMI desligados).\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}while(check==0);\n\t\tcheck = 0;\n\n\t}", "public boolean isSetFromAddress()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(FROMADDRESS$6) != 0;\n }\n }", "public void Pedircarnet() {\n\t\tSystem.out.println(\"solicitar carnet para verificar si es cliente de ese consultorio\");\r\n\t}", "public void setInsipaddr(String insipaddr) {\r\n this.insipaddr = insipaddr;\r\n }", "public void setIp(final String ip) {\n this.ip = ip;\n }", "private boolean campiVuoti(){\n return nomeVarTextField.getText().equals(\"\") || tipoVarComboBox.getSelectedIndex() == -1;\n }", "private boolean correctValues() {\n try {\n //TODO: check COM ports\n } catch (Exception e) {\n e.printStackTrace();\n return false;\n }\n return true;\n }", "private boolean validateAddress() {\n if (address==null) {\n tvAddress.setText(String.format(\"%s*\", getString(R.string.address_activity)));\n showToast(getString(R.string.error_address_required));\n return false;\n }\n return true;\n }", "public boolean getVIP();", "public void setIp(java.lang.String ip) {\r\n this.ip = ip;\r\n }", "public void setIP(String IP) {\n this.IP = IP;\n }", "private boolean formComplete(){\r\n return NAME_FIELD.getLength()>0 && ADDRESS_1_FIELD.getLength()>0 &&\r\n CITY_FIELD.getLength()>0 && ZIP_FIELD.getLength()>0 && \r\n COUNTRY_FIELD.getLength()>0 && PHONE_FIELD.getLength()>0; \r\n }", "@Override\r\n\tpublic String getIp() {\n\t\treturn null;\r\n\t}", "public void markIpAddressCreate() throws JNCException {\n markLeafCreate(\"ipAddress\");\n }", "private boolean checkPhoneStatusOK() {\n return true;\n }", "protected boolean validation() {\n\t\tcountry = et_area.getText().toString().trim();\r\n\r\n\t\tif (pin.equals(\"\")) {\r\n\t\t\tshowAlert(\"Sorry!\", \"Please enter valid Pin\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\telse\r\n\t\t\treturn true;\r\n\t}", "public void setIp (java.lang.String ip) {\r\n\t\tthis.ip = ip;\r\n\t}", "public void setIp (java.lang.String ip) {\r\n\t\tthis.ip = ip;\r\n\t}", "public Builder clearIp() {\n ip_ = getDefaultInstance().getIp();\n bitField0_ = (bitField0_ & ~0x00000002);\n onChanged();\n return this;\n }", "public String getIp(){\n\treturn ip;\n }", "abstract void addressValidity();", "@Test\n public void testSetInterfaceIp() throws Exception {\n isisNeighbor.setInterfaceIp(interfaceIp);\n result2 = isisNeighbor.interfaceIp();\n assertThat(result2, is(interfaceIp));\n }", "@Override\n\tprotected Boolean isValid(String[] fields) {\n\t\t//check - evnet_id, yes, maybe, invited, no\n return (fields.length > 4);\n\t}", "public static void alteraFac() {\n\t\tString nome, novaInfo = \"\";\n\t\tScanner sc = new Scanner(System.in);\n\t\tint check = 0;\n\n\t\tdo {\n\t\t\tSystem.out.println(\"\\nInsira o nome da faculdade:\");\n\t\t\tnome = sc.nextLine();\n\t\t\tif(verificarLetras(nome) && nome.length()>0) {\n\t\t\t\tcheck = 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"\\nO nome apenas pode conter letras\");\n\t\t\t}\n\t\t}while(check==0);\n\t\t\n\t\tcheck = 0;\n\t\t\n\t\tSystem.out.println(\"\\nQual dos campos pretende alterar?\\n1- Morada\\n2- Numero de contacto\\n3- Email de contacto\");\n\t\tString op = sc.nextLine();\n\t\t\n\t\tswitch(op) {\n\t\t\tcase \"1\":\n\t\t\t\tSystem.out.println(\"\\nInsira a nova morada:\");\n\t\t\t\tnovaInfo = sc.nextLine();\n\t\t\t\tbreak;\n\t\t\tcase \"2\":\n\t\t\t\tdo {\n\t\t\t\t\tSystem.out.println(\"Insira o numero de contacto:\\n\");\n\t\t\t\t\tnovaInfo = sc.nextLine();\n\t\t\t\t\tif(verificarNumeros(novaInfo) && novaInfo.length()<= 9) {\n\t\t\t\t\t\tif (Integer.parseInt(novaInfo) > 0) {\n\t\t\t\t\t\t\tcheck = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tSystem.out.println(\"\\nO numero so pode conter 9 digitos\");\n\t\t\t\t\t}\n\t\t\t\t}while(check==0);\n\t\t\t\tcheck = 0;\n\t\t\t\tbreak;\n\t\t\tcase \"3\":\n\t\t\t\tSystem.out.println(\"Insira o email:\\n\");\n\t\t\t\tnovaInfo = sc.nextLine();\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\tString msgServer = \"\";\n\t\t\n\t\tcheck = 0;\n\t\tint tries = 0;\n\t\tdo {\n\t\t\ttry {\n\t\t\t\tmsgServer = rmiserver.alterarFac(nome, op, novaInfo);\n\t\t\t\tSystem.out.println(msgServer);\n\t\t\t\tSystem.out.println(\"\\n\");\n\t\t\t\tcheck = 1;\n\t\t\t} catch (RemoteException e1) {\n\t\t\t\t// Tratamento da Excepcao da chamada RMI alteraFac\n\t\t\t\tif(tries == 0) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(6000);\n\t\t\t\t\t\t//faz novo lookup\n\t\t\t\t\t\trmiserver = (RMI_S_I) Naming.lookup(\"rmi://\"+registryIP+\":\"+registryPort+\"/rmi\");\n\t\t\t\t\t\trmiserver.subscribeConsola((ADMIN_C_I)consola);\n\t\t\t\t\t\ttries = 0;\n\t\t\t\t\t} catch (RemoteException | InterruptedException | MalformedURLException | NotBoundException e) {\n\t\t\t\t\t\t// FailOver falhou\n\t\t\t\t\t\ttries++;\n\t\t\t\t\t}\n\t\t\t\t}else if(tries > 0 && tries < 24) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(1000);\n\t\t\t\t\t\t//faz novo lookup\n\t\t\t\t\t\trmiserver = (RMI_S_I) Naming.lookup(\"rmi://\"+registryIP+\":\"+registryPort+\"/rmi\");\n\t\t\t\t\t\trmiserver.subscribeConsola((ADMIN_C_I)consola);\n\t\t\t\t\t\ttries = 0;\n\t\t\t\t\t} catch (RemoteException | InterruptedException | MalformedURLException | NotBoundException e) {\n\t\t\t\t\t\t// FailOver falhou\n\t\t\t\t\t\ttries++;\n\t\t\t\t\t}\n\t\t\t\t}else if(tries >= 24) {\n\t\t\t\t\tSystem.out.println(\"Impossivel realizar a operacao devido a falha tecnica (Servidores RMI desligados).\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}while(check==0);\n\t\tcheck = 0;\n\t}", "public boolean isSetMachineInnerIP() {\n return this.machineInnerIP != null;\n }", "public String getCreateip() {\n return createip;\n }", "boolean hasClientIpV4();", "public Builder clearIp() {\n bitField0_ = (bitField0_ & ~0x00000100);\n ip_ = 0;\n onChanged();\n return this;\n }" ]
[ "0.6233025", "0.6173242", "0.60421175", "0.60421175", "0.5998275", "0.59569037", "0.5854439", "0.5841359", "0.5840606", "0.5840606", "0.5840606", "0.5840606", "0.56912434", "0.56912434", "0.56706214", "0.56706214", "0.56152934", "0.5613416", "0.5611896", "0.5575022", "0.557287", "0.55537534", "0.5531121", "0.5525677", "0.55009156", "0.5498151", "0.54956675", "0.54827774", "0.5480144", "0.54737145", "0.54731363", "0.5460848", "0.54411787", "0.5431282", "0.54025865", "0.54025865", "0.54004264", "0.54004264", "0.53828", "0.5370793", "0.53585905", "0.53539467", "0.5352392", "0.5348862", "0.5348862", "0.5348497", "0.5345439", "0.53424263", "0.53405416", "0.5323302", "0.5297326", "0.52849025", "0.5279037", "0.5278389", "0.52778566", "0.5262385", "0.5256755", "0.52556074", "0.52351624", "0.5227747", "0.52245283", "0.52245283", "0.52245283", "0.52077156", "0.52062875", "0.51976055", "0.5196388", "0.51937425", "0.5192324", "0.51873094", "0.5181447", "0.5181447", "0.51795226", "0.51672155", "0.5163876", "0.5162329", "0.51567394", "0.5156246", "0.5153471", "0.51524436", "0.5151213", "0.5149956", "0.514698", "0.5146639", "0.5141869", "0.5139869", "0.5139042", "0.5130584", "0.51254725", "0.51254725", "0.5125277", "0.5121634", "0.51115775", "0.5110838", "0.51063615", "0.51061165", "0.5106066", "0.5099286", "0.5091836", "0.50902575" ]
0.57969505
12
Permite revisar si alguno de los campos para ingresar la ip de Node se encuentre vacio
public boolean verificarCamposVaciosIPNode(TextField campoIPNode1, TextField campoIPNode2, TextField campoIPNode3, TextField campoIPNode4, TextField campoPuertoNode) { boolean camposLlenos = true; if (campoIPNode1.getText().isEmpty() || campoIPNode2.getText().isEmpty() || campoIPNode3.getText().isEmpty() || campoIPNode4.getText().isEmpty() || campoPuertoNode.getText().isEmpty()) { camposLlenos = false; } return camposLlenos; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void clearInIp() {\n \n inIp_ = 0;\n }", "private void clearInIp() {\n \n inIp_ = 0;\n }", "boolean hasIp();", "boolean hasIp();", "boolean hasIp();", "boolean hasIp();", "private void checkAddress() {\n\t\t// if \"Set Address\" has not been performed then give the message to set\n\t\t// it first\n\t\tif (null == oscPort) {\n\t\t\tshowError(\"Please set an address first\");\n\t\t}\n\t}", "private void clearIp() {\n \n ip_ = 0;\n }", "private void clearIp() {\n \n ip_ = 0;\n }", "public boolean hasIp() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "public boolean hasIp() {\n return ((bitField0_ & 0x00000100) == 0x00000100);\n }", "private boolean checkHostAddressesFieldsChanged() {\n boolean changed = false;\n for (final Host host : getBrowser().getClusterHosts()) {\n final GuiComboBox cb = addressComboBoxHash.get(host);\n if (cb == null) {\n continue;\n }\n final String haSaved = savedHostAddresses.get(host);\n final Object value = cb.getValue();\n if (!Tools.areEqual(haSaved, value)) {\n changed = true;\n }\n cb.setBackground(null, haSaved, false);\n }\n /* port */\n final GuiComboBox pcb = portComboBox;\n if (pcb != null) {\n if (!Tools.areEqual(savedPort, pcb.getValue())) {\n changed = true;\n }\n pcb.setBackground(null,\n savedPort,\n false);\n }\n return changed;\n }", "public boolean isSetClient_ip() {\n return this.client_ip != null;\n }", "public boolean hasIp() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "public boolean hasIp() {\n return ((bitField0_ & 0x00000100) == 0x00000100);\n }", "public boolean hasIp() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean verificarLongitudCamposIPNode(TextField campoIPNode1, TextField campoIPNode2, TextField campoIPNode3, TextField campoIPNode4) {\n boolean camposCorrectos = true;\n if (campoIPNode1.getText().length() > 3 || campoIPNode2.getText().length() > 3 || campoIPNode3.getText().length() > 3 || campoIPNode4.getText().length() > 3) {\n camposCorrectos = false;\n }\n return camposCorrectos;\n }", "public boolean hasIp() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasIp() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasIp() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public void setValues() throws UnknownHostException\n\t{\n\t\tipInsurance.setText(getIPAddress());\n\t\tipInsurance.setEnabled(false);\n\t\tipInsurance.setEditable(false);\n\t\tportInsurance.setText(\"\"+Constants.RMI_PORT_INSURANCE);\n\t\t\n\t\tipHospital.setText(\"\"+Constants.RMI_ADDRESS_HOSPITAL);\n\t\tportHospital.setText(\"\"+Constants.RMI_PORT_HOSPITAL);\n\t\t\n\t}", "@Override\n\t\tpublic void ipChange() {\n\t\t\t\n\t\t}", "private void checkAndUpdate() {\n if (csProposeEnter.get()) {\n if (numRepliesReceived.get() == (config.getNumNodes() - 1)\n && requestQueue.peek().getFromID().equals(nodeID)) {\n csProposeEnter.set(false);\n csAllowEnter.set(true);\n }\n }\n }", "public void remplireListeIp(){\r\n bddIp.add(\"id\");\r\n bddIp.add(\"ip\");\r\n bddIp.add(\"nom\");\r\n bddIp.add(\"latence\");\r\n bddIp.add(\"etat\");\r\n bddIp.add(\"popup\");\r\n bddIp.add(\"mac\");\r\n bddIp.add(\"bdext_perte\");\r\n bddIp.add(\"port\");\r\n }", "public boolean isSetStrIP() {\n return this.strIP != null;\n }", "public void markIpAddressCreate() throws JNCException {\n markLeafCreate(\"ipAddress\");\n }", "public void checkAndUpdateIPAddresses() {\n\n List<IPAddresses> ipAddressesFromDB = ipAddressRepository.findAll();\n String ipAddressesFromPropertyFile = environment.getProperty(\"ipAddresses\");\n LinkedList<String> ipAddList = new LinkedList<String>(Arrays.asList(ipAddressesFromPropertyFile.split(\",\")));\n\n List<String> dbIPAddresses = new ArrayList<String>();\n\n ipAddressesFromDB.forEach(ipAddressObj -> {\n dbIPAddresses.add(ipAddressObj.getIpaddress());\n });\n\n CMADLogger.logInfo(this.getClass().getName(), \"dbIPAddresses \" + dbIPAddresses);\n CMADLogger.logInfo(this.getClass().getName(), \"ipAddList \" + ipAddList);\n\n ipAddList.removeAll(dbIPAddresses);\n\n CMADLogger.logInfo(this.getClass().getName(), \"IPAddresses to Save is: \" + ipAddList);\n\n List<IPAddresses> ipAddressesToSave = new ArrayList<IPAddresses>();\n\n CMADLogger.logInfo(this.getClass().getName(), \"IPAddress will update to db are:\");\n\n ipAddList.forEach(ipAddress -> {\n IPAddresses ipAddressObject = new IPAddresses();\n CMADLogger.logInfo(this.getClass().getName(), ipAddress.trim());\n ipAddressObject.setIpaddress(ipAddress.trim());\n ipAddressesToSave.add(ipAddressObject);\n });\n CMADLogger.logInfo(this.getClass().getName(), \"IPAddress update to db done.\");\n\n if (ipAddressesToSave.size() > 0) {\n ipAddressRepository.saveAll(ipAddressesToSave);\n latch1.countDown();\n }\n\n try {\n latch1.await();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n }", "public void setIp(java.lang.String param){\r\n localIpTracker = true;\r\n \r\n this.localIp=param;\r\n \r\n\r\n }", "public void setIp(java.lang.String param){\r\n localIpTracker = true;\r\n \r\n this.localIp=param;\r\n \r\n\r\n }", "@FXML\n\tpublic void fifoMasterSlaveAddressValidation() {\n\t\tvalidateFifoMasterSlaveAddress(false);\n\t}", "private boolean checkInList(String ip, int port) {\r\n\t\tif(this.ip.equals(ip) & this.port == port)\r\n\t\t\treturn true;\r\n\t\t\r\n\t\tif(nodes.size()>0) {\r\n\t\t\tSystem.out.println(\"checking if node already exists...\");\r\n\t\t\t\r\n\t\t\tfor (Node node : this.nodes) {\r\n\t\t\t\treturn node.ip.equals(ip) && node.port == port;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public void setIp(String ip) {\n this.ip = ip;\n }", "public boolean isSetUserIp() {\n return this.userIp != null;\n }", "public boolean isSetUserIp() {\n return this.userIp != null;\n }", "public boolean verifyFields()\n\t{\n\t\t// check name first\n\t\tif (!validateUserName(username.getText()))\n\t\t\treturn false;\n\n\t\t// check address if name is valid\n\t\tif (!validateIP(address.getText()))\n\t\t{\n\t\t\tsetWarning(\"invalid address\");\n\t\t\treturn false;\n\t\t}\n\n\t\t// only check port if name and address are okay\n\t\ttry\n\t\t{\n\t\t\tInteger.parseInt(port.getText());\n\t\t}\n\t\tcatch (NumberFormatException e)\n\t\t{\n\t\t\tsetWarning(\"invalid port number\");\n\t\t\treturn false;\n\t\t}\n\n\t\tstatus.setTextFill(GREEN);\n\t\tstatus.setText(\"attempting connection\");\n\n\t\treturn true;\n\t}", "public void setIp(String ip) {\r\n this.ip = ip == null ? null : ip.trim();\r\n }", "public void setIp(String ip) {\n this.ip = ip;\n }", "public void setIp(String ip) {\n this.ip = ip;\n }", "private boolean checkAddrInputFields(){\n \tboolean same = textFieldCurrents.get(jTextFieldStart).equals(jTextFieldStart.getText()) &&\n\t\t\t\ttextFieldCurrents.get(jTextFieldEnd).equals(jTextFieldEnd.getText()) &&\n\t\t\t\tjComboBoxFormat.getSelectedIndex() == selectedFormat &&\n\t\t\t\tjCheckBoxQuickSearch.isSelected() == quickSearch;\n \t\n \tif(DEBUG){\n \t\toutputResults(\"lasts:\");\n \t\toutputResults(textFieldCurrents.get(jTextFieldStart));\n\t\t\toutputResults(textFieldCurrents.get(jTextFieldEnd));\n\t\t\toutputResults(\"\"+jComboBoxFormat.getSelectedIndex()); \n\t\t\toutputResults(\"nows:\");\n\t\t\toutputResults(jTextFieldEnd.getText());\n\t\t\toutputResults(jTextFieldStart.getText());\n\t\t\toutputResults(\"\"+selectedFormat);\n \t}\n \t\n \tif(!same){\n \t\tjButtonGetDirections.setText(\"Find Directions!\");\n \t}else{\n \t\tjButtonGetDirections.setText(\"Refresh Map\");\n \t}\n \treturn same;\n }", "private boolean hayCamposVacios() {\r\n\t\tif(nomTextField.getText().isEmpty()\r\n\t\t\t|| claveTextField.getText().isEmpty()\r\n\t\t\t\t|| reingresoTextField.getText().isEmpty()\r\n\t\t\t\t\t|| preguntaTextField.getText().isEmpty()\r\n\t\t\t\t\t\t|| respuestaTextField.getText().isEmpty())\r\n\t\t\treturn true;\t\t\r\n\t\treturn false;\r\n\t}", "boolean hasBitcoinAddress();", "public void setIp(String ip) {\n this.ip = ip;\n }", "@Override\n protected void onResume() {\n super.onResume();\n // 保存周期\n // editor.putInt(\"cycle\", cycl[timeCycle.getSelectedItemPosition()]);\n // editor.commit();\n\n // boolean isIP = Util.isIpv4(ip.getText().toString());\n // if(isIP==false)\n // {\n // new\n // AlertDialog.Builder(Set.this).setTitle(\"提示\").setMessage(\"IP地址不合法,请重新输入!\")\n // .setCancelable(false)\n // .setPositiveButton(\"确定\", new DialogInterface.OnClickListener() {\n // @Override\n // public void onClick(DialogInterface dialog, int which) {\n // // TODO Auto-generated method stub\n // dialog.dismiss();\n // ip.setText(\"\");\n // }\n // }).create().show();\n // }\n // else\n // {\n // editor.putString(\"server_ip\", ip.getText().toString());\n // editor.commit();\n // }\n }", "public void setIp(String ip) {\n this.ip = ip == null ? null : ip.trim();\n }", "public void setIp(String ip) {\n this.ip = ip == null ? null : ip.trim();\n }", "public void setIp(String ip) {\n this.ip = ip == null ? null : ip.trim();\n }", "private void setInIp(int value) {\n \n inIp_ = value;\n }", "private void setInIp(int value) {\n \n inIp_ = value;\n }", "public boolean isSetFromAddress()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(FROMADDRESS$6) != 0;\n }\n }", "public Builder clearIp() {\n bitField0_ = (bitField0_ & ~0x00000100);\n ip_ = 0;\n onChanged();\n return this;\n }", "@Override\r\n\tpublic boolean hasIpAddressSupport() {\n\t\treturn false;\r\n\t}", "boolean known() {\n\t\t\treturn !varAddress && !varMask;\n\t\t}", "boolean hasCanIpForward();", "public Builder clearIp() {\n ip_ = getDefaultInstance().getIp();\n bitField0_ = (bitField0_ & ~0x00000002);\n onChanged();\n return this;\n }", "private void verifyExistIp(String ip){\n List ips = logRepositoy.findByIp(ip);\n if(ips.isEmpty()){\n throw new ResourceNotFoundException(\"Ip address not found\");\n }\n }", "private void validateFields() {\n\t\t// TODO validate ID\n\t\tboolean valid = (mEdtAddress.getText().length() > 2)\n\t\t\t\t&& (mEdtPassword.getText().length() > 0);\n\t\tmBtnNext.setEnabled(valid);\n\t}", "@Test\n public void shouldGetHostAddress() {\n assertEquals(NE_IP, session.getAddress().getHostAddress());\n }", "private static boolean validatingIP(String IP)\n {\n if(IP.equalsIgnoreCase(\"localhost\"))\n {\n return true;\n }\n try\n {\n if (IP == null || IP.isEmpty())\n {\n return false;\n }\n\n String[] parts = IP.split(\"\\\\.\");\n if (parts.length != 4)\n {\n return false;\n }\n\n for (String s : parts)\n {\n int i = Integer.parseInt(s);\n if ((i < 0) || (i > 255))\n {\n return false;\n }\n }\n if (IP.endsWith(\".\"))\n {\n return false;\n }\n\n return true;\n }\n catch (NumberFormatException nfe)\n {\n return false;\n }\n\n }", "@Override\r\n\tpublic String getIp() {\n\t\treturn null;\r\n\t}", "public Builder clearIp() {\n bitField0_ = (bitField0_ & ~0x00000002);\n ip_ = getDefaultInstance().getIp();\n onChanged();\n return this;\n }", "private void setIp(int value) {\n \n ip_ = value;\n }", "private void setIp(int value) {\n \n ip_ = value;\n }", "public boolean salvarIPDAO() throws ClassNotFoundException, UnknownHostException, SQLException {\n\n conectar();\n ValidaIP vip = new ValidaIP();\n if (vip.getIpLocalhost() != null) {\n String sql = \"INSERT INTO tbl_ip(\"\n + \"codigo_ip) \"\n + \"VALUES (?)\";\n PreparedStatement preparedStatement = criarPreparedStatement(sql, Statement.RETURN_GENERATED_KEYS);\n try {\n\n preparedStatement.setString(1, vip.getIpLocalhost());\n preparedStatement.executeUpdate();\n } catch (SQLException ex) {\n Logger.getLogger(DAOValidaIP.class.getName()).log(Level.SEVERE, null, ex);\n return false;\n }\n }\n desconectar();\n return true;\n }", "public Builder clearIp() {\n bitField0_ = (bitField0_ & ~0x00000001);\n ip_ = getDefaultInstance().getIp();\n onChanged();\n return this;\n }", "private boolean validateAddress() {\n if (address==null) {\n tvAddress.setText(String.format(\"%s*\", getString(R.string.address_activity)));\n showToast(getString(R.string.error_address_required));\n return false;\n }\n return true;\n }", "public Builder clearIp() {\n bitField0_ = (bitField0_ & ~0x00000004);\n ip_ = getDefaultInstance().getIp();\n onChanged();\n return this;\n }", "boolean hasAddress();", "boolean hasAddress();", "@java.lang.Override\n public boolean hasAddress() {\n return address_ != null;\n }", "public void setIp(final String ip) {\n this.ip = ip;\n }", "private boolean verificarCamposVacios() {\n \n boolean bandera = false; // false = campos no vacios\n \n if(this.jTextFieldDigiteCodigo.getText().equals(\"\") || this.jTextFieldDigiteCodigo.getText().equals(\"Digite Código\"))\n {\n mostrarError(jLabelErrorDigiteCodigo, \"Rellenar este campo\",jTextFieldDigiteCodigo);\n bandera=true;\n }\n return bandera;\n }", "public void setIp(java.lang.String ip) {\r\n this.ip = ip;\r\n }", "public boolean validateIP(String ip)\n\t{\n\t\treturn ip.matches(\"localhost\") || ip.matches(IP_REGEX);\n\t}", "public Builder clearIp() {\n copyOnWrite();\n instance.clearIp();\n return this;\n }", "public Builder clearIp() {\n copyOnWrite();\n instance.clearIp();\n return this;\n }", "public boolean hasReqRemoteAddr() {\n return fieldSetFlags()[3];\n }", "@FXML\n public void checkMail() throws IOException {\n if (SameAddressRadioButton.isSelected()) {\n Name9Field.setEditable(false);\n Name9Field.setDisable(true);\n Name9Field.setText(\"\");\n State9ComboBox.setDisable(true);\n State9ComboBox.setPromptText(\"State\");\n Address9Field.setEditable(false);\n Address9Field.setText(\"\");\n Address9Field.setDisable(true);\n City9Field.setEditable(false);\n City9Field.setText(\"\");\n City9Field.setDisable(true);\n Zip9Field.setEditable(false);\n Zip9Field.setText(\"\");\n Zip9Field.setDisable(true);\n } else {\n Name9Field.setEditable(true);\n Name9Field.setDisable(false);\n State9ComboBox.setDisable(false);\n State9ComboBox.setPromptText(\"State\");\n Address9Field.setEditable(true);\n Address9Field.setDisable(false);\n City9Field.setEditable(true);\n City9Field.setDisable(false);\n Zip9Field.setEditable(true);\n Zip9Field.setDisable(false);\n }\n }", "public void markIpAddress1Create() throws JNCException {\n markLeafCreate(\"ipAddress1\");\n }", "public Builder clearInIp() {\n copyOnWrite();\n instance.clearInIp();\n return this;\n }", "public Builder clearInIp() {\n copyOnWrite();\n instance.clearInIp();\n return this;\n }", "public void markIpAddressReplace() throws JNCException {\n markLeafReplace(\"ipAddress\");\n }", "private boolean validateFields() {\r\n\t\tif (txUsuario.getText().equals(\"\") || txPassword.getText().equals(\"\")\r\n\t\t\t\t|| checkAdmin.isIndeterminate()|| checkTPV.isIndeterminate())\r\n\t\t\treturn false;\r\n\t\treturn true;\r\n\t}", "public void setIp (java.lang.String ip) {\r\n\t\tthis.ip = ip;\r\n\t}", "public void setIp (java.lang.String ip) {\r\n\t\tthis.ip = ip;\r\n\t}", "public void markIpAddressDelete() throws JNCException {\n markLeafDelete(\"ipAddress\");\n }", "public void setIpAddr(String ipAddr) {\n this.ipAddr = ipAddr == null ? null : ipAddr.trim();\n }", "@Override\n\tprotected Boolean isValid(String[] fields) {\n\t\t//check - evnet_id, yes, maybe, invited, no\n return (fields.length > 4);\n\t}", "abstract void addressValidity();", "public void setDeviceIP(String argIp){\n\t deviceIP=argIp;\n }", "private boolean checkFields() {\n\t\tboolean status = true;\n\n\t\treturn status;\n\t}", "public boolean isSetGraph_addr() {\n return this.graph_addr != null;\n }", "public boolean agregarServidor(String nombre,String ip){\n query=\"INSERT INTO ipServidor ('servidor','ips') VALUES ('%s','%s');\";\n System.out.print(\"Agregando servidor \"+nombre+\" \"+ip+\": \");\n query= String.format(query,nombre,ip);\n try{\n if(miBaseDatos.executeNonQuery(query)){\n System.out.println(\"Servidor agregado exitosamente\");\n return true;\n }else{\n System.out.println(\"Error al agregar servidor\");\n return false;\n }\n }catch(Exception e){\n System.out.println(e.getClass());\n System.out.println(e.getMessage());\n e.printStackTrace();\n }\n return false;\n }", "public java.lang.String getIp(){\r\n return localIp;\r\n }", "public java.lang.String getIp(){\r\n return localIp;\r\n }", "public String getIp(){\n\treturn ip;\n }", "private boolean fieldsFilled(){\n return !editTextEmail.getText().toString().isEmpty() &&\n !editTextPassword.getText().toString().isEmpty();\n }", "boolean hasHasAddress();", "public Builder setIp(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n ip_ = value;\n onChanged();\n return this;\n }", "public boolean isSetMachineInnerIP() {\n return this.machineInnerIP != null;\n }", "public void setIpadress(java.lang.String ipadress) {\r\n this.ipadress = ipadress;\r\n }" ]
[ "0.6178655", "0.6178655", "0.60973144", "0.60973144", "0.60973144", "0.60973144", "0.59913826", "0.5897765", "0.5897765", "0.5743491", "0.5740121", "0.5736344", "0.5725941", "0.5724146", "0.57232016", "0.57018876", "0.5689546", "0.5684303", "0.56581527", "0.56346875", "0.56316805", "0.56003815", "0.5590573", "0.55697817", "0.55574924", "0.5554892", "0.554638", "0.55167115", "0.55167115", "0.55137396", "0.55030686", "0.54495615", "0.5440212", "0.5440212", "0.5430926", "0.54168755", "0.54102975", "0.54102975", "0.5403451", "0.53971744", "0.53929996", "0.5372715", "0.53679985", "0.5361787", "0.5361787", "0.5361787", "0.5333327", "0.5333327", "0.5324248", "0.5266395", "0.5262505", "0.52552176", "0.525472", "0.5252112", "0.5248285", "0.52442217", "0.5234467", "0.5228409", "0.5197124", "0.519583", "0.5194334", "0.5194334", "0.51772904", "0.51758873", "0.51723635", "0.51673657", "0.5162933", "0.5162933", "0.5157449", "0.5157013", "0.51474714", "0.5118533", "0.5113118", "0.51105905", "0.51105905", "0.5109506", "0.51078165", "0.5104372", "0.51032156", "0.51032156", "0.5095778", "0.50937456", "0.50791025", "0.50791025", "0.50777507", "0.5064278", "0.50630367", "0.50564545", "0.50554687", "0.50525284", "0.5047214", "0.5045719", "0.5033799", "0.5033799", "0.5033267", "0.50263655", "0.5024516", "0.50167316", "0.50160474", "0.5014203" ]
0.6691055
0
Permite revisar que la informacion ingresada en los campos no exceda los 3 caracteres
public boolean verificarLongitudCamposIPRMI(TextField campoIPRMI1, TextField campoIPRMI2, TextField campoIPRMI3, TextField campoIPRMI4) { boolean camposCorrectos = true; if (campoIPRMI1.getText().length() > 3 || campoIPRMI2.getText().length() > 3 || campoIPRMI3.getText().length() > 3 || campoIPRMI4.getText().length() > 3) { camposCorrectos = false; } return camposCorrectos; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void validar_campos(){\r\n\t\tfor(int i=0;i<fieldNames.length-1;++i) {\r\n\t\t\tif (jtxt[i].getText().length() > 0){\r\n\t\t\t}else{\r\n\t\t\t\tpermetir_alta = 1;\r\n\t\t\t}\t\r\n\t\t}\r\n\t\tif((CmbPar.getSelectedItem() != null) && (Cmbwp.getSelectedItem() != null) && (CmbComp.getSelectedItem() != null) && (jdc1.getDate() != null) && (textdescripcion.getText().length() > 1) && (textjustificacion.getText().length() > 1)){\t\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tpermetir_alta = 1;\r\n\t\t}\r\n\t\t\r\n\t}", "private boolean verificaDados() {\n if (!txtNome.getText().equals(\"\") && !txtProprietario.getText().equals(\"\")) {\n return true;\n } else {\n JOptionPane.showMessageDialog(null, \"Falta campos a ser preenchido\", \"Informação\", 2);\n return false;\n }\n }", "private String validarEntradas()\n { \n return Utilitarios.validarEntradas(campoNomeAC, campoEnderecoAC, campoBairroAC, campoCidadeAC, campoUfAC, campoCepAC, campoTelefoneAC, campoEmailAC);\n }", "private boolean verificarCamposVacios() {\n \n boolean bandera = false; // false = campos no vacios\n \n if(this.jTextFieldDigiteCodigo.getText().equals(\"\") || this.jTextFieldDigiteCodigo.getText().equals(\"Digite Código\"))\n {\n mostrarError(jLabelErrorDigiteCodigo, \"Rellenar este campo\",jTextFieldDigiteCodigo);\n bandera=true;\n }\n return bandera;\n }", "private boolean camposValidos() {\n boolean valido = false;\n\n if (txtInfectados.getText().equals(\"\")\n || txtFecha.getText().equals(\"\")) {\n JOptionPane.showMessageDialog(null, \"Rellene todos los campos\");\n } else {\n valido = true;\n }\n\n return valido;\n }", "private boolean hayCamposVacios() {\r\n\t\tif(nomTextField.getText().isEmpty()\r\n\t\t\t|| claveTextField.getText().isEmpty()\r\n\t\t\t\t|| reingresoTextField.getText().isEmpty()\r\n\t\t\t\t\t|| preguntaTextField.getText().isEmpty()\r\n\t\t\t\t\t\t|| respuestaTextField.getText().isEmpty())\r\n\t\t\treturn true;\t\t\r\n\t\treturn false;\r\n\t}", "private boolean camposNumCorrectos() {\n\t\t return Utilidades.isPositiveNumber(anioText.getText().trim());\n\t}", "public boolean validarCampos(Admin admin) {\r\n\t\tStringBuilder inconsistencias = new StringBuilder();\r\n\t\tif (admin.getNome().equals(\"\") || admin.getNome() == null) {\r\n\t\t\tinconsistencias.append(\"\\n Campo Nome obrigatório\");\r\n\t\t}\r\n\t\tif (admin.getSobrenome().equals(\"\") || admin.getSobrenome() == null) {\r\n\t\t\tinconsistencias.append(\"\\n Campo Sobrenome obrigatório\");\r\n\t\t}\r\n\t\tif (admin.getUsuario().equals(\"\") || admin.getUsuario() == null) {\r\n\t\t\tinconsistencias.append(\"\\n Campo Usuario obrigatório\");\r\n\t\t}\r\n\t\tif (admin.getEmail().equals(\"\") || admin.getEmail() == null) {\r\n\t\t\tinconsistencias.append(\"\\n Campo Email obrigatório\");\r\n\t\t}\r\n\t\tif (admin.getCpf().equals(\"\") || admin.getCpf() == null) {\r\n\t\t\tinconsistencias.append(\"\\n Campo CPF obrigatório\");\r\n\t\t}\r\n\t\tif (admin.getSenha().equals(\"\") || admin.getSenha() == null) {\r\n\t\t\tinconsistencias.append(\"\\n Campo Senha obrigatório\");\r\n\t\t}\r\n\t\tif (admin.getConfirmarSenha().equals(\"\") || admin.getConfirmarSenha() == null) {\r\n\t\t\tinconsistencias.append(\"\\n Campo Confirmar Senha obrigatório\");\r\n\t\t}\r\n\t\tif (admin.getDataNascimento() == null) {\r\n\t\t\tinconsistencias.append(\"\\n Campo Data obrigatório\");\r\n\t\t}\r\n\t\tif (inconsistencias.length() == 0) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\tSystem.out.println(inconsistencias.toString());\r\n//\t\t\tlbMsg.setVisible(true);\r\n\t\t\tlbMsg.setText(inconsistencias.toString());\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t}", "public void validaNulos( JTextField valor, String texto){\n\t\ttry {\n\t\t\tif(valor.getText().length() < 1) {\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Valor \" + texto + \" nao preenchido\");\n\t\t\t\tvalor.grabFocus();\n\t\t\t\treturn;\n\t\t\t}\n\t\t} catch (NullPointerException ex) {\n\t\t\tJOptionPane.showMessageDialog(null, \"Valor \" + texto + \" nao preenchido\");\n\t\t\treturn;\n\t\t}\n\t}", "public void letras() {\n caracteres = 32 - txtMensaje.getText().length(); //Indica la catidad de carcteres\n //disponibles. En el LCD solo se permite imprimir 32 caracteres.\n\n if (caracteres <= 0) { //Si la cantidad de caracteres se ha agotado... \n lbCaracteres.setText(\"Caracteres disponibles: 0\"); //Se imprime que la cantidad de \n //caracteres disponibles es 0\n String cadena = \"\"; //Se declara la variable que guardará el mensaje a enviar\n cadena = txtMensaje.getText(); //Se asigna el texto del TextField a la variable cadena\n cadena = cadena.substring(0, 32); //Se evita que por alguna razón la variable contenga\n //más de 32 caracteres, utilizando el substring que crea un string a partir de uno mayor.\n txtMensaje.setText(cadena); //se regresa la cadena con 32 caracteres al TextField\n } else {\n //Si la cantidad de caracteres disponibles es ayor a 0 solamente se imprimirá la cantidad\n //de caracteres disponibles\n lbCaracteres.setText(\"Caracteres disponibles: \" + (caracteres));\n }\n }", "public void validacionDatos() {\n if (!this.interfazLogin.txtUsuario().getText().isEmpty()) {\n if (this.interfazLogin.txtPassword().getText().length() > 7) {\n\n String[] usuario = modeloLogin.getAcceso(\n this.interfazLogin.txtUsuario().getText(),\n this.interfazLogin.txtPassword().getText());\n\n if (usuario[0].isEmpty()) {\n JOptionPane.showMessageDialog(null, \"Usuario o Contraseña Invalidos\");\n } else {\n controlInterfazPrincipal();\n\n if (usuario[2].equals(\"Administrador\")) {\n interfazPrincipal.btnUsuario().setVisible(true);\n pintarPanelPrincipal(panelUsuarios);\n\n } else {\n interfazPrincipal.btnUsuario().setVisible(false);\n pintarPanelPrincipal(panelClientes);\n }\n }\n this.interfazLogin.txtPassword().setText(\"\");\n } else {\n JOptionPane.showMessageDialog(null, \"El campo de password debe tener como minino 8 caracteres\");\n }\n } else {\n JOptionPane.showMessageDialog(null, \"El campo de usurario no puede ir vacio\");\n }\n }", "public void validarPostagem() {\n\t\t// validando se o nome motorista ou carona foram preenchidos\n\t\tint verif = 0;\n\t\ttry {\n\t\t\tif (txtCarona.getText() == null\n\t\t\t\t\t|| txtCarona.getText().trim().equals(\"\")) {\n\n\t\t\t\tverif++;\n\n\t\t\t}\n\t\t\tif (txtMotorista.getText() == null\n\t\t\t\t\t|| txtMotorista.getText().trim().equals(\"\")) {\n\n\t\t\t\tverif++;\n\n\t\t\t}\n\t\t\tif (verif == 2) {\n\t\t\t\tthrow new IllegalArgumentException();\n\t\t\t}\n\n\t\t\tif (txtDestino.getText() == null\n\t\t\t\t\t|| txtDestino.getText().trim().equals(\"\")) {\n\t\t\t\tthrow new IllegalArgumentException();\n\t\t\t}\n\n\t\t} catch (IllegalArgumentException e) {\n\t\t\tJOptionPane\n\t\t\t\t\t.showMessageDialog(\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\"Para postar no quadro é necessário informar nome (motorista ou passageiro) \"\n\t\t\t\t\t\t\t\t\t+ \"\t\t\t\t\t\t\te local. \\n Por favor certifique se os campos foram preenchidos e tente novamente.\");\n\t\t}\n\n\t}", "private void limpaCampos() {\n txtNome.setText(\"\");\n txtRG.setText(\"\");\n txtFCpf.setText(\"\");\n txtFNascimento.setText(\"\");\n txtEmail.setText(\"\");\n txtFCelular.setText(\"\");\n txtFTelefone.setText(\"\");\n txtRua.setText(\"\");\n txtComplemento.setText(\"\");\n txtFCep.setText(\"\");\n txtBairro.setText(\"\");\n txtCidade.setText(\"\");\n }", "public boolean textVacio(JTextField txtDNI, JPasswordField pwsPass, JTextField txtNom,\n JTextField txtApe, JTextField txtTele, JTextField txtCorreo, JComboBox cbx, JLabel lblMensaje) {\n\n try {\n\n boolean veri = txtDNI.getText().trim().isEmpty() || pwsPass.getText().trim().isEmpty() || txtNom.getText().trim().isEmpty()\n || txtApe.getText().trim().isEmpty() || txtTele.getText().trim().isEmpty() || txtCorreo.getText().trim().isEmpty()\n || cbx.getSelectedIndex() == 0;\n\n if (veri == true) {\n lblMensaje.setText(\"TODOS LOS CAMPOS SON NECESARIOS\".toUpperCase());\n return true;\n } else {\n lblMensaje.setText(\"\".toUpperCase());\n return false;\n }\n } catch (Exception e) {\n System.err.println(\"Erro bro :(\");\n }\n return true;\n }", "public boolean validaCampos() {\n \n if(!this.ftCpf.getText().isEmpty()){\n \n String cpf = this.ftCpf.getText();\n Validador valida = new Validador();\n cpf = valida.tiraPontosCPF(cpf);\n\n\n if (!cpf.isEmpty() || cpf.length() == 11)\n if (!this.tfCarro.getText().isEmpty())\n if ((this.cbPlano.getSelectedItem().toString().equals(\"Diaria Simples\")) || ((this.cbPlano.getSelectedItem().toString().equals(\"Diaria Quilometrada\") && !this.tfQuilometragem.getText().isEmpty())))\n if (!this.tfValorTotal.getText().isEmpty())\n return true;\n else \n JOptionPane.showMessageDialog(null, \"O Valor não pode estar Zerado\", \"Informação\", JOptionPane.INFORMATION_MESSAGE);\n else\n JOptionPane.showMessageDialog(null, \"Insira a Quantidade de quilometros\", \"Informação\", JOptionPane.INFORMATION_MESSAGE);\n else\n JOptionPane.showMessageDialog(null, \"Escolha um carro\", \"Informação\", JOptionPane.INFORMATION_MESSAGE);\n else\n JOptionPane.showMessageDialog(null, \"Digite o CPF corretamente\", \"Informação\", JOptionPane.INFORMATION_MESSAGE);\n \n }\n else\n JOptionPane.showMessageDialog(null, \"Informe o CPF corretamente\", \"Informação\", JOptionPane.INFORMATION_MESSAGE);\n return false;\n \n }", "private boolean validarCampos() {\r\n\t\tif (cedula.equals(\"\") || nombre.equals(\"\") || apellido.equals(\"\") || telefono.equals(\"\")) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public static void IngresoDatos(){\n int IFila=0,ICol=0;\n int INota;\n for(IFila=0;IFila<10;IFila++)\n {\n StrNotas[IFila][0]=JOptionPane.showInputDialog(null, \"Ingrse nombre del alumno:\");\n INota=LlenadoRandom(0,100);\n StrNotas[IFila][1]=Integer.toString(INota);\n if(INota<61)\n StrNotas[IFila][2]=\"Perdio\";\n else\n StrNotas[IFila][2]=\"gano\";\n }\n }", "private void validationMotDePasse( String motDePasse ) throws Exception {\n if ( motDePasse != null ) {\n if ( motDePasse.length() < 3 ) {\n throw new Exception( \"Le mot de passe doit contenir au moins 3 caractères.\" );\n }\n } else {\n throw new Exception( \"Merci de saisir votre mot de passe.\" );\n }\n }", "private void limpiarCampos() {\n\t\tthis.campoClave.setText(\"\");\n\t\tthis.campoClaveNueva.setText(\"\");\n\t\tthis.campoClaveRepita.setText(\"\");\n\t}", "private boolean validarCampos() {\n\t\t// TODO Auto-generated method stub\n\t\tif (txtCedula.getText().trim().equals(\"\")) {\n\t\t\tUtilidades.mostrarMensaje(\"Complete el campo\", \"Por favor ingrese un numero de cedula\");\n\t\t\treturn false;\n\t\t}\n\t\tif (txtNombre.getText().trim().equals(\"\")) {\n\t\t\tUtilidades.mostrarMensaje(\"Complete el campo\", \"Por favor ingrese un nombre\");\n\t\t\treturn false;\n\t\t}\n\t\tif (txtApellidos.getText().trim().equals(\"\")) {\n\t\t\tUtilidades.mostrarMensaje(\"Complete el campo\", \"Por favor ingrese los apellidos\");\n\t\t\treturn false;\n\t\t}\n\t\tif (txtCorreo.getText().trim().equals(\"\")) {\n\t\t\tUtilidades.mostrarMensaje(\"Complete el campo\", \"Por favor ingrese el correo\");\n\t\t\treturn false;\n\t\t}\n\t\tif (!Utilidades.validarEmailFuerte(txtCorreo.getText().trim())) {\n\t\t\tUtilidades.mostrarMensaje(\"Complete el campo\", \"Por favor ingrese un correo valido\");\n\t\t\treturn false;\n\t\t}\n\t\tif (txtDireccion.getText().trim().equals(\"\")) {\n\t\t\tUtilidades.mostrarMensaje(\"Complete el campo\", \"Por favor ingrese la direccion\");\n\t\t\treturn false;\n\t\t}\n\t\tif (txtTelefono.getText().trim().equals(\"\")) {\n\t\t\tUtilidades.mostrarMensaje(\"Complete el campo\", \"Por favor ingrese el numero de telefono\");\n\t\t\treturn false;\n\t\t}\n\t\tif (txtUsuario.getText().trim().equals(\"\")) {\n\t\t\tUtilidades.mostrarMensaje(\"Complete el campo\", \"Por favor ingrese el nombre de usuario\");\n\t\t\treturn false;\n\t\t}\n\t\tif (txtContrasenia.getText().trim().equals(\"\")) {\n\t\t\tUtilidades.mostrarMensaje(\"Complete el campo\", \"Por favor ingrese una contraseña\");\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public static String chequeoCampos (JTextField nombre, JTextField apellido, \r\n JTextField cedula, JTextArea Direccion, JTextField email,\r\n JPasswordField password, JPasswordField comprobacion,\r\n JLabel errorCampos, JTextField username, JDateChooser DoB, VentanaBase ventana) {\n\t\t\r\n\t\tint errores = 0;\r\n String pass1 = \"0\", pass2 = \"0\";\r\n\t\t\r\n\t\tif (nombre.getText().equals(\"\") || apellido.getText().equals(\"\") || email.getText().equals(\"\") || comprobacion.getPassword().equals(\"\")\r\n\t\t\t\t || password.getPassword().equals(\"\") || comprobacion.getPassword().equals(\"\")) { //Si algun campo est� lleno, debe mostrar la etiqueta de error\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\terrorCampos.setVisible(true); //Con esto habilita la etiqueta de error\r\n errorCampos.setText(\"Campos incompletos, por favor revise nuevamente.\");\r\n\t\t\t\terrorCampos.setForeground(Color.red); // Y la pone en color rojo\t\r\n\t\t\t\terrores++;\r\n \r\n pass1 = password.getText();\r\n pass2 = comprobacion.getText();\r\n\t\t\t\r\n\t\t}\r\n\t \t \r\n\t\t//if (!password.getPassword().equals(comprobacion.getPassword())) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\r\n if (!pass1.equals(pass2)) {\r\n\t\t\t if (!password.getPassword().equals(\"\")) {\r\n\t\t\t\terrorCampos.setText(\"Campos incompletos, por favor revise nuevamente.\");\t\t\t\t\t\r\n\t\t\t\terrorCampos.setVisible(true); //Con esto habilita la etiqueta de error\r\n\t\t\t\terrorCampos.setForeground(Color.red); // Y la pone en color rojo\r\n\t\t\t\terrores++;\r\n\t\t\t\t\r\n\t\t\t }\r\n\t\t}\r\n\t\t\r\n\t\tif ((password.getPassword().length < 4 || password.getPassword().length > 12) && password.getPassword().equals(\"\")){ \r\n\t\t\t//Si la contrase�a tiene entre 4 y 12 caracteres.\r\n\t\t\t\r\n //REVISAR AQUI, CORRECCION??\r\n\t\t\terrorCampos.setText(\"La contrasena debe tener entre 4 y 12 caracteres\");\r\n\t\t\terrorCampos.setVisible(true); //Con esto habilita la etiqueta de error\r\n\t\t\terrorCampos.setForeground(Color.red); // Y la pone en color rojo\r\n\t\t\terrores++;\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(pass1+ \" ---> \" + pass2 + \" \" + password.getText());\r\n\t\t\r\n\t\tif (errores > 0) {\r\n\t\t return (\"ErrorSistema\"); }\r\n\t\telse {\r\n \r\n //Si entra por aca, todo está en orden y procederá a registrar al usuario\r\n \r\n \r\n RegistroUsuario( nombre.getText(), apellido.getText(), \r\n cedula.getText(), username.getText(), password.getText(), \r\n email.getText(), DoB.getDate(), Direccion.getText());\r\n\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\treturn (\"RegistroAprobado\");\r\n\t\t\t}", "@Test\n public void nao_deve_aceitar_descricao_com_caracteres_especiais() {\n telefone.setDescricao(\"celular empresarial: (11)9####-####.\");\n assertFalse(isValid(telefone, \"A descrição não pode conter acentos, caracteres especiais e números.\", Find.class));\n }", "private boolean comprobarCampos(){\n if(jTextField1.getText().isEmpty() || jTextField2.getText().isEmpty()){\n JOptionPane.showMessageDialog(this, \"No se debe dejar campos en blanco\", \n \"ERROR: campos en blanco\", JOptionPane.ERROR_MESSAGE);\n }\n if (jComboBox1.getSelectedIndex() == 0|| entrenador.getNacionalidad().equals(\"\")){\n JOptionPane.showMessageDialog(this, \"Debes indicar un pais\", \"ERROR: Nacionalidad incorrecta\", \n JOptionPane.ERROR_MESSAGE);\n return false;\n }\n if(jXDatePicker1.getDate() == null){\n JOptionPane.showMessageDialog(this, \"Debes indicar una fecha de nacimiento\", \n \"ERROR: Fecha de nacimiento vacía\", JOptionPane.ERROR_MESSAGE);\n return false;\n }\n return true;\n }", "@Override\n public void afterTextChanged(Editable s) {\n\n if(!txt_codigo.getText().toString().equals(\"\")){\n //LLAMAR AL METODO QUE COMPRUEBA SI EL CODIGO INGRESADO ES VALIDO O NO (TRUE O FALSE)\n //IF(CODIGO ES VALIDO) ENTONCES TOAST = CODIGO AGREGADO ELSE CODIGOERRONEO\n\n //TXT.CODIGO.SETTEXT(\"\");\n }\n }", "private boolean campiVuoti(){\n return nomeVarTextField.getText().equals(\"\") || tipoVarComboBox.getSelectedIndex() == -1;\n }", "public boolean validarCampos(){\n String nome = campoNome.getText().toString();\n String descricao = campoDescricao.getText().toString();\n String valor = String.valueOf(campoValor.getRawValue());\n\n\n if(!nome.isEmpty()){\n if(!descricao.isEmpty()){\n if(!valor.isEmpty() && !valor.equals(\"0\")){\n return true;\n }else{\n exibirToast(\"Preencha o valor do seu serviço\");\n return false;\n }\n }else{\n exibirToast(\"Preencha a descrição do seu serviço\");\n return false;\n }\n }else{\n exibirToast(\"Preencha o nome do seu serviço\");\n return false;\n }\n }", "private void validarCampos() {\n }", "public void limparCampos() {\n\t\tcodigoField.setText(\"\");\n\t\tdescricaoField.setText(\"\");\n\t\tcodigoField.setEditable(true);\n\t\tBorder border = BorderFactory.createLineBorder(Color.RED);\n\t\tcodigoField.setBorder(border);\n\t\tcodigoField.requestFocus();\n\t\tBorder border1 = BorderFactory.createLineBorder(Color.BLACK);\n\t\tdescricaoField.setBorder(border1);\n\t\t\n\t\t\n\t}", "public static void validation() {\n\t\tif ((!textFieldName.getText().isEmpty()) && (!textField_FirstName.getText().isEmpty())\n\t\t\t\t&& (!textField_Town.getText().isEmpty()) && (!textField_Town.getText().isEmpty())) {\n\n\t\t\tif ((isValidEmailAddress(textField_Email.getText()) == true)) {\n\t\t\t\ttextField_Email.setBackground(Color.white);\n\t\t\t\tif ((force(textField_Mtp.getText()) > 82)) {\n\t\t\t\t\ttextField_Mtp.setBackground(Color.white);\n\t\t\t\t\tactionGiveServeur();\n\n\t\t\t\t} else {\n\t\t\t\t\tshowMessageDialog(null, \"Votre mot de passe est trop faible\");\n\t\t\t\t\ttextField_Mtp.setText(\"Mot de passe trop simple : changer le \");\n\t\t\t\t\ttextField_Mtp.setBackground(Color.RED);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttextField_Email.setText(\"Email invalide\");\n\t\t\t\ttextField_Email.setBackground(Color.RED);\n\t\t\t\tshowMessageDialog(null, \"Email est invalide\");\n\t\t\t}\n\t\t} else {\n\n\t\t\tshowMessageDialog(null, \"Certain champs sont vide !\");\n\t\t}\n\t}", "private boolean checkData() {\n if (txtMaMay.getText().equals(\"\")) {\n JOptionPane.showMessageDialog(this, \"Mã máy không được để trống!\\n\"\n + \"Quy tắc đặt tên mã máy: số hiệu máy+mã phòng\");\n return false;\n } else if (txtcauhinh.getText().equals(\"\")) {\n JOptionPane.showMessageDialog(this, \"Cấu hình máy không được để trống!\");\n return false;\n } else if (txtTinhtrang.getText().equals(\"\")) {\n JOptionPane.showMessageDialog(this, \"Tình trạng máy không được để trống!\");\n return false;\n } else if (txtphanmem.getText().equals(\"\")) {\n JOptionPane.showMessageDialog(this, \"Mã phòng không được để trống!\");\n return false;\n }\n return true;\n }", "private void validationNom(String nameGroup) throws FormValidationException {\n\t\tif (nameGroup != null && nameGroup.length() < 3) {\n\t\t\tSystem.out\n\t\t\t\t\t.println(\"Le nom d'utilisateur doit contenir au moins 3 caractères.\");\n\t\t\tthrow new FormValidationException(\n\t\t\t\t\t\"Le nom d'utilisateur doit contenir au moins 3 caractères.\");\n\t\t}\n\n\t\t// TODO checker si le nom exist pas ds la bdd\n\t\t// else if (){\n\t\t//\n\t\t// }\n\t}", "private void validate() {\n\t\t// just in case;\n\t\tfor (int i=0;i<NR_OF_FIELDS; i++) {\n\t\t\tvalid[i] = \"0\";\n\t\t}\n\t\t//\n\t\t// Validate name and surname:\n\t\t//\n\t\tif ( ! this.isUpperAlpha(nume)) {\n\t\t\tfields[0] = \"1\";\n\t\t}\n\t\t\n\t\tif ( ! this.isUpperAlphaWithSpace(nume)) {\n\t\t\tfields[1] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate seria\n\t\t//\n\t\tvalid[2] = \"1\";\t\t\t\t\t\t\t// presupun ca seria este invalida, si incerc sa o validez\n\t\tfor (int i=0; i<seriiBuletin.length; i++) {\n\t\t\tif (seriiBuletin[i].equals(seria)) {\n\t\t\t\tvalid[2] = \"0\";\n\t\t\t}\n\t\t}\n\t\t//\n\t\t// validate numarul\n\t\t//\n\t\ttry {\n\t\t\tvalid[3] = \"1\";\n\t\t\tint nr = Integer.valueOf(numarul);\n\t\t\tif ( nr >= 100000 && nr <= 999999 ) {\n\t\t\t\tvalid[3] = \"0\";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLog.d(TAG, \"Error validating seria.\");\n\t\t}\n\n\t\t//\n\t\t// validate sex\n\t\t//\n\t\tif ( ! (sex == 'M' || sex == 'F')) {\n\t\t\tvalid[6] = \"1\";\n\t\t}\n\t\t//\n\t\t// Validate valabilitate\n\t\t//\n\t\tif ( ! isNumber(this.valabilitate)) {\n\t\t\tvalid[7] = \"1\";\n\t\t}\n\t\t//\n\t\t// validate CNP\n\t\t//\n\t\tif ( ! (isNumber(CNP) && isValidCNP(CNP))) {\n\t\t\tvalid[8] = \"1\";\n\t\t}\n\t\t\n\t}", "@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 }", "@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 limpiarCampos() {\n campoNombre.setText(\"\");\n campoNumLibro.setText(\"\");\n campoNumPagina.setText(\"\");\n }", "private void accionIngresar() {\n\n\t\tString fieldCodigo = this.textCodigo.getText();\n\t\tString fieldNombre = this.textNombre.getText();\n\t\tString fieldDescripcion = this.textDescripcion.getText();\n\t\tString fieldTelefono = this.textTelefono.getText();\n\n\t\t// Si alguno es vacío, mostramos una ventana de mensaje\n\t\tif (fieldNombre.equals(\"\") || fieldCodigo.equals(\"\") || fieldDescripcion.equals(\"\") || fieldTelefono.equals(\"\")) {\n\t\t\tJOptionPane.showMessageDialog(frame, \"Debe completar todos los datos marcados con (*).\", \"Datos incompletos!\",\n\t\t\t\t\tJOptionPane.WARNING_MESSAGE);\n\n\t\t\treturn; }\n\t\t\n\t\t// Controlo el maximo de caracteres\n\t\tif (fieldCodigo.length() > 5) {\n\t\t\tJOptionPane.showMessageDialog(frame, \"El código puede contener máximo 5 caracteres\", \"Datos inválidos!\",\n\t\t\t\t\tJOptionPane.WARNING_MESSAGE);\n\t\t\treturn;\n\t\t} else if (fieldNombre.length() > 20) {\n\t\t\tJOptionPane.showMessageDialog(frame, \"El nombre puede contener máximo 20 caracteres\", \"Datos inválidos!\",\n\t\t\t\t\tJOptionPane.WARNING_MESSAGE);\n\t\t\treturn;\n\t\t} else if (fieldDescripcion.length() > 100) {\n\t\t\tJOptionPane.showMessageDialog(frame, \"La descripción puede contener máximo 100 caracteres\", \"Datos inválidos!\",\n\t\t\t\t\tJOptionPane.WARNING_MESSAGE);\n\t\t\treturn;\n\t\t} else if (fieldTelefono.length() > 20) {\n\t\t\tJOptionPane.showMessageDialog(frame, \"El teléfono puede contener máximo 20 caracteres\", \"Datos inválidos!\",\n\t\t\t\t\tJOptionPane.WARNING_MESSAGE);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//Controlo que el fenomeno no exista ya\n\t\t\n\t\tboolean existe;\n\t\t\n\t\ttry{\n\t\t\texiste = ClienteGeoPosUy.ExisteFenomeno(fieldNombre);\n\t\t} catch (Exception e){\n\t\t\tJOptionPane.showMessageDialog(frame, \"Error de conexión con el servidor. Intente más tarde.\",\n\t\t\t\t\t\"Error de conexión!\", JOptionPane.WARNING_MESSAGE);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (existe) {\n\t\t\tJOptionPane.showMessageDialog(frame, \"Ya existe un fenómeno con ese nombre\",\n\t\t\t\t\t\"Fenómeno existente!\", JOptionPane.WARNING_MESSAGE);\n\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//Si todo va bien lo doy de alta\n\t\t\n\t\tboolean almacenado = false;\n\t\ttry {\n\t\t\talmacenado = ClienteGeoPosUy.crearFenomeno(fieldCodigo, fieldNombre, fieldDescripcion, fieldTelefono);\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tif (almacenado) {\n\t\t\tJOptionPane.showMessageDialog(frame, \"El fenómeno ha sido registrado con éxito.\",\n\t\t\t\t\t\"Cliente Registrado!\", JOptionPane.INFORMATION_MESSAGE);\n\t\t\t\n\t\t\t// cerramos la ventanta\n\t\t\tthis.frame.dispose();\n\n\t\t\t\n\t\t}\n\t\telse{\n\t\t\tJOptionPane.showMessageDialog(frame, \"Hubo un error al almacenar. Intente nuevamente más tarde\",\n\t\t\t\t\t\"Error al registrar!\", JOptionPane.ERROR_MESSAGE);\n\t\t}\n\t\t\n\t\t\n}", "String validateCampo (String name, String email, String password){\n String campos;\n campos = name !=null && name.trim().length()>0? \"\" : \"\\n\" + campoName.getHint() + \"\\n\";\n campos += email !=null && email.trim().length()>0? \"\" :campoEmail.getHint() + \"\\n\";\n campos += password !=null && password.trim().length()>0?\"\" : campoPassword.getHint() + \"\\n\";\n campos += bitmaphoto !=null?\"\":\"Imagen\";\n return campos;\n }", "private void checkFieldsForEmptyValues() {\n String s1 = edtEmail.getText().toString();\n String s2 = edtDisplayName.getText().toString();\n String s3 = edtPaswd.getText().toString();\n\n if (s1.equals(\"\") || s2.equals(\"\") || s3.equals(\"\")) { //disables the button\n btnRegister.setEnabled(false);\n } else { //enables the button\n btnRegister.setEnabled(true);\n }\n }", "private boolean checkDesignCMT() {\n // check null\n if (jTFChungMinhThu.getText().trim().isEmpty()) {\n JOptionPane.showMessageDialog(rootPane, \"Nhập CMT và nhấn Enter để tìm kiếm\\nHoặc nhấn nút \\\"SHOW INFO\\\" để chọn nhân khẩu.\", \"Warning\", JOptionPane.WARNING_MESSAGE);\n return false;\n }\n // check dinh dang so chung minh thu\n try {\n long d = Long.parseLong(jTFChungMinhThu.getText());\n } catch (Exception e) {\n JOptionPane.showMessageDialog(rootPane, \"Số CMT không thể chứa các ký tự chữ cái\", \"Warning\", JOptionPane.WARNING_MESSAGE);\n return false;\n }\n // kiem tra do dai cmt\n if (jTFChungMinhThu.getText().length() != 9 && jTFChungMinhThu.getText().length() != 12) {\n JOptionPane.showMessageDialog(rootPane, \"Số CMT có 9 hoặc 12 số\", \"Warning\", JOptionPane.WARNING_MESSAGE);\n return false;\n }\n return true;\n }", "private String getCampo3() {\r\n String campo = this.campoLivre.substring(15);\r\n return boleto.getDigitoCampo(campo);\r\n }", "public void setwoorden()\n {\n String[] woorden = taInput.getText().split(\" |\\n\");\n \n for (int i = 0; i < woorden.length; i++) {\n if(!woorden[i].isEmpty())\n {\n AllText.add(woorden[i]); \n }\n } \n }", "private boolean checkFields() {\n boolean test = true;\n if (fname.isEmpty()) {\n test = false;\n }\n if (lname.isEmpty()) {\n test = false;\n }\n if (cin.isEmpty()) {\n test = false;\n }\n if (typeCompte.equals(\"Bancaire\")) {\n if (decouvertNF.isEmpty())\n test = false;\n } else if (typeCompte.equals(\"Epargne\")) {\n if (tauxInteretNF.isEmpty())\n test = false;\n }\n if (s_datePK.getValue() == null) {\n s_datePK.setStyle(\"-fx-border-color:red;-fx-border-radius:3px;-fx-border-size: 1px;\");\n test = false;\n }\n\n return test;\n }", "private boolean validarFormulario() {\n boolean cumple=true;\n boolean mosntrarMensajeGeneral=true;\n if(!ValidacionUtil.tieneTexto(txtNombreMedicamento)){\n cumple=false;\n };\n if(!ValidacionUtil.tieneTexto(txtCantidad)){\n cumple=false;\n };\n if(cmbTipoMedicamento.getSelectedItem()==null|| cmbTipoMedicamento.getSelectedItem().equals(\"Seleccione\")){\n setSpinnerError(cmbTipoMedicamento,\"Campo Obligatorio\");\n cumple=false;\n\n }\n if(getSucursalesSeleccionadas().isEmpty()){\n\n cumple=false;\n mosntrarMensajeGeneral=false;\n Utilitario.mostrarMensaje(getApplicationContext(),\"Seleccione una sucursal para continuar.\");\n }\n if(!cumple){\n if(mosntrarMensajeGeneral) {\n Utilitario.mostrarMensaje(getApplicationContext(), \"Error, ingrese todos los campos obligatorios.\");\n }\n }\n return cumple;\n }", "private void checkForEmptyFields() throws EmptyTextFieldException {\n\n if (date == null || title.equals(\"\") || function.equals(\"\") || protagonist.equals(\"\")\n || source.equals(\"\") || references.equals(\"\") || description.equals(\"\")) {\n throw new EmptyTextFieldException();\n }\n }", "private boolean verifyObligedFields() {\n if(label.getText().toString().isEmpty() || label.getText().toString().equals(\"\"))\n {\n Toast.makeText(ExpenseCardViewDetails.this, R.string.label_must_be_filled, Toast.LENGTH_SHORT).show();\n return false;\n }\n if(category.getSelectedItem().toString().isEmpty())\n {\n Toast.makeText(ExpenseCardViewDetails.this, R.string.category_must_be_filled, Toast.LENGTH_SHORT).show();\n return false;\n }\n if(cost.getText().toString().isEmpty()){\n Toast.makeText(ExpenseCardViewDetails.this, R.string.cost_must_be_filled, Toast.LENGTH_SHORT).show();\n return false;\n }\n if(dateDue.getText().toString().isEmpty()){\n Toast.makeText(ExpenseCardViewDetails.this, R.string.date_due_must_be_filled, Toast.LENGTH_SHORT).show();\n return false;\n }\n return true;\n }", "private boolean controlarDatos() {\n\t\t\n\t\tif(textNombre.getText().equals(\"\")) {\n\t\t\tJOptionPane.showMessageDialog(null, \"El nombre no debe estar vacio\");\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t\t\n\t}", "public void limpiarCampos()\n {\n jtfNumero.setText(\"\");\n jtfNombre.setText(\"\");\n jtfSaldo.setText(\"\");\n this.jbEliminar.setEnabled(false);\n }", "public void LimpiarCampos() {\n\n txtIdAsignarPer.setText(\"\");\n txtNombreusu.setText(\"\");\n pswConfCont.setText(\"\");\n combPerf.setSelectedItem(\"\");\n pswContra.setText(\"\");\n txtDocumento.setText(\"\");\n }", "public String preValidar() {\n\t\tString errores = \"\";\r\n\t\t\r\n\t\tif (email == null || email.equals(\"\")) {\r\n\t\t\terrores = errores + \"indique el e-mail</br>\";\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\tif(!isValidEmailAddress()){\r\n\t\t\t\terrores = errores + \"indique un e-mail válido</br>\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (contrasenya == null || contrasenya.equals(\"\")) {\r\n\t\t\terrores = errores + \"indique la contraseña</br>\";\r\n\t\t} else {\r\n\t\t\tif(!isValidPwd()){\r\n\t\t\t\terrores = errores + \"la contraseña debe contener\"\r\n\t\t\t\t\t\t+ \" al menos 8 caracteres, y estos deben ser\"\r\n\t\t\t\t\t\t+ \"alfanuméricos</br>\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn errores;\r\n\t}", "public void checkText()\n\t{\n\t\ttry\n\t\t{\n\t\t\tqualityNum = Integer.parseInt(quality.getText());\n\t\t\tsidesNum = Integer.parseInt(sides.getText());\n\t\t\tlengthNum = Double.parseDouble(length.getText());\n\t\t\twidthNum = Double.parseDouble(width.getText());\n\t\t\theightNum = Double.parseDouble(height.getText());\n\t\t\tradiusNum = Double.parseDouble(radius.getText());\n\t\t\tradius2Num = Double.parseDouble(radius2.getText());\n\t\t\trollNum = Double.parseDouble(roll.getText());\n\t\t\tpitchNum = Double.parseDouble(pitch.getText());\n\t\t\tyawNum = Double.parseDouble(yaw.getText());\n\t\t}\n\t\tcatch(Exception ex)\n\t\t{\n\t\t}\n\t\t\n\t\tquality.setText(Integer.toString(qualityNum));\n\t\tsides.setText(Integer.toString(sidesNum));\n\t\tlength.setText(Double.toString(lengthNum));\n\t\twidth.setText(Double.toString(widthNum));\n\t\theight.setText(Double.toString(heightNum));\n\t\tradius.setText(Double.toString(radiusNum));\n\t\tradius2.setText(Double.toString(radius2Num));\n\t\troll.setText(Double.toString(rollNum));\n\t\tpitch.setText(Double.toString(pitchNum));\n\t\tyaw.setText(Double.toString(yawNum));\n\t}", "private String getCampo3() {\n String campo = this.campoLivre.substring(15);\n System.out.println(\"campo3 \" + campo);\n return boleto.getDigitoCampo(campo);\n }", "private boolean verificarText(String text,String campo) {\n\t\tif(text.length()==0) {\n\t\t\tJOptionPane.showMessageDialog(null,\"Error \"+campo +\": campo vacio\");\n\t\t\treturn false;\n\t\t}\n\t\t//\n\t\tfor(int i =0;i<text.length();i++) {\n\t\t\tif(text.charAt(i)!=' ') {\n\t\t\t\tif((text.charAt(i)<'a' || text.charAt(i)>'z'&& (text.charAt(i)<'A' || text.charAt(i)>'Z') ) ) {\n\t\t\t\t\tJOptionPane.showMessageDialog(null,\"Error \"+campo +\": Se ingreso un numero o caracter especial\");\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\t\n\t}", "@Override\n public void onClick(View v) {\n telefono = TelefonoEdt.getText().toString();\n correo = CorreoEdt.getText().toString();\n contrasena = ContrasenaEdt.getText().toString();\n nombre = Nombretext.getText().toString();\n\n if(!telefono.isEmpty() && !correo.isEmpty() && !contrasena.isEmpty() && !nombre.isEmpty()){\n if(contrasena.length()>=6 && telefono.length()==10){\n registrarUsuario();\n }else{\n Toast.makeText(ActivityUsuario.this, \"La contraseña debe tener al menos 6 caracteres\", Toast.LENGTH_LONG).show();\n Toast.makeText(ActivityUsuario.this, \"El telefono debe ser de 10 dígitos\", Toast.LENGTH_LONG).show();\n }\n\n }else{\n Toast.makeText(ActivityUsuario.this, \"Completar campos vacíos\", Toast.LENGTH_LONG).show();\n }\n }", "public void limpaTextFields() {\n tfMatricula.setText(\"\");\n tfNome.setText(\"\");\n tfDataNascimento.setText(\"\");\n tfTelefone.setText(\"\");\n tfSalario.setText(\"\");\n }", "private void checkFields() {\n if (month.getText().toString().isEmpty()) {\n month.setError(\"enter a month\");\n month.requestFocus();\n return;\n }\n if (day.getText().toString().isEmpty()) {\n day.setError(\"enter a day\");\n day.requestFocus();\n return;\n }\n if (year.getText().toString().isEmpty()) {\n year.setError(\"enter a year\");\n year.requestFocus();\n return;\n }\n if (hour.getText().toString().isEmpty()) {\n hour.setError(\"enter an hour\");\n hour.requestFocus();\n return;\n }\n if (minute.getText().toString().isEmpty()) {\n minute.setError(\"enter the minute\");\n minute.requestFocus();\n return;\n }\n if (AMorPM.getText().toString().isEmpty()) {\n AMorPM.setError(\"enter AM or PM\");\n AMorPM.requestFocus();\n return;\n }\n if (place.getText().toString().isEmpty()) {\n place.setError(\"enter the place\");\n place.requestFocus();\n return;\n }\n }", "public void exibeDataNascimentoInvalida() {\n JOptionPane.showMessageDialog(\n null,\n Constantes.GERENCIAR_FUNCIONARIO_DATA_NASCIMENTO_INVALIDA,\n Constantes.GERENCIAR_FUNCIONARIO_TITULO,\n JOptionPane.PLAIN_MESSAGE\n );\n }", "@Test\n public void deve_aceitar_descricao_entre_15_e_30_caracteres_valido() {\n telefone.setDescricao(random(20, true, false));\n assertTrue(isValid(telefone, telefone.getDescricao(), Find.class));\n }", "public static boolean ehCampoVazio(JTextField... campos) {\n String vazio = \"\";\n \n for (JTextField c : campos) {\n if (c.getText().equals(vazio)) {\n return true;\n }\n }\n return false;\n }", "@Override\n\tpublic void actionPerformed(ActionEvent ae) {\n\t\tif(ae.getSource()==jButton1)\n\t\t{\n\t\t\t\n\t\t\tString excercise[]=new String[12];\n\t\t\texcercise[0]=jTextField1.getText();\n\t\t\texcercise[1]=jTextField2.getText();\n\t\t\texcercise[2]=jTextField3.getText();\n\t\t\texcercise[3]=jTextField4.getText();\n\t\t\texcercise[4]=jTextField5.getText();\n\t\t\texcercise[5]=jTextField6.getText();\n\t\t\texcercise[6]=jTextField13.getText();\n\t\t\texcercise[7]=jTextField16.getText();\n\t\t\texcercise[11]=jTextField19.getText();\n\t\t\texcercise[9]=jTextField14.getText();\n\t\t\texcercise[8]=jTextField17.getText();\n\t\t\texcercise[10]=jTextField18.getText();\n\t\t\tint flag=0;\n\t\t\tfor(int i=0;i<12;i++)\n\t\t\t{\n\t\t\t\tif(excercise[i].equals(\"\"))\n\t\t\t\t{\n\t\t\t\t\tflag++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(flag);\n\t\t\tif(flag>=1)\n\t\t\t{\n\t\t\t\tJOptionPane.showMessageDialog(this, \"Fill All The Values\");\n\t\t\t}\n\t\t\telse if(isAlpha(excercise[1])||isAlpha(excercise[2])||isAlpha(excercise[4])||isAlpha(excercise[5])||isAlpha(excercise[7])||isAlpha(excercise[8])||isAlpha(excercise[10])||isAlpha(excercise[11]))\n\t\t\t{\n\t\t\t\tJOptionPane.showMessageDialog(this, \"Fill the Values of Sets and reps carefully \");\n\t\t\t\tjTextField2.setText(\"\");\n\t\t\t\tjTextField3.setText(\"\");\n\t\t\t\tjTextField5.setText(\"\");\n\t\t\t\tjTextField6.setText(\"\");\n\t\t\t\tjTextField16.setText(\"\");\n\t\t\t\tjTextField17.setText(\"\");\n\t\t\t\tjTextField18.setText(\"\");\n\t\t\t\tjTextField19.setText(\"\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\tMongoClient mongo;\n\t\t\ttry {\n\t\t\t\tmongo = new MongoClient(\"localhost\", 27017);\n\t\t\t\tDB db=mongo.getDB(\"Gym\");\n\t\t\t\tDBCollection Gym_Collection = db.getCollection(\"Customers\");\n\t\t\t\tBasicDBObject newDocument = new BasicDBObject();\n\t\t\t\tnewDocument.append(\"$set\",\n\t\t\t\t\t\tnew BasicDBObject().append(\"First_Name\", First_Name).append(\"Last_Name\",Last_Name).append(\"Sets\",excercise));\n\n\t\t\t\tBasicDBObject searchQuery = new BasicDBObject().append(\n\t\t\t\t\t\t\"First_Name\", First_Name)\n\t\t\t\t\t\t.append(\"Last_Name\", Last_Name);\n\n\t\t\t\tGym_Collection.update(searchQuery, newDocument);\n\t\t\t} catch (UnknownHostException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tthis.setVisible(false);\n\t\t\tnew Add_cust(\"pl\");\n\t\t\tnew Add_cust().setVisible(true);\n\t\t}\n\t\t}\n\t\telse if(ae.getSource()==jButton2)\n\t\t{\n\t\t\tSystem.out.println(\"10\");\n\t\t\tint value=JOptionPane.showConfirmDialog(this, \"Are You Sure You Don't Want To Add The Workout Chart?\");\n\t\t\tif(value==JOptionPane.YES_OPTION){\n\t\t\tthis.setVisible(false);\n\t\t\tnew Receptionist().setVisible(true);\n\t\t\t}\n\t\t}\n\t}", "private void naolopkhachhangtrvaotextfield() {\n\t\t\n\t\tint row=table.getSelectedRow();\n\t\ttry {\n\t\t\ttxtmakhhm.setText(table.getValueAt(row, 0).toString());\n\t\t\tjava.util.Date date=new SimpleDateFormat(\"yyyy-MM-dd\").parse((String) table.getValueAt(row, 5).toString());\n\t\t\tjdcNgaytra.setDate(date);\n\t\t\t\n\t\t\ttxtTinhtrang.setText(table.getValueAt(row, 6).toString());\n\t\t\tif(txtTinhtrang.getText().equalsIgnoreCase(\"\"))\n\t\t\t\ttxtTinhtrang.setText(\"\");\n\t\t\t\n\t\t\ttxtGhichu.setText(table.getValueAt(row, 7).toString());\n\t\t\tif(txtGhichu.getText().equalsIgnoreCase(\"\"))\n\t\t\t\ttxtGhichu.setText(\"\");\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\t//JOptionPane.showMessageDialog(this,\"bạn cần chọn dòng cần sửa !\");\n\t\t\treturn ;\n\t\t}\n\t}", "private void verificaNome() {\r\n\t\thasErroNome(nome.getText());\r\n\t\tisCanSave();\r\n\t}", "public void xuLyThemPhieuThanhToan(){\n //Ngat chuoi\n String strTongTien = txtTongTien.getText().trim();\n String[] tongTien = strTongTien.split(\"\\\\s\");\n String strTienPhaiTra = txtTienPhaiTra.getText().trim();\n String[] tienPhaiTra = strTienPhaiTra.split(\"\\\\s\");\n\n //xu ly them vao data base\n PhieuThanhToanSevice phieuThanhToanSevice = new PhieuThanhToanSevice();\n int x = phieuThanhToanSevice.themPhieuThanhToan(txtMaPTT.getText().trim(),\n cbbMaPDK.getSelectedItem().toString(),\n Integer.valueOf(txtSoThang.getText().trim()),\n txtNgayTT.getText().trim(), Float.valueOf(tongTien[0]), Float.valueOf(tienPhaiTra[0]));\n\n if (x > 0) {\n JOptionPane.showMessageDialog(null, \"Thanh toán thành công\");\n } else {\n JOptionPane.showMessageDialog(null, \"Thanh toán thất bại\");\n return;\n }\n\n }", "public void ValidarLetra() {\n\t\t\n\t\tString valorCampo = \"\";\n\t\t\n\t\tif (campo == 1) {\n\t\t\t\n\t\t\tvalorCampo = textCampo1.getText();\n\t\t}\n\t\telse if (campo == 2) {\n\t\t\t\n\t\t\t valorCampo = textCampo2.getText();\n\t\t}\n\t\t\n\t\telse if (campo == 3) {\n\t\t\t\n\t\t\tvalorCampo = textCampo3.getText();\n\t\t}\n\t\t\n\t\telse if (campo == 4) {\n\t\t\t\n\t\t\tvalorCampo = textCampo4.getText();\n\t\t}\n\t\t\n\t\telse if (campo == 5) {\n\t\t\t\n\t\t\tvalorCampo = textCampo5.getText();\n\t\t}\n\n\t\telse if (campo == 6) {\n\t\t\t\n\t\t\tvalorCampo = textCampo6.getText();\n\t\t}\n\t\t\n\t\telse if (campo == 7) {\n\t\t\t\n\t\t\tvalorCampo = textCampo7.getText();\n\t\t}\n\t\t\n\t\telse if (campo == 8) {\n\t\t\t\n\t\t\tvalorCampo = textCampo8.getText();\n\t\t}\n\t\t\n\t\telse if (campo == 9) {\n\t\t\t\n\t\t\tvalorCampo = textCampo9.getText();\n\t\t}\n\t\t\n\t\telse if (campo == 10) {\n\t\t\t\n\t\t\tvalorCampo = textCampo10.getText();\n\t\t}\n\n\t\t \n\t\tboolean existe = palabra.contains(valorCampo);\n\t\t \n\t\t System.out.println(\" \"+existe);\n\n\n\t\t\n\t\t\n\t\tSystem.out.println(\"probando campo \"+campo);\n\t\t\n\t\t/*campo = 0;*/\n\t\t\n\t\t//System.out.println(\" inicializa \"+campo);\n\n\t}", "private void limpaCampos() {\r\n\t\tnome.setText(\"\");\r\n\t\tsituacao.setSelectedIndex(0);\r\n\t\tidade.setText(\"\");\r\n\t\terroNome.setText(\"\");\r\n\t\terroIdade.setText(\"\");\r\n\t}", "@Override\n public String getMessage() {\n String chuoi=\"\";\n if (maCD.length()!=5)\n chuoi=\"MaCD bao gom 5 ki tu\";\n else if (soBaiHat<10)\n chuoi=\"So bai hat phai lon hon 10 bai\";\n return\n chuoi;\n }", "private void txt_observacionesKeyTyped(java.awt.event.KeyEvent evt) {\n if (txt_observaciones.getText().length()>= 500){\n\n evt.consume();\n JOptionPane.showMessageDialog(rootPane,\"Alcanzo el maximo de caracteres (500 caracteres)\");\n }\n }", "private void numero_contratoKeyReleased(java.awt.event.KeyEvent evt) {\n if(numero_contrato.getText().length()>0){\n lbl_error_numero_contrato.setVisible(false);\n }\n\n }", "private boolean validarComunicacion() {\n String texto = textInputAnadirComunicacion.getEditText().getText().toString().trim();\n if (texto.isEmpty()) {\n textInputAnadirComunicacion.setError(\"El campo no puede estar vacío\");\n return false;\n } else {\n textInputAnadirComunicacion.setError(null);\n return true;\n }\n }", "public String checkFormat() {\r\n\t\t\r\n\t\tString msg = null;\r\n\t\t\r\n\t\ttry {\t\t\t\t\t\t\t\t\t\t\t//input is not a number\r\n\t\t\t\r\n\t\t\tDouble.parseDouble(price.getText());\r\n\t\t\tInteger.parseInt(quantity.getText());\r\n\t\t\t \r\n\t\t}\r\n\t\t\r\n\t\tcatch(Exception e) {\r\n\t\t\t\r\n\t\t\treturn msg = \"Data format is invalid\";\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tif(name.getText().isEmpty() \t\t\t\t\t//wine name is empty\r\n\t\t\t\t|| name.getText().length() > 30\t\t\t//wine name is more than 30 letters\r\n\t\t\t\t\t|| quantity.getText().isEmpty()\t\t//quantity is empty\r\n\t\t\t\t\t\t||price.getText().isEmpty()\t\t//price is empty\r\n\t\t\t\t\t\t\t||((!(price.getText().length() - price.getText().indexOf('.') == 3))\t//price is not two decimal spaces \r\n\t\t\t\t\t\t\t\t\t&& price.getText().indexOf('.') != -1))\r\n\t\t{\r\n\t\t\t\r\n\t\t\tmsg = \"Data format is invalid\";\t\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\telse {\r\n\t\t\t\r\n\t\t\tmsg = null;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn msg;\r\n\t\t\r\n\t}", "@Override\n public void afterTextChanged(Editable editable) {\n checkFieldsForEmptyValues();\n }", "private void vaciarCampos() {\n\t\t// TODO Auto-generated method stub\n\t\ttxtCedula.clear();\n\t\ttxtNombre.clear();\n\t\ttxtApellidos.clear();\n\t\ttxtTelefono.clear();\n\t\ttxtCorreo.clear();\n\t\ttxtDireccion.clear();\n\t\ttxtUsuario.clear();\n\t\ttxtContrasenia.clear();\n\t}", "@Override\r\n public void afterTextChanged(Editable editable) {\n checkFieldsForEmptyValues();\r\n }", "public void validorolin() {\n if (roli.equals(\"Menaxher\")) {\n madministrimi.setVisible(false);\n }\n\n }", "private boolean haveEmptyField() {\n return getTextID(FIRST_NAME).isEmpty() ||\n getTextID(LAST_NAME).isEmpty() ||\n getTextID(ADDRESS).isEmpty();\n }", "private boolean validateInputs() {\n if (KEY_EMPTY.equals(tenchuxe)) {\n etTenChuXe.setError(\"Vui lòng điền Tên chủ xe\");\n etTenChuXe.requestFocus();\n return false;\n\n }\n if (KEY_EMPTY.equals(sdt)) {\n etSDT.setError(\"Vui lòng điền Số điện thoại\");\n etSDT.requestFocus();\n return false;\n\n }\n if (KEY_EMPTY.equals(mota)) {\n edMoTa.setError(\"Vui lòng điền Mô tả xe\");\n edMoTa.requestFocus();\n return false;\n\n }\n if (KEY_EMPTY.equals(biensoxe)) {\n etBienSoXe.setError(\"Vui lòng điền Biển số xe\");\n etBienSoXe.requestFocus();\n return false;\n }\n if (KEY_EMPTY.equals(passwordtx)) {\n etPasswordtx.setError(\"Vui lòng điền Mật khẩu\");\n etPasswordtx.requestFocus();\n return false;\n }\n\n if (KEY_EMPTY.equals(confirmPassword)) {\n etConfirmPassword.setError(\"Vui lòng điền Xác nhận mật khẩu\");\n etConfirmPassword.requestFocus();\n return false;\n }\n if (!passwordtx.equals(confirmPassword)) {\n etConfirmPassword.setError(\"Xác nhận mật khẩu sai !\");\n etConfirmPassword.requestFocus();\n return false;\n }\n\n return true;\n }", "@Override\n public void afterTextChanged(Editable s) {\n //s.toString();\n if (!s.toString().isEmpty()) {\n czyNazwisko = true;\n } else\n czyNazwisko = false;\n pokazOblicz();\n }", "private boolean isInvalid(JTextField campo) {\n return campo.getText().isEmpty();\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n txtNameC.setText(\"\");\n txtNumC.setText(\"\");\n txtTelC.setText(\"\");\n txtEmailC.setText(\"\");\n txtRueC.setText(\"\");\n txtVilleC.setText(\"\");\n txtCPC.setText(\"\");\n txtPwdC.setText(\"\");\n txtRePwdC.setText(\"\");\n txtCB.setText(\"\");\n //Définir l'étiquette d'information sur vide\n lbIMsgC.setText(\"\");\n\n }", "public void emptyTextField(){\n spelerIDField.setText(\"\");\n typeField.setText(\"\");\n codeField.setText(\"\");\n heeftBetaaldField.setText(\"\");\n }", "private void deshabilitarCamposCrear() {\n txtCodBockFoto.setEnabled(false);\n txtCodBockFoto.setText(\"\");\n\n txtCodPromotor.setEnabled(false);\n txtCodPromotor.setText(\"\");\n txtDNIPromotor.setText(\"\");\n\n //limpiarListaCrear();\n }", "private void validationUsername( String name ) throws Exception {\n\t\t\t if ( name != null && name.trim().length() < 3 ) {\n\t\t\t throw new Exception( \"Le nom d'utilisateur doit contenir au moins 3 caractères.\" );\n\t\t\t }\n\t\t\t}", "private void jButton19ActionPerformed(java.awt.event.ActionEvent evt) {\n String cadena;\n cadena = campoDeNumeros.getText();\n \n if(cadena.length() >0) {\n cadena = cadena.substring( 0, cadena.length() -1);\n campoDeNumeros.setText(cadena);\n }\n }", "private void limpiarCampos(){\n\ntxtId.setText(\"\");\ntxtCosto.setText(\"\");\ntxtDestino.setText(\"\");\ntxtKilom.setText(\"\");\ntxtMatricula.setText(\"\");\n\n\n\n}", "private boolean validateRequiredFields(StringBuffer b){\n boolean result = true;\n\n if (!TextFieldHelper.isNumericFieldValid(this.goalValue, \" Цель: \", b) ||\n !TextFieldHelper.isNumericFieldValid(this.startWeightValue, \" Исходный вес: \", b) ||\n !TextFieldHelper.isNumericFieldValid(this.heightValue, \" Рост: \", b) ||\n !CalendarHelper.isFieldValid(startProgramDateValue, \" Старт программы: \", b) ||\n !new ComboBoxFieldHelper<Client>().isFieldValid(clientFIOValue, \" Клиент: \", b))\n {\n result = false;\n }\n\n return result;\n }", "public boolean validarForm() throws Exception {\r\n\r\n\t\ttbxIdentificacion\r\n\t\t\t\t.setStyle(\"text-transform:uppercase;background-color:white\");\r\n\t\tlbxTipo_disnostico\r\n\t\t\t\t.setStyle(\"text-transform:uppercase;background-color:white\");\r\n\t\tlbxCodigo_consulta_pyp\r\n\t\t\t\t.setStyle(\"text-transform:uppercase;background-color:white\");\r\n\r\n\t\tString mensaje = \"Los campos marcados con (*) son obligatorios\";\r\n\r\n\t\tboolean valida = true;\r\n\r\n\t\tif (tbxIdentificacion.getText().trim().equals(\"\")) {\r\n\t\t\ttbxIdentificacion\r\n\t\t\t\t\t.setStyle(\"text-transform:uppercase;background-color:#F6BBBE\");\r\n\t\t\tvalida = false;\r\n\t\t}\r\n\r\n\t\tif (lbxTipo_disnostico.getSelectedIndex() == 0) {\r\n\t\t\tlbxTipo_disnostico\r\n\t\t\t\t\t.setStyle(\"text-transform:uppercase;background-color:#F6BBBE\");\r\n\t\t\tvalida = false;\r\n\t\t}\r\n\r\n\t\tif (!lbxFinalidad_cons.getSelectedItem().getValue().toString()\r\n\t\t\t\t.equalsIgnoreCase(\"10\")\r\n\t\t\t\t&& lbxCodigo_consulta_pyp.getSelectedIndex() == 0) {\r\n\t\t\tlbxCodigo_consulta_pyp\r\n\t\t\t\t\t.setStyle(\"text-transform:uppercase;background-color:#F6BBBE\");\r\n\t\t\tvalida = false;\r\n\t\t}\r\n\r\n\t\tif (tbxTipo_principal.getText().trim().equals(\"\")) {\r\n\t\t\tmensaje = \"Debe digitar la impresion diagnostica\";\r\n\t\t\tvalida = false;\r\n\t\t} else if (vaidarIgualdad(tbxTipo_principal.getText(),\r\n\t\t\t\ttbxTipo_relacionado_1.getText(),\r\n\t\t\t\ttbxTipo_relacionado_2.getText(),\r\n\t\t\t\ttbxTipo_relacionado_3.getText())) {\r\n\t\t\tmensaje = \"no se puede repetir la impresion diagnostica\";\r\n\t\t\tvalida = false;\r\n\t\t}\r\n\r\n\t\tif (!valida) {\r\n\t\t\tMessagebox.show(mensaje,\r\n\t\t\t\t\tusuarios.getNombres() + \" recuerde que...\", Messagebox.OK,\r\n\t\t\t\t\tMessagebox.EXCLAMATION);\r\n\t\t}\r\n\r\n\t\treturn valida;\r\n\t}", "public static boolean CantidadLetras(KeyEvent evt, JTextField text, int Cantidad) {\n if (text.getText().length() == Cantidad) {\n evt.consume();\n Toolkit.getDefaultToolkit().beep();\n return true;\n }\n return false;\n }", "public TipoCaracteresException() {\n\t\tsuper(\"Los campos 'nombre' y ' apellido' solo pueden contener letras\");\n\t}", "@Test\n public void nao_deve_aceitar_descricao_com_numeros() {\n telefone.setDescricao(random(10, true, true));\n assertFalse(isValid(telefone, \"A descrição não pode conter acentos, caracteres especiais e números.\", Find.class));\n }", "public static void alteraDep() {\n\t\tString nome, novaInfo = \"\";\n\t\tScanner sc = new Scanner(System.in);\n\t\tint check = 0;\n\n\t\tdo {\n\t\t\tSystem.out.println(\"\\nInsira o nome do departamento:\");\n\t\t\tnome = sc.nextLine();\n\t\t\tif(verificarLetras(nome) && nome.length()>0) {\n\t\t\t\tcheck = 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"\\nO nome apenas pode conter letras\");\n\t\t\t}\n\t\t}while(check==0);\n\t\t\n\t\tcheck = 0;\n\t\t\n\t\tSystem.out.println(\"\\nQual dos campos pretende alterar?\\n1- Morada\\n2- Numero de contacto\\n3- Email de contacto\\n4- Faculdade em que se insere\");\n\t\tString op = sc.nextLine();\n\t\t\n\t\tswitch(op) {\n\t\t\tcase \"1\":\n\t\t\t\tSystem.out.println(\"\\nInsira a nova morada:\");\n\t\t\t\tnovaInfo = sc.nextLine();\n\t\t\t\tbreak;\n\t\t\tcase \"2\":\n\t\t\t\tdo {\n\t\t\t\t\tSystem.out.println(\"Insira o numero de contacto:\\n\");\n\t\t\t\t\tnovaInfo = sc.nextLine();\n\t\t\t\t\tif(verificarNumeros(novaInfo) && novaInfo.length()<= 9) {\n\t\t\t\t\t\tif (Integer.parseInt(novaInfo) > 0) {\n\t\t\t\t\t\t\tcheck = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tSystem.out.println(\"\\nO numero de contacto so pode conter 9 digitos\");\n\t\t\t\t\t}\n\t\t\t\t}while(check==0);\n\t\t\t\tcheck = 0;\n\t\t\t\tbreak;\n\t\t\tcase \"3\":\n\t\t\t\tSystem.out.println(\"Insira o email:\\n\");\n\t\t\t\tnovaInfo = sc.nextLine();\n\t\t\t\tbreak;\n\t\t\tcase \"4\":\n\t\t\t\tdo {\n\t\t\t\t\tSystem.out.println(\"\\nInsira o nome da faculdade:\");\n\t\t\t\t\tnovaInfo = sc.nextLine();\n\t\t\t\t\tif(verificarLetras(novaInfo) && novaInfo.length()>0) {\n\t\t\t\t\t\tcheck = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tSystem.out.println(\"\\nO nome apenas pode conter letras\");\n\t\t\t\t\t}\n\t\t\t\t}while(check==0);\n\t\t\t\tcheck = 0;\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\tString msgServer = \"\";\n\t\t\n\t\tcheck = 0;\n\t\tint tries = 0;\n\t\tdo {\n\t\t\ttry {\n\t\t\t\tmsgServer = rmiserver.alterarDep(nome, op, novaInfo);\n\t\t\t\tSystem.out.println(msgServer);\n\t\t\t\tSystem.out.println(\"\\n\");\n\t\t\t\tcheck = 1;\n\t\t\t} catch (RemoteException e1) {\n\t\t\t\t// Tratamento da Excepcao da chamada RMI inserirFac\n\t\t\t\tif(tries == 0) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(6000);\n\t\t\t\t\t\t//faz novo lookup\n\t\t\t\t\t\trmiserver = (RMI_S_I) Naming.lookup(\"rmi://\"+registryIP+\":\"+registryPort+\"/rmi\");\n\t\t\t\t\t\trmiserver.subscribeConsola((ADMIN_C_I)consola);\n\t\t\t\t\t\ttries = 0;\n\t\t\t\t\t} catch (RemoteException | InterruptedException | MalformedURLException | NotBoundException e) {\n\t\t\t\t\t\t// FailOver falhou\n\t\t\t\t\t\ttries++;\n\t\t\t\t\t}\n\t\t\t\t}else if(tries > 0 && tries < 24) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(1000);\n\t\t\t\t\t\t//faz novo lookup\n\t\t\t\t\t\trmiserver = (RMI_S_I) Naming.lookup(\"rmi://\"+registryIP+\":\"+registryPort+\"/rmi\");\n\t\t\t\t\t\trmiserver.subscribeConsola((ADMIN_C_I)consola);\n\t\t\t\t\t\ttries = 0;\n\t\t\t\t\t} catch (RemoteException | InterruptedException | MalformedURLException | NotBoundException e) {\n\t\t\t\t\t\t// FailOver falhou\n\t\t\t\t\t\ttries++;\n\t\t\t\t\t}\n\t\t\t\t}else if(tries >= 24) {\n\t\t\t\t\tSystem.out.println(\"Impossivel realizar a operacao devido a falha tecnica (Servidores RMI desligados).\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}while(check==0);\n\t\tcheck = 0;\n\t}", "public String comunica() {\r\n// ritorna una stringa\r\n// posso usare il metodo astratto \r\n return msg + AggiungiQualcosa();\r\n }", "@Override\n public void afterTextChanged(Editable s) {\n if (s.toString().length() == 1 && !s.toString().startsWith(\"3\")) {\n s.clear();\n }\n }", "public boolean verificarCamposVaciosIPRMI(TextField campoIPRMI1, TextField campoIPRMI2, TextField campoIPRMI3, TextField campoIPRMI4) {\n boolean camposLlenos = true;\n if (campoIPRMI1.getText().isEmpty() || campoIPRMI2.getText().isEmpty() || campoIPRMI3.getText().isEmpty() || campoIPRMI4.getText().isEmpty()) {\n camposLlenos = false;\n }\n return camposLlenos;\n }", "private boolean checkVehicleModel(EditText text, TextInputLayout TFB, String massage) {\n if(text.getText().toString().length() > 4 || text.getText().toString().length() < 4)\n {\n TFB.setErrorEnabled(true);\n TFB.setError(massage);\n return false;\n }\n else\n {\n TFB.setErrorEnabled(false);\n return true;\n }\n }", "private boolean checkFields() {\n if (editTxtName.getText().equals(\"\")) return false;//name\n if (editTxtDesc.getText().equals(\"\")) return false;//desc\n if (editClrColor.getValue() == null) return false;//color\n if (oldEnvironment == null) return false;//environment is null\n return true;//everything is valid\n }", "@Override\n public void showEmptyFieldsValidationError() {\n showError(R.string.product_config_empty_fields_validation_error);\n }", "@Test\n public void nao_deve_aceitar_descricao_com_a_primeira_letra_minuscula() {\n telefone.setDescricao(\"celular empresarial.\");\n assertFalse(isValid(telefone, \"A descrição não pode conter acentos, caracteres especiais e números.\", Find.class));\n }", "private boolean validarDatos() {\r\n\t\tboolean _esValido = true;\r\n\r\n\t\tif (txField_lugar.getText() == null || txField_lugar.getText().isEmpty())\r\n\t\t\t_esValido = false;\r\n\t\treturn _esValido;\r\n\t}", "private boolean verifica(){\n if(et_nomeAddFamiliar.getText().length()>3 && spinnerParentesco.getSelectedItemPosition()>0){\n return true;\n }\n else return false;\n\n }", "public void onTextChanged(CharSequence s, int start, int before, int count) {\n if (et_One.getText().length() == 1) {\r\n }\r\n }", "private void err3() {\n\t\tString errMessage = CalculatorValue.checkMeasureValue(text_Operand3.getText());\n\t\tif (errMessage != \"\") {\n\t\t\t// System.out.println(errMessage);\n\t\t\tlabel_errOperand3.setText(CalculatorValue.measuredValueErrorMessage);\n\t\t\tif (CalculatorValue.measuredValueIndexofError <= -1)\n\t\t\t\treturn;\n\t\t\tString input = CalculatorValue.measuredValueInput;\n\t\t\toperand3ErrPart1.setText(input.substring(0, CalculatorValue.measuredValueIndexofError));\n\t\t\toperand3ErrPart2.setText(\"\\u21EB\");\n\t\t} else {\n\t\t\terrMessage = CalculatorValue.checkErrorTerm(text_Operand3.getText());\n\t\t\tif (errMessage != \"\") {\n\t\t\t\t// System.out.println(errMessage);\n\t\t\t\tlabel_errOperand3.setText(CalculatorValue.errorTermErrorMessage);\n\t\t\t\tString input = CalculatorValue.errorTermInput;\n\t\t\t\tif (CalculatorValue.errorTermIndexofError <= -1)\n\t\t\t\t\treturn;\n\t\t\t\toperand3ErrPart1.setText(input.substring(0, CalculatorValue.errorTermIndexofError));\n\t\t\t\toperand3ErrPart2.setText(\"\\u21EB\");\n\t\t\t}\n\t\t}\n\t}", "private boolean estValide() {\n if (textFieldNom.getText() == null || textFieldNom.getText().isEmpty() || comboBoxVisibilite.getSelectionModel().getSelectedItem() == null\n || comboBoxType.getSelectionModel().getSelectedItem() == null) {\n erreurLabel.setText(\"Tous les champs doivent etre remplis\");\n return false;\n }\n erreurLabel.setText(\"\");\n return true;\n }" ]
[ "0.6945717", "0.64626014", "0.6301496", "0.62744063", "0.62543225", "0.62193453", "0.6208582", "0.6190504", "0.61858547", "0.6152109", "0.61351883", "0.6128896", "0.6098461", "0.6080736", "0.60766166", "0.603876", "0.6024841", "0.6015321", "0.60112005", "0.59976137", "0.59915185", "0.5976901", "0.5972493", "0.5963896", "0.5961686", "0.59609413", "0.596054", "0.59112716", "0.5888887", "0.5881001", "0.58726066", "0.5868636", "0.585489", "0.58393914", "0.5836457", "0.583209", "0.5822215", "0.58209056", "0.5819843", "0.5815426", "0.5804927", "0.5803117", "0.5783804", "0.5780344", "0.57797766", "0.57708204", "0.5768053", "0.57664", "0.57615674", "0.57609", "0.5754732", "0.575414", "0.5748798", "0.5716455", "0.5716416", "0.57058877", "0.5702965", "0.56992877", "0.5692873", "0.5688754", "0.56854564", "0.5683887", "0.5679945", "0.5665273", "0.5654201", "0.56428516", "0.56339854", "0.5632045", "0.5601026", "0.5597334", "0.5592641", "0.55917484", "0.5582401", "0.55800927", "0.55785763", "0.55726194", "0.5566951", "0.5563592", "0.55575943", "0.55539197", "0.5551462", "0.5544349", "0.55419016", "0.5540754", "0.5531864", "0.55311114", "0.55293614", "0.5526698", "0.5526363", "0.5522397", "0.55178714", "0.5515934", "0.5515503", "0.55121344", "0.5510387", "0.55045044", "0.55010015", "0.5500459", "0.54966766", "0.5481582", "0.5479647" ]
0.0
-1
Permite revisar si alguno de los campos para ingresar la ip de Node excede los 3 caracteres
public boolean verificarLongitudCamposIPNode(TextField campoIPNode1, TextField campoIPNode2, TextField campoIPNode3, TextField campoIPNode4) { boolean camposCorrectos = true; if (campoIPNode1.getText().length() > 3 || campoIPNode2.getText().length() > 3 || campoIPNode3.getText().length() > 3 || campoIPNode4.getText().length() > 3) { camposCorrectos = false; } return camposCorrectos; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void remplireListeIp(){\r\n bddIp.add(\"id\");\r\n bddIp.add(\"ip\");\r\n bddIp.add(\"nom\");\r\n bddIp.add(\"latence\");\r\n bddIp.add(\"etat\");\r\n bddIp.add(\"popup\");\r\n bddIp.add(\"mac\");\r\n bddIp.add(\"bdext_perte\");\r\n bddIp.add(\"port\");\r\n }", "private String getIp(){\n\t\tStringBuilder ip=new StringBuilder(20);\n\t\t\n\t\tEditText ip1=(EditText) findViewById(R.id.ipaddress_text_1);\n\t\tEditText ip2=(EditText) findViewById(R.id.ipaddress_text_2);\n\t\tEditText ip3=(EditText) findViewById(R.id.ipaddress_text_3);\n\t\tEditText ip4=(EditText) findViewById(R.id.ipaddress_text_4);\n\t\tEditText ip5=(EditText) findViewById(R.id.ipaddress_text_5);\n\t\t\n\t\tip.append(ip1.getText());\n\t\tip.append('.');\n\t\tip.append(ip2.getText());\n\t\tip.append('.');\n\t\tip.append(ip3.getText());\n\t\tip.append('.');\n\t\tip.append(ip4.getText());\n\t\tif(!(ip5.getText().toString().equals(\"\"))){\n\t\t\tip.append(':');\n\t\t\tip.append(ip5.getText());\n\t\t}\n\t\t\n\t\treturn ip.toString();\n\t}", "java.lang.String getIp();", "java.lang.String getIp();", "java.lang.String getIp();", "java.lang.String getIp();", "java.lang.String getIp();", "java.lang.String getIp();", "java.lang.String getIp();", "java.lang.String getIp();", "private static boolean validatingIP(String IP)\n {\n if(IP.equalsIgnoreCase(\"localhost\"))\n {\n return true;\n }\n try\n {\n if (IP == null || IP.isEmpty())\n {\n return false;\n }\n\n String[] parts = IP.split(\"\\\\.\");\n if (parts.length != 4)\n {\n return false;\n }\n\n for (String s : parts)\n {\n int i = Integer.parseInt(s);\n if ((i < 0) || (i > 255))\n {\n return false;\n }\n }\n if (IP.endsWith(\".\"))\n {\n return false;\n }\n\n return true;\n }\n catch (NumberFormatException nfe)\n {\n return false;\n }\n\n }", "@Nullable public abstract String ipAddress();", "boolean hasIp();", "boolean hasIp();", "boolean hasIp();", "boolean hasIp();", "public Builder setIp(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n ip_ = value;\n onChanged();\n return this;\n }", "String getIp();", "String getIp();", "static boolean validateIP(String ip) {\n String[] ips = ip.split(\"\\\\.\");\n System.out.println(Arrays.toString(ips));\n if(ips.length != 4) return false;\n System.out.println(Arrays.toString(ips));\n \n for(String s : ips){\n int b;\n try{\n b = Integer.parseInt(s);\n if(b<0 || b> 255)return false;\n }catch(Exception e){\n return false;\n }\n }\n \n return true;\n\t}", "public static String getIPCliente(){//192.168, 172.16. o 10.0.\n\t\tString ipAddress=\"\";\n\t\ttry{\n\t\t\tHttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();\n\t\t\tipAddress = request.getHeader(\"X-FORWARDED-FOR\");\n\t\t\tif ( ipAddress == null ) {\n\t\t\t\tipAddress = request.getRemoteAddr();\n\t\t\t\tif(ipAddress.equals(\"127.0.0.1\")){\n\t\t\t\t\ttry {\n\t\t\t\t\t\tipAddress = InetAddress.getLocalHost().getHostAddress();\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tipAddress = \"\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tString[] ips = ipAddress.split(\",\");\n\t\t\tfor(String ip : ips){\n\t\t\t\tif(!ip.trim().startsWith(\"127.0.\")){\n\t\t\t\t\tipAddress = ip;\n\t\t\t\t}\n\t\t\t}\n\t\t}catch(Exception ex){\n\t\t\tex.printStackTrace();\n\t\t}\n\t\treturn ipAddress;\n\t}", "private ZapTextField getTxtProxyIp() {\n \t\tif (txtProxyIp == null) {\n \t\t\ttxtProxyIp = new ZapTextField(\"\");\n \t\t}\n \t\treturn txtProxyIp;\n \t}", "private static String checkAddress(String raw) \n\t{\n\t\t// Check to see if the length is greater than the maxLength of user input.\n\t\tif(raw.length() > maxLength) \n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\t\treturn raw;\n\t}", "public String getIp(){\n\treturn ip;\n }", "public Builder setIp(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n ip_ = value;\n onChanged();\n return this;\n }", "public boolean verificarCamposVaciosIPNode(TextField campoIPNode1, TextField campoIPNode2, TextField campoIPNode3, TextField campoIPNode4, TextField campoPuertoNode) {\n boolean camposLlenos = true;\n if (campoIPNode1.getText().isEmpty() || campoIPNode2.getText().isEmpty() || campoIPNode3.getText().isEmpty() || campoIPNode4.getText().isEmpty() || campoPuertoNode.getText().isEmpty()) {\n camposLlenos = false;\n }\n return camposLlenos;\n }", "public java.lang.String getIp(){\r\n return localIp;\r\n }", "public java.lang.String getIp(){\r\n return localIp;\r\n }", "public void setIp(String ip) {\n this.ip = ip;\n }", "public Builder setIp(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000004;\n ip_ = value;\n onChanged();\n return this;\n }", "public void setIpadress(java.lang.String ipadress) {\r\n this.ipadress = ipadress;\r\n }", "public Builder setIp(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n ip_ = value;\n onChanged();\n return this;\n }", "public void setIp(String ip) {\r\n this.ip = ip == null ? null : ip.trim();\r\n }", "public void setIp(String ip) {\n this.ip = ip;\n }", "public void setIp(String ip) {\n this.ip = ip;\n }", "public Builder setIp(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n ip_ = value;\n onChanged();\n return this;\n }", "@Override\n\t\tpublic String buildBasicIp() {\n\t\t\treturn buildIp();\n\t\t}", "public String getIp();", "int getInIp();", "int getInIp();", "private boolean validate(final String ip){\t\t \n \t Pattern pattern = Pattern.compile(IPADDRESS_PATTERN);\n\t Matcher matcher = pattern.matcher(ip);\n\t return matcher.matches();\t \t \n }", "public void setIp(String ip) {\n this.ip = ip;\n }", "public void setIp(String ip) {\n this.ip = ip == null ? null : ip.trim();\n }", "public void setIp(String ip) {\n this.ip = ip == null ? null : ip.trim();\n }", "public void setIp(String ip) {\n this.ip = ip == null ? null : ip.trim();\n }", "private String getIP() {\n\t\treturn getRandomArbitrary(Constants.MIN_IP_VALUE, Constants.MAX_IP_VALUE) + Constants.DOT\n\t\t\t\t+ getRandomArbitrary(Constants.MIN_IP_VALUE, Constants.MAX_IP_VALUE) + Constants.DOT\n\t\t\t\t+ getRandomArbitrary(Constants.MIN_IP_VALUE, Constants.MAX_IP_VALUE) + Constants.DOT\n\t\t\t\t+ getRandomArbitrary(Constants.MIN_IP_VALUE, Constants.MAX_IP_VALUE);\n\n\t}", "public String getIp() {\r\n return ip;\r\n }", "public void setIp(java.lang.String ip) {\r\n this.ip = ip;\r\n }", "public String getIPAddress () {\n\t\treturn _ipTextField.getText();\n\t}", "int getIp();", "int getIp();", "int getIp();", "public static String getServerIP() { return tfJoinIP.getText(); }", "private Label getIP() { \n\t\tString address = new String(); \n\t\ttry { \n\t\t\tURL IpWebSite = new URL(\"http://bot.whatismyipaddress.com\"); \n\t\t\tBufferedReader sc = new BufferedReader(new InputStreamReader(IpWebSite.openStream())); \n\t\t\t\n\t\t\taddress = sc.readLine(); \n\t\t\t\n\t\t} catch (Exception e) { \n\t address = \"Can't get your IP Address \\n Check your internet connection\"; \n\t } \n\t\t\n\t\tLabel ip = new Label(\"Your IP Address is : \" + address);\n\t\tip.setMaxWidth(Double.MAX_VALUE);\n\t\tip.setAlignment(Pos.CENTER);\n\t\treturn ip;\n\t}", "public void getIP(){\n String requestIP = DomainTextField.getText();\n\n Connection conn = new Connection();\n\n String domain = conn.getIP(requestIP);\n\n output.writeln(requestIP + \" --> \" + domain);\n }", "public void setIp(java.lang.String param){\r\n localIpTracker = true;\r\n \r\n this.localIp=param;\r\n \r\n\r\n }", "public void setIp(java.lang.String param){\r\n localIpTracker = true;\r\n \r\n this.localIp=param;\r\n \r\n\r\n }", "@Override\n\tpublic String getIp() {\n\t\treturn ip;\n\t}", "public boolean validateIP(String ip)\n\t{\n\t\treturn ip.matches(\"localhost\") || ip.matches(IP_REGEX);\n\t}", "public String getIp() {\n return ip;\n }", "public String long_ip(long numero_ip){\n String str_num_ip=\"\";\n for(int i=3; i>=0; i--){\n str_num_ip += (0b1111_1111 & (numero_ip >> (i*8) )) + (i!=0? \".\": \"\");\n }\n return str_num_ip;\n }", "private void setTargetServer(){\n mTargetServer = findViewById(R.id.network_scanner_host_edit_text);\n String ip = DefaultPreferences.getIp(this);\n if(ip != null) {\n mTargetServer.setText(ip);\n }\n\n mTargetServer.addTextChangedListener(new TextWatcher() {\n @Override\n public void beforeTextChanged(CharSequence s, int start, int count, int after) {\n\n }\n\n @Override\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n DefaultPreferences.setIp(NetworkScannerActivity.this, s.toString());\n }\n\n @Override\n public void afterTextChanged(Editable s) {\n\n }\n });\n }", "public void setIp (java.lang.String ip) {\r\n\t\tthis.ip = ip;\r\n\t}", "public void setIp (java.lang.String ip) {\r\n\t\tthis.ip = ip;\r\n\t}", "public void setValues() throws UnknownHostException\n\t{\n\t\tipInsurance.setText(getIPAddress());\n\t\tipInsurance.setEnabled(false);\n\t\tipInsurance.setEditable(false);\n\t\tportInsurance.setText(\"\"+Constants.RMI_PORT_INSURANCE);\n\t\t\n\t\tipHospital.setText(\"\"+Constants.RMI_ADDRESS_HOSPITAL);\n\t\tportHospital.setText(\"\"+Constants.RMI_PORT_HOSPITAL);\n\t\t\n\t}", "private void printAllIp(String s) {\n\t\t//validate for string. Can contiain only digits. Should not correspond to negative integer. \n\n\t\tif (s.length() > 12 || s.length () < 4) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// i, j, k are 1 based indices.\n\t\tfor (int i = 1; i <= s.length() - 3; i++) {\n\t\t\tfor (int j = i + 1; j <= s.length() - 2; j++) {\n\t\t\t\tfor (int k = j + 1; k <= s.length() - 1; k++) {\n\t\t\t\t\tif (isValid(s, i, j, k)) {\n\t\t\t\t\t\tSystem.out.println(format(s, i, j , k));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private static boolean isValidIpAddress(String value) {\n boolean status = true;\n try {\n Ip4Address ipAddress = Ip4Address.valueOf(value);\n } catch (Exception e) {\n log.debug(\"Invalid IP address string: {}\", value);\n return false;\n }\n\n return status;\n }", "@Override\r\n\tpublic boolean hasIpAddressSupport() {\n\t\treturn false;\r\n\t}", "public void setDeviceIP(String argIp){\n\t deviceIP=argIp;\n }", "private static void getTcpPublicAddress() {\n\n\t\tString address = readFileString(FileConstant.FILE_NAME_TCP_ADDRESS_PUBLIC);\n\n\t\tif (Utils.isNotEmpty(address)) {\n\n\t\t\tint start = 0;\n\t\t\tint end = address.indexOf(FileConstant.FILE_STRING_SPLIP_SYMBOL, start);\n\n\t\t\tif (end < address.length()) {\n\n\t\t\t\tConfigureVariable.Tcp_Address_Ip_Public = address.substring(start, end);\n\n\t\t\t\tstart = end + 1;\n\t\t\t\tend = address.length();\n\n\t\t\t\tConfigureVariable.Tcp_Address_Port_Public = address.substring(start, end);\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n\tpublic String getIp() {\n\t\treturn null;\r\n\t}", "public String getIp() {\n\t\treturn ip.getText();\n\t}", "public void setIp(String value) {\n set(24, value);\n }", "@Override\n\t\tpublic void ipChange() {\n\t\t\t\n\t\t}", "public void setIp(final String ip) {\n this.ip = ip;\n }", "private String[] setPacket() throws IllegalAccessException\n\t{\n\n\t\tSystem.out.println(\"Please specify receiver address, port and message. Separate the input with | \" +\n\t\t\t\t\"\\n Eg: 192.0.0.1|8080|message1|message2 \" +\n\t\t\t\t\"\\n Waiting for user input:\");\n\n\t\tScanner scanner = new Scanner(System.in);\n\t\tif (scanner.hasNext())\n\t\t{\n\t\t\tString input = scanner.nextLine();\n\t\t\tString[] packetData = input.split(\"\\\\|\");\n\n\t\t\tif (isUserInputValid(packetData))\n\t\t\t{\n\t\t\t\tfor (int i = 2; i < packetData.length; i++)\n\t\t\t\t{\n\t\t\t\t\tString tempMessage = packetData[i];\n\t\t\t\t\tString messageWithHashCode = new String(tempMessage + \"$\" + tempMessage.hashCode()+\"$\");\n\t\t\t\t\tpacketData[i] = messageWithHashCode;\n\t\t\t\t}\n\t\t\t\treturn packetData;\n\t\t\t}\n\t\t\telse throw new IllegalArgumentException(\"Entered port or address is invalid.\");\n\t\t}\n\t\telse return null;\n\t}", "private void setIp(int value) {\n \n ip_ = value;\n }", "private void setIp(int value) {\n \n ip_ = value;\n }", "public String getIp() {\n return ip;\n }", "public String getIp() {\n return ip;\n }", "public String getIp() {\n return ip;\n }", "public String getIp() {\n return ip;\n }", "public String getIp() {\n return ip;\n }", "public String getIp() {\n return ip;\n }", "public java.lang.String getIpadress() {\r\n return ipadress;\r\n }", "private void setInIp(int value) {\n \n inIp_ = value;\n }", "private void setInIp(int value) {\n \n inIp_ = value;\n }", "public Builder setIp(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n ip_ = value;\n bitField0_ |= 0x00000002;\n onChanged();\n return this;\n }", "public abstract String associatePredefinedAddress(NodeMetadata node, String ip);", "private boolean isUserInputValid(String[] packetData)\n\t{\n\t\tif(packetData.length < 3 ) return false;\n\t\tString address = packetData[0];\n\t\tint port = Integer.parseInt(packetData[1]);\n\n\t\tint addressPeriodsCount = address.length() - address.replace(\".\", \"\").length();\n\n\t\tif (packetData.length < 3)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse if(address.equals(\"localhost\") && (port > 0 || port <= 65535))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn (addressPeriodsCount == 3 ||addressPeriodsCount == 2 ) && (port > 0 || port <= 65535);\n\t\t}\n\t}", "public String getIp() {\n return ip;\n }", "public String toString() {\n\n\t\treturn \"only one ip: \";\n\t}", "java.lang.String getSnIp();", "java.lang.String getSnIp();", "private boolean validate(final String ip) {\t \n final Matcher matcher = m_pattern.matcher(ip);\n return matcher.matches();\n }", "public String getIp() {\n return (String) get(24);\n }", "public String getIP() {\n return this.IP;\n }", "public String inputIPAddress() {\n Scanner in = new Scanner(System.in);\n\n String message = \"Enter IP address you want to connect to: \";\n System.out.print(message);\n\n String address = in.nextLine();\n\n if (address.isEmpty()) {\n System.out.println(\"Empty IP address. Using localhost (127.0.0.1)\");\n address = \"127.0.0.1\";\n }\n\n return address;\n }", "public Builder setSnIp(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n snIp_ = value;\n onChanged();\n return this;\n }", "public Builder setSnIp(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n snIp_ = value;\n onChanged();\n return this;\n }" ]
[ "0.6269783", "0.6222142", "0.60951686", "0.60951686", "0.60951686", "0.60951686", "0.60951686", "0.60951686", "0.60951686", "0.60951686", "0.60646665", "0.59806645", "0.59519553", "0.59519553", "0.59519553", "0.59519553", "0.594004", "0.5909252", "0.5909252", "0.59000117", "0.5898959", "0.58774126", "0.5868535", "0.5839181", "0.5831775", "0.5817433", "0.5792497", "0.5792497", "0.57635504", "0.57568824", "0.5738692", "0.572435", "0.5710657", "0.56981117", "0.56981117", "0.5694789", "0.569219", "0.568491", "0.56700397", "0.56700397", "0.5650113", "0.56418455", "0.564036", "0.564036", "0.564036", "0.5628585", "0.5622341", "0.56134593", "0.5601836", "0.5599511", "0.5599511", "0.5599511", "0.55976987", "0.5593042", "0.55878764", "0.55870235", "0.55870235", "0.5586331", "0.5557171", "0.5556558", "0.55515456", "0.55452555", "0.55419624", "0.55419624", "0.55353767", "0.5532028", "0.55272985", "0.55204386", "0.55183214", "0.5511113", "0.55076647", "0.55075604", "0.5503307", "0.54971284", "0.5486544", "0.54667443", "0.54603696", "0.54603696", "0.54585725", "0.54585725", "0.54585725", "0.54585725", "0.54585725", "0.54585725", "0.5450169", "0.54335266", "0.54335266", "0.54244834", "0.54220563", "0.54207635", "0.53989244", "0.5389472", "0.538493", "0.538493", "0.53835577", "0.5377024", "0.5375545", "0.5368468", "0.5359081", "0.5359081" ]
0.6348147
0
Initialize your data structure here.
public MyHashMap() { arr = new int[100000]; //To initialize the value with -1 Arrays.fill(arr,-1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initData() {\n }", "private void initData() {\n\t}", "private void initData() {\n\n }", "public void initData() {\n }", "public void initData() {\n }", "@Override\n\tpublic void initData() {\n\n\n\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\n\tpublic void initData() {\n\t\t\n\t}", "@Override\n protected void initData() {\n }", "@Override\n protected void initData() {\n }", "@Override\n\tpublic void initData() {\n\n\t}", "@Override\n\tpublic void initData() {\n\n\t}", "@Override\n\tpublic void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "private void InitData() {\n\t}", "@Override\r\n\tpublic void initData() {\n\t}", "private void initData(){\n\n }", "public AllOOneDataStructure() {\n map = new HashMap<>();\n vals = new HashMap<>();\n maxKey = minKey = \"\";\n max = min = 0;\n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tprotected void initData(){\n\t\tsuper.initData();\n\t}", "public InitialData(){}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "protected @Override\r\n abstract void initData();", "private void initialize() {\n first = null;\n last = null;\n size = 0;\n dictionary = new Hashtable();\n }", "public DesignADataStructure() {\n arr = new ArrayList<>();\n map = new HashMap<>();\n }", "public void initData() {\n\t\tnotes = new ArrayList<>();\n\t\t//place to read notes e.g from file\n\t}", "public void initialize() {\n // empty for now\n }", "void initData(){\n }", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void initData(){\r\n \r\n }", "public void initialize()\n {\n }", "private void initData() {\n\t\tpages = new ArrayList<WallpaperPage>();\n\n\t}", "public void init() {\n \n }", "private void initializeData() {\n posts = new ArrayList<>();\n posts.add(new Posts(\"Emma Wilson\", \"23 years old\", R.drawable.logo));\n posts.add(new Posts(\"Lavery Maiss\", \"25 years old\", R.drawable.star));\n posts.add(new Posts(\"Lillie Watts\", \"35 years old\", R.drawable.profile));\n }", "public static void init() {\n buildings = new HashMap<Long, JSONObject>();\n arr = new ArrayList();\n buildingOfRoom = new HashMap<Long, Long>();\n }", "public void init() {\n\t\t}", "public void InitData() {\n }", "abstract void initializeNeededData();", "@Override\r\n\tprotected void init() {\n\t\tupdateValues();\r\n\t}", "@Override\n\t\tpublic void init() {\n\t\t}", "private RandomData() {\n initFields();\n }", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "private TigerData() {\n initFields();\n }", "public Data() {\n this.customers = new HashMap<>();\n this.orders = new HashMap<>();\n this.siteVisits = new HashMap<>();\n this.imageUploads = new HashMap<>();\n }", "public void init()\n {\n this.tripDict = new HashMap<String, Set<Trip>>();\n this.routeDict = new HashMap<String, Double>();\n this.tripList = new LinkedList<Trip>();\n this.computeAllPaths();\n this.generateDictionaries();\n }", "public void init() {\n for (int i = 1; i <= 20; i++) {\n List<Data> dataList = new ArrayList<Data>();\n if (i % 2 == 0 || (1 + i % 10) == _siteIndex) {\n dataList.add(new Data(i, 10 * i));\n _dataMap.put(i, dataList);\n }\n }\n }", "private void initData() {\n requestServerToGetInformation();\n }", "private void Initialized_Data() {\n\t\t\r\n\t}", "void initData() {\r\n\t\tthis.daVinci = new Artist(\"da Vinci\");\r\n\t\tthis.mona = new Painting(daVinci, \"Mona Lisa\");\r\n\t\t//this.lastSupper = new Painting(this.daVinci, \"Last Supper\");\r\n\t}", "private void initValues() {\n \n }", "private void init() {\n }", "public void initialize() {\n grow(0);\n }", "public void init() {\r\n\r\n\t}", "private void initialize()\n {\n aggregatedFields = new Fields(fieldToAggregator.keySet());\n }", "@objid (\"4bb3363c-38e1-48f1-9894-6dceea1f8d66\")\n public void init() {\n }", "public void initialize() {\n\n fechaDeLaVisita.set(LocalDate.now());\n\n if (medico.get() != null) {\n medico.get().clear();\n } else {\n medico.set(new Medico());\n }\n\n turnoVisita.set(\"\");\n visitaAcompanadaSN.set(false);\n lugarVisita.set(\"\");\n if (causa.get() != null) {\n causa.get().clear();\n } else {\n causa.set(new Causa());\n }\n\n if (promocion.get() != null) {\n promocion.get().clear();\n } else {\n promocion.set(new Promocion());\n }\n\n observacion.set(\"\");\n persistida.set(false);\n persistidoGraf.set(MaterialDesignIcon.SYNC_PROBLEM.graphic());\n\n fechaCreacion.set(LocalDateTime.now());\n\n }", "protected void initialize() {\n \t\n }", "public void initialise() \n\t{\n\t\tthis.docids = scoresMap.keys();\n\t\tthis.scores = scoresMap.getValues();\n\t\tthis.occurrences = occurrencesMap.getValues();\t\t\n\t\tresultSize = this.docids.length;\n\t\texactResultSize = this.docids.length;\n\n\t\tscoresMap.clear();\n\t\toccurrencesMap.clear();\n\t\tthis.arraysInitialised = true;\n\t}", "private void init() {\n }", "private void init() {\n }", "private void init() {\n }", "private void init() {\n }", "@Override public void init()\n\t\t{\n\t\t}", "private void initData() {\n\t\tcomboBoxInit();\n\t\tinitList();\n\t}", "public DataStructure() {\r\n firstX = null;\r\n lastX = null;\r\n firstY = null;\r\n lastY = null;\r\n size = 0;\r\n }", "private void initialize() {\n }", "private void initData() {\n\t\tnamesInfo = new NameSurferDataBase(fileName);\n\n\t}", "private void init() {\n\n\t}", "public void init() {\n\n\t}", "public void init() {\n\n\t}", "public void init() {\n\n\t}", "public void initialize() {\n // TODO\n }", "public void initialize() {\r\n }", "@SuppressWarnings(\"static-access\")\n\tprivate void initData() {\n\t\tstartDate = startDate.now();\n\t\tendDate = endDate.now();\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}", "private void init()\n\t{\n\t\tif (_invData == null)\n\t\t\t_invData = new InvestigateStore.MappedStores();\n\t}", "@Override\n\t\tprotected void initialise() {\n\n\t\t}", "public void init() {\n\t\t\n\t}", "public void init() {\n\t\n\t}", "public void init() { \r\n\t\t// TODO Auto-generated method\r\n\t }", "private void initialize() {\n\t\t\n\t}", "private void initialize() {\n this.pm10Sensors = new ArrayList<>();\n this.tempSensors = new ArrayList<>();\n this.humidSensors = new ArrayList<>();\n }", "@Override\r\n\tpublic void init() {}", "public void init() {\n\t\t// Read the data text file and load up the local database\n\t\tinitData();\n\n\t\t// Create the labels and the textbox\n\t\taddNameLabel();\n\t\taddNameBox();\n\t\taddGraphButton();\n\t\taddClearButton();\n\n\t\t// Set up the graph object\n\t\tgraph = new NameSurferGraph();\n\t\tadd(graph);\n\n\t}", "private void initialData() {\n\n }", "@Override\r\n\tpublic final void init() {\r\n\r\n\t}", "public mainData() {\n }", "private void initStructures() throws RIFCSException {\n initTexts();\n initDates();\n }", "public void init() {\n initComponents();\n initData();\n }", "public void init() {\n\t}" ]
[ "0.79946685", "0.7973242", "0.7808862", "0.77763873", "0.77763873", "0.7643394", "0.76371324", "0.76371324", "0.76371324", "0.76371324", "0.76371324", "0.76371324", "0.75553316", "0.7543321", "0.7543321", "0.75426376", "0.75426376", "0.75426376", "0.7532583", "0.75228804", "0.75228804", "0.7515626", "0.7494068", "0.7454065", "0.7388256", "0.7380365", "0.7328254", "0.7311082", "0.7256176", "0.7242837", "0.7242837", "0.720293", "0.7202036", "0.7164401", "0.7144378", "0.71355236", "0.7132754", "0.7131076", "0.7101955", "0.7098935", "0.70951265", "0.70578545", "0.7055706", "0.70423454", "0.7021184", "0.70061564", "0.6987191", "0.6979681", "0.6960125", "0.6946316", "0.69393814", "0.6938019", "0.6937645", "0.6935085", "0.6933533", "0.692056", "0.69171643", "0.6911375", "0.6903781", "0.68829435", "0.6881986", "0.6879309", "0.68750894", "0.6868541", "0.6867774", "0.6852462", "0.6851922", "0.68477225", "0.68477225", "0.68477225", "0.68477225", "0.6846597", "0.6818907", "0.6808544", "0.6805373", "0.6791477", "0.6787723", "0.6781544", "0.6781544", "0.6781544", "0.67674476", "0.676184", "0.67618203", "0.67537767", "0.67537767", "0.67537767", "0.6750694", "0.67330045", "0.67218685", "0.6721014", "0.67197996", "0.67170006", "0.67124057", "0.6708111", "0.66997004", "0.66991216", "0.6692312", "0.6687212", "0.66789055", "0.6668848", "0.66666573" ]
0.0
-1
value will always be nonnegative.
public void put(int key, int value) { newkey = hashfunc(key); arr[newkey]= value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public double abs(double value){return value < 0? value*-1: value;}", "public double hasNegSign(double value) {\n if (value < 0) {\n return value * -1;\n } else {\n return value;\n }\n }", "@Override\n public double getValue() {\n return 0;\n }", "@Override\n public int value() {\n return 0;\n }", "protected double limit(double value) {\n\t\tif (value > 1.0) {\n\t\t\treturn 1.0;\n\t\t}\n\t\tif (value < -1.0) {\n\t\t\treturn -1.0;\n\t\t}\n\t\treturn value;\n\t}", "@Override\r\n\t\tpublic long getValue() {\n\t\t\treturn -1;\r\n\t\t}", "@Override\n public String toString(Number value) {\n return String.format(\"%.1f\", -value.doubleValue());\n }", "public static int getSign(int value) {\n\t\treturn value == 0 ? 0 : value / Math.abs(value);\n\t}", "private int deadZone(int value, int minValue)\n\t{\n\t\tif (Math.abs(value) < minValue) value = 0;\n\t\t\n\t\treturn value;\n\t}", "public void aendereWert (int value) {\n\t\tvalue = 0 ;\n\t}", "@DesireNoWarning(\"TQ\")\n public void set(@CheckForSigned int possibleNegativeValue) {\n if (possibleNegativeValue >= 0)\n nonNegativeValue = possibleNegativeValue;\n }", "private void setNegativeCount(int value) {\n m_NegativeCount = value;\n }", "static double signum(double value) {\r\n\t\treturn Math.signum(value);\r\n\t}", "public static final int safeAbs(int value) {\n if (value == Integer.MIN_VALUE) {\n return Integer.MAX_VALUE;\n } else if (value >= 0){\n return value;\n } else {\n return 0 - value;\n }\n }", "public static double not(final double value) {\n return 1 - value;\n }", "public static final int signum(long value) { \n\t\tif (value > 0) return 1; \n\t\tif (value < 0) return -1 ; \n\t\telse return 0; \n\t}", "public int abs(int val)\n {\n return val < 0 ? -1 * val: val;\n }", "private boolean isValidValue(double value) {\r\n\t\treturn (value > 0);\r\n\t}", "@Override\n public int getIntValue()\n {\n return value;\n }", "public void substract1() {\r\n value--;\r\n }", "public int getValue() {\n/* 450 */ return this.value;\n/* */ }", "protected static void assertArgumentNotZeroInteger(String name, int value) {\n if (value == 0) {\n String msg = \"The argument '\" + name + \"' should be plus or minus value: \" + value;\n throw new IllegalArgumentException(msg);\n }\n }", "public int value() { \n return this.value; \n }", "public void subtract(int value) {\n m_value -= value;\n }", "@Override\n\tpublic void setValue(int value) {\n\t\tif (!(value >= 0 && value <= this.maxValue)) {\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"DawsonBallotItem Error - value must be >= 0 and <= to maxValue.\" + \" Invalid value = \" + value);\n\t\t}\n\t\tthis.value = value;\n\n\t}", "int getValue();", "int getValue();", "int getValue();", "int getValue();", "int getValue();", "public boolean hasValue() { return false; }", "public ValueOutOfBoundsException(String message){\n super(message);\n //do nothing else\n }", "private static boolean isValue(long x) {\n return x >= 0L; // 1\n }", "public abstract boolean isPositive();", "private void throwIfNullValue(final V value) {\n if (value == null) {\n throw new IllegalArgumentException(\"null values are not supported\");\n }\n }", "public abstract Value validateValue(Value value);", "public int value() \n {\n return value;\n }", "public negativeNumberException() {\r\n\t \t \r\n\t }", "public int getValue() \n {\n return value;\n }", "int getCauseValue();", "public int value(){\n return this.value;\n }", "@Test\n\tpublic void testAddOutOfRange() {\n\t\tInteger result = SimpleCalc.add(40, 10);\n\t\tassertNull(\"Input value 40 is out of range [-10, 10]\", result);\n\t}", "public <V extends Number> FluentExp<V> minus (V value)\n {\n return new Sub<V>(this, value);\n }", "Integer getValue();", "Integer getValue();", "public int baseZeroValue() {\n return this.value - 1;\n }", "void setValue(int value) {\n if (isPowerOfTwo(value)) {\n this.value = value;\n } else {\n throw new IllegalArgumentException(\"Value has to be a power of 2\");\n }\n }", "@Override\n public double getValue()\n {\n return value;\n }", "E minVal();", "private void setPositiveCount(int value) {\n m_PositiveCount = value;\n }", "public boolean isValue() {\n return false;\n }", "@Override\n\tpublic double operation(int xValue, int yValue) {\n\t\treturn -1;\n\t}", "public void subtract (int value) {\r\n\t\ttotal = total - value;\r\n\t\thistory = history + \" - \" + value;\r\n\t}", "void setMinValue();", "@Override\r\n public Double getValue() {\r\n return Math.random()*Integer.MAX_VALUE;\r\n \r\n }", "public Int(int value) {\n super(Expression.X_IS_UNDEFINED);\n this.value = value;\n }", "public abstract ArithValue negate();", "public void decrease() {\n if(this.value>0){\n value--;\n }\n }", "public double ValidaValor(){\n\t return 0;\n }", "public OverflowTransactionException() {\n\t\tsuper(\"High-Value transactions more than Double.POSITIVE_INFINITY are not allowed.\");\n\t}", "public int getValue() {\n\t\t// Precondition -- The value is a non-negative integer.\n\t\tassert(value >= 0);\n\t\t\n\t\treturn value;\n\t}", "public int getNumericValue() {\n return value;\n }", "private boolean isPositive() {\n return this._isPositive;\n }", "public int remove(int value)\n {\n amount=amount-value;\n return amount;\n }", "private int signInt() {\n return signum < 0 ? -1 : 0;\n }", "public void setValue(int param1Int) {\n/* 294 */ this.s.setValue(-param1Int);\n/* */ }", "public void setExhaustion ( float value ) {\n\t\texecute ( handle -> handle.setExhaustion ( value ) );\n\t}", "public long setAmountNeg() {\n return -amount;\n }", "public static Object negate(Object value) {\n\t\tif (isFloat(value)) {\n\t\t\treturn ((BigDecimal) value).negate();\n\t\t} else if (isInt(value)) {\n\t\t\treturn ((BigInteger) value).negate();\n\t\t}\n\t\tthrow new OrccRuntimeException(\"type mismatch in negate\");\n\t}", "@Override\n\tdouble evaluate() {\n\t\treturn Math.abs(operand.getVal());\n\t}", "@Override\n\tprotected double getUpperBound() {\n\t\treturn 0;\n\t}", "public int getValue()\r\n/* 21: */ {\r\n/* 22: 71 */ return this.value;\r\n/* 23: */ }", "public int getMinimumValue() {\n/* 276 */ return -this.s.getMaximumValue();\n/* */ }", "public int value();", "public abstract int getMinimumValue();", "public int getValue() \n {\n return value;\n }", "public static final long safeAbs(long value) {\n if (value == Long.MIN_VALUE) {\n return Long.MAX_VALUE;\n } else if (value >= 0L){\n return value;\n } else {\n return 0L - value;\n }\n }", "public float getMinValue();", "@Test\r\n\t@Order(3)\r\n\tvoid testXnegative() {\r\n\t\trobot.setX(-100);\r\n\t\tassertNotEquals(-100, robot.getX() < 0 ,\"X coord test failed\\nREASON: Values less than 0 not allowed!\");\r\n\t}", "public static Object not(Object value) {\n\t\tif (isInt(value)) {\n\t\t\treturn ((BigInteger) value).not();\n\t\t}\n\t\tthrow new OrccRuntimeException(\"type mismatch in not\");\n\t}", "@Test\n\tvoid testNegativeInteger() {\n\t\tint result = calculator.negativeInteger(-4,-3);\n\t\tassertEquals(-1,result);\n\t}", "public void subtract (int value) {\n\t\ttotal = total - value;\n\n\t\thistory = history + \" - \" + value;\n\t\t\n\t}", "@Test public void negativeValueExceptionTest() {\n boolean thrown = false;\n \n NegativeValueException nv = new NegativeValueException();\n \n try {\n PetBunny pb = new PetBunny(\"Floppy\", \"Holland Lop\", -3.5);\n }\n catch (NegativeValueException e) {\n thrown = true;\n }\n Assert.assertTrue(\"Expected NegativeValueException to be thrown.\",\n thrown);\n }", "@Override\r\n\tpublic Integer getValue() {\n\t\treturn null;\r\n\t}", "public void setValue(int value) {\n\t\tif (value < 0)\n\t\t\tthrow new InvalidValueException(value);\n\n\t\tthis.value = value;\n\t}", "public int getValue(){\n return value;\n }", "public int getValue() {\n int tmp = value;\n value = -1;\n return tmp;\n }", "public void set_value(int value) {\n\t\tthis.value = value;\n\t}", "int isEmpty(){\n if(values[0]==(-1)){\n return 1;\n }\n return (-1);\n }", "@Override\n public N value() {\n return value;\n }", "@Override\r\n\tpublic double alapterulet() {\n\t\treturn 0;\r\n\t}", "float getValue();", "float getValue();", "float getValue();", "private int abs(int input) {\n\t\tif (input < 0) {\n\t\t\tinput = input * (-1);\n\t\t}\n\t\treturn input;\n\t}", "public Scalar neg() {\n\t\treturn mul(new RealScalar(-1));\n\t}", "public void decrement(){\n if (value >0) {\n value -= 1;\n }\n }", "public Integer newValue(){\n\t\treturn 0;\r\n\t}", "public int getValue(){\n return this.value;\n }", "public int getValue();", "public int getValue();" ]
[ "0.70011944", "0.69003433", "0.67707586", "0.66027105", "0.6586464", "0.653198", "0.6514914", "0.643939", "0.643648", "0.6433578", "0.64307785", "0.6379716", "0.63451356", "0.63385504", "0.6312588", "0.6274011", "0.622011", "0.6216123", "0.6196117", "0.6183464", "0.6171644", "0.6154996", "0.61510074", "0.6146262", "0.613833", "0.60910577", "0.60910577", "0.60910577", "0.60910577", "0.60910577", "0.60852456", "0.6049687", "0.6041915", "0.6027299", "0.60259223", "0.6016715", "0.6000658", "0.599955", "0.5993719", "0.5990594", "0.59869176", "0.59767485", "0.59760094", "0.59736896", "0.59736896", "0.5961782", "0.59573364", "0.59562045", "0.5952855", "0.5951681", "0.5937283", "0.5925281", "0.5923488", "0.5920791", "0.5920408", "0.5913975", "0.5907044", "0.59061795", "0.5898053", "0.58941495", "0.58905786", "0.5887537", "0.58872265", "0.58867383", "0.5885458", "0.5878945", "0.5872582", "0.58694786", "0.5860751", "0.584468", "0.58442825", "0.5840368", "0.58352435", "0.5832332", "0.58318204", "0.5829048", "0.5823624", "0.58221906", "0.58221424", "0.5820863", "0.58160233", "0.5811706", "0.581127", "0.5809988", "0.5809205", "0.5805992", "0.57941717", "0.57918733", "0.57861674", "0.57836896", "0.5780349", "0.57672966", "0.57672966", "0.57672966", "0.5762089", "0.5759083", "0.5756925", "0.5751603", "0.57442474", "0.57436347", "0.57436347" ]
0.0
-1
Returns the value to which the specified key is mapped, or 1 if this map contains no mapping for the key
public int get(int key) { newkey = hashfunc(key); return arr[newkey]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int get(int key) {\n return hashMap.stream()\n .filter(pair -> pair[0] == key)\n .findAny()\n .map(pair -> pair[1])\n .orElse(-1);\n }", "public int get(int key) {\n if(!map.containsKey(key)) return -1;\n return map.get(key);\n }", "public int get(int key) {\n return 1;\n }", "private int get(Map<T, Integer> state, T key) {\n return state.getOrDefault(key, 0);\n }", "public int get(int key) {\n int hashedKey = hash(key);\n Entry entry = map.get(hashedKey);\n if (entry.key == -1)\n return -1;\n else if (entry.key == key)\n return entry.value;\n else if (entry.next != null){\n while(entry.next!=null && entry.key != key){\n entry = entry.next;\n }\n if (entry.key == key)\n return entry.value;\n else\n return -1;\n }else\n return -1;\n }", "public static int get(int key) {\n\t\t// your code here\n\t\tif (map.containsKey(key)) {\n\t\t\tint value = map.get(key);\n\t\t\tmap.remove(key);\n\t\t\tmap.put(key,value);\n\t\t\treturn map.get(key);\n\t\t} else\n\t\t\treturn -1;\n\t}", "public int get(int key) {\n\t\tDLLNode curr = map.get(key);\n\n\t\tif (curr != null) {\n\t\t\tupdateUsage(curr);\n\t\t\treturn curr.val;\n\t\t}\n\n\t\treturn -1;\n\t}", "public int get(int key) {\n Node n = map.get(key);\n if(n == null){\n //we do not have the value, return -1\n return -1;\n }\n //we do have the node\n //update the node in the DLL, so that its now in the front\n update(n);\n return n.val;\n }", "public int get(int key) {\n int index = key % n;\n MapNode node = keys[index];\n for (int i =0; i < node.list.size(); ++i) {\n if (node.list.get(i) == key) {\n return vals[index].list.get(i);\n }\n }\n\n return -1;\n }", "public int get(int key) {\n if (!map.containsKey(key)) return -1;\n Node n = map.get(key);\n \n if (n.next != tail) {\n putToTail(n); \n }\n \n return n.val;\n }", "public int getInt(String key) {\n return Integer.parseInt(mMap.get(key));\n }", "public int get(int key) {\n if(map.containsKey(key)) {\n Node node = map.get(key);\n \n removeNode(node);\n insertNode(node);\n \n return node.val;\n }\n return -1;\n }", "public int getAsInt(String key) {\n return getAsInt(key, 0);\n }", "public int get(int key) {\n if(arr[key] == -1)\n return 0;\n else if(arr[key] == 0)\n return -1;\n else return arr[key];\n }", "public int get(int key) {\n int index = keys.indexOf(key);\n return index < 0? -1 : values.get(index);\n }", "public int getInt(String key)\n {\n return getInt(key, 0);\n }", "private int map(String key) throws Exception\n {\n if (key == null)\n {\n throw new Exception(\"Invalid value passed to map\");\n }\n\n return 0 % hashMapSize;\n }", "public int get(String key) {\r\n int hash = new BigInteger(toAscii(key)).mod(new BigInteger(((Integer)TABLE_SIZE).toString())).intValue();\r\n while (table[hash] != null && table[hash].getKey() != key)\r\n hash = (hash + 1) % TABLE_SIZE;\r\n if (table[hash] == null)\r\n return -1;\r\n else\r\n return table[hash].getValue();\r\n }", "public int get(String key) {\n\n // Hold the tmpNode node\n FreqNode tmpNode;\n\n //calculate the index by hashcode mod table length \n int index = Math.abs(key.hashCode()) % (frequencyTable.length);\n\n //if mapped location is empty\n if (frequencyTable[index] == null) {\n return 0; //does not effect the cosine similarity \n } else {\n //value is at the tmpNode \n tmpNode = frequencyTable[index];\n //for each value in table \n while (true) {\n //if tmpNode is null \n if (tmpNode == null) {\n return 0;\n } //else if the key is equal to this nodes key \n else if (key.equals(tmpNode.getKey())) {\n //return the value of this key \n return tmpNode.getValue();\n } else {\n //grab the next element as a last resort \n tmpNode = tmpNode.getNext();\n }//end else \n }//end else if \n }//end else\n }", "public int count( K key ) {\n Integer i = map.get( key );\n return i == null ? 0 : i;\n }", "public int getInteger(short dictionaryKey) {\n\t\treturn intsMap.get(dictionaryKey);\n\t}", "int getInt(String key);", "public int get(int key) {\n return store[key]; // get the value for the key\n }", "public int getInt(String key) {\n Object value = get(key);\n return ((value instanceof Long) ? ((Long)value).intValue() : 0);\n }", "public int get(int key) {\n if(hashmap.containsKey(key)){\n Entry e = hashmap.get(key);\n removeNode(e);\n addAtTop(e);\n return e.value;\n }\n return -1;\n }", "public synchronized Object get( Object key ) {\n\t\tObject intvalue = mapKeyPos.get(key);\n\t\tif ( intvalue != null ) {\n\t\t\tint pos = ((Integer)intvalue).intValue();\n\t\t\tstatus[pos] = LRU_NEW;\n\t\t\t//System.out.println(\"CountLimiteLRU: get(\"+key+\") = \"+values[pos]);\n\t\t\treturn values[pos];\n\t\t}\n\t\treturn null;\n\t}", "public int get(int key) {\r\n if (map.containsKey(key)) {\r\n \t Node node = map.get(key);\r\n \t int value = node.val;\r\n \t if (!node.equals(doubly.last)) {\r\n \t\t doubly.delete(node);\r\n \t\t\tdoubly.insertLast(key, value); \r\n \t\t\tmap.put(key, doubly.last);\r\n \t }\r\n \t return value;\r\n }\r\n else return -1;\r\n \r\n }", "public V getValue(K key)\n {\n V result = null;\n int keyIndex = locateIndex(key);\n if ((keyIndex < numberOfEntries) && \n key.equals(dictionary[keyIndex].getKey()))\n result = dictionary[keyIndex].getValue();\n return result;\n }", "public V getValue(K key)\r\n\t{\r\n\t\tint slot = findSlot(key, false);\r\n\t\t\r\n\t\tif (slot < 0) \r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tMapEntry<K, V> e = table[slot];\r\n\t\treturn e.getValue();\r\n\t}", "int getSuccessor(int key)\n\t\tthrows IllegalArgumentException;", "public int getIndexOfValue(K key){\n int index = getIndex(key);\n\n while(bucketArray[index] != null){\n if(bucketArray[index].key == key && !bucketArray[index].isDeleted){\n return index;\n }\n index = (index + 1) % bucketArray.length;\n }\n return -1;\n }", "public V get(Object key) { return _map.get(key); }", "@Override\n\t@TimeComplexity(\"O(log n)\")\n\tpublic V get(K key) {\n\t/* TCJ\n\t * Binary search operation: log n\n\t */\n\t\tint j = findIndex(key);\n\t\tif ( j == size() || key.compareTo(map.get(j).getKey()) != 0 ) { return null; }\n\t\treturn map.get(j).getValue();\n\t}", "public Integer getInt(String key)\n\t{\n\t\tLong l = getLong(key);\n\t\tif(l == null)\n\t\t\treturn null;\n\t\treturn l.intValue();\n\t}", "public Integer getInt(K key) throws ClassCastException;", "public String get(int key) {\n String sql = \"SELECT data_val FROM data_map WHERE data_key = ?\";\n\n String value = null;\n try (Connection con = this.connect();\n PreparedStatement pstmt = con.prepareStatement(sql)) {\n pstmt.setInt(1, key);\n ResultSet rs = pstmt.executeQuery();\n\n if (!rs.isClosed()) {\n value = rs.getString(\"data_val\");\n rs.close();\n }\n }\n catch (SQLException e) {\n value = null;\n }\n\n return value;\n }", "public int get(int key) {\n int hash_key = key % this.key_space;\n return this.hash_table.get(hash_key).get(key);\n }", "public V searchValue (K key) {\n\t\tfor (Map.Entry<K, V> entry : this.entrySet()) {\n\t\t\tif (entry.getKey() == key) {\n\t\t\t\treturn entry.getValue();\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "private int getIntegerValueByBitMap(LinkedHashMap<String, Integer> bitMap) {\r\n\t\r\n\tint identityInfoValue = 0;\r\n if(bitMap != null && bitMap.size() > 0) {\r\n \tStringBuilder sb = new StringBuilder();\r\n \t\r\n \tsb.append(bitMap.get(ProjectConstants.Asia)).append(bitMap.get(ProjectConstants.Korea)).append(bitMap.get(ProjectConstants.Europe))\r\n \t.append(bitMap.get(ProjectConstants.Japan)).append(bitMap.get(ProjectConstants.America));\r\n \r\n \tif(sb != null) {\r\n \t\t int num = Integer.parseInt(sb.toString().replaceFirst(\"^0+(?!$)\", \"\"));\r\n \t\t identityInfoValue = convertBinaryToDecimal(num);\r\n \t}\r\n }\r\n return identityInfoValue;\r\n}", "public int get(int key) {\n ListNode node = hashtable.get(key);\n \n if(node == null){\n return -1;\n }\n \n // Item has been accessed. Move to the front of the cache\n moveToHead(node);\n return node.value;\n }", "public int get(int key) {\n Node x = root;\r\n while (x != null) {\r\n if (key > x.key) x = x.right;\r\n else if (key < x.key) x = x.left;\r\n else if (x.key == key) return key;\r\n }\r\n System.out.print(\"No key found\");\r\n return -1; //return 0 means did not find!\r\n }", "public String get(int key){\n\t\treturn(hashMap[key]);\t\t\n\t}", "public int getIntegerProperty(String key) {\n String val = getProperty(key);\n return (null == val ? 1 : Integer.parseInt(val));\n }", "public static int getIntProperty(String key) {\r\n\t\treturn getIntProperty(key, 0);\r\n\t}", "private int locate(Random generator, K key)\n {\n boolean found = false;\n\n int index = generator.nextInt(hashTable.length);\n\n while ( !found && (hashTable[index] != null) )\n {\n if ( hashTable[index].isIn() &&\n key.equals(hashTable[index].getKey()) )\n found = true; // key found\n else // follow probe sequence\n index = generator.nextInt(hashTable.length); // Linear probing\n totalProbes++;\n } // end while\n\n // Assertion: Either key or null is found at hashTable[index]\n int result = -1;\n\n if (found)\n result = index;\n\n return result;\n }", "private DataValue getValueForKey(String key) {\n DataValue value = valueMap.get(key);\n if (value == null) {\n return DataValue.NO_VALUE;\n } else {\n return value;\n }\n }", "public int getInteger(String key) {\r\n try {\r\n return Integer.decode(getString(key)).intValue();\r\n }\r\n catch (Exception e) {\r\n return 0;\r\n }\r\n }", "public int get(int key) {\n Node node = map.get(key);\n if (node == null) {\n return -1;\n }\n else if (node != tail) {\n if (node == head) {\n head = head.next;\n }\n else {\n node.pre.next = node.next;\n }\n node.next.pre = node.pre;\n tail.next = node;\n node.pre = tail;\n node.next = null;\n tail = node;\n }\n return node.val;\n }", "public int getIntValue(String keyName)\n {\n return Integer.parseInt(getValue(keyName));\n }", "public Integer getInteger(String key) {\n if (!jsonData.has(key))\n return null;\n try {\n return jsonData.getInt(key);\n } catch (Exception ex) {\n return null;\n }\n }", "public Integer getCount(T key) {\n\t\tMutInt val = counts.get(key);\n\t\tif (val == null) {return null;}\n\t\treturn val.get();\n\t}", "public int getPropertyInt(String key);", "public int getInt(String key) throws AgentBuilderRuntimeException {\n\t\treturn getInteger(key).intValue();\n\t}", "public int get(int key) {\n return data[key % KEY];\n }", "public Integer getInteger(String key) throws AgentBuilderRuntimeException {\n\t\tif (!extContainsKey(key))\n\t\t\tthrow new AgentBuilderRuntimeException(\n\t\t\t\t\t\"Dictionary does not contain key \\\"\" + key + \"\\\"\");\n\t\treturn (Integer) extGet(key);\n\t}", "public V lookup(K key);", "String get(Integer key);", "@Override\n\tpublic V get(Object key) {\n\t\treturn map.get(key);\n\t}", "int getInt( String key, int def);", "int getInt(String key) throws KeyValueStoreException;", "public int indexOf(String key) {\r\n Integer i = keys.get(key);\r\n return (i == null ? -1 : i);\r\n }", "public\n int getProperty_int(String key)\n {\n if (key == null)\n return 0;\n\n String val = getProperty(key);\n\n if (val == null)\n return 0;\n\n int ret_int = 0;\n try\n {\n Integer workint = new Integer(val);\n ret_int = workint.intValue();\n }\n catch(NumberFormatException e)\n {\n ret_int = 0;\n }\n\n return ret_int;\n }", "public int getInfoOrThrow(\n int key) {\n \n java.util.Map<java.lang.Integer, java.lang.Integer> map =\n internalGetInfo().getMap();\n if (!map.containsKey(key)) {\n throw new java.lang.IllegalArgumentException();\n }\n return map.get(key);\n }", "public int getIntegerProperty(String key) {\n\t\treturn Integer.parseInt(this.getProperty(key));\n\t}", "private int getValue(final String name, final String key) {\n\t\treturn Integer.parseInt(bundleConstants.getString(name + SEPERATOR + key));\n\t}", "public static int lookup (String name)\n {\n\tInteger result = MAP.get (name.toLowerCase ());\n\n\treturn (result == null) ? -1 : result;\n }", "public int get(int key) {\n int hashCode = key%nodes.length;\n if (nodes[hashCode]==null) return -1;\n ListNode pre = findPrev(key);\n return pre.next==null?-1:pre.next.val;\n }", "public int intValue(Map<Prop, Object> map) {\n assert type == Integer.class;\n Object o = map.get(this);\n return this.<Integer>typeValue(o);\n }", "public int getInteger(String key) {\n\t\tint defaultValue = 0;\n\t\tif (getDefault(key) != null)\n\t\t\tdefaultValue = (Integer) getDefault(key);\n\t\tString sp = internal.getProperty(key);\n\t\tif (sp == null) {\n\t\t\treturn defaultValue;\n\t\t}\n\t\tint value;\n\t\ttry {\n\t\t\tvalue = Integer.parseInt(sp);\n\t\t} catch (NumberFormatException ex) {\n\t\t\tinternal.remove(key);\n\t\t\treturn defaultValue;\n\t\t}\n\t\treturn value;\n\t}", "public int getIndexOf(K key);", "public int getInfoOrDefault(\n int key,\n int defaultValue) {\n \n java.util.Map<java.lang.Integer, java.lang.Integer> map =\n internalGetInfo().getMap();\n return map.containsKey(key) ? map.get(key) : defaultValue;\n }", "public int getMandatoryInt(String key) throws ConfigNotFoundException;", "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}", "int getIndex(int key_hash) {\n int capacity = hash_map.length;\n int index = key_hash % capacity;\n return index;\n }", "public int get(String s) {\n boolean val=search(s);\n if(val==true){\n int a=(int) hmap.get(s);\n System.out.println(\"Found\");\n return a;\n }\n else {\n return -1;\n }\n\n }", "public Value get(final Key key) {\n int r = rank(key);\n if (r < size && (keys[r].compareTo(key) == 0)) {\n return values[r];\n }\n return null;\n }", "public int search(int key){\n\t\treturn searchUtil(key,0,arr.length-1);\n\t}", "public static int getIntForKey(String key)\n\t{\n\t\treturn PreferencesModel.instance().getUserIntPref(key, -1);\n\t}", "public int getInfoOrThrow(\n int key) {\n \n java.util.Map<java.lang.Integer, java.lang.Integer> map =\n internalGetInfo().getMap();\n if (!map.containsKey(key)) {\n throw new java.lang.IllegalArgumentException();\n }\n return map.get(key);\n }", "private static int getIntegerProperty(String key) {\n String value = PROPERTIES.getProperty(key);\n // if the key is not found, Properties will return null and we should return a default value\n if (value == null) {\n return 0;\n }\n return Integer.parseInt(value);\n }", "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 int get(int key) {\n Node node = cache.get(key);\n // If the node exists\n if (node != null) {\n // Get the value stored in the node\n int value = node.value;\n // Remove and add the node\n remove(node);\n add(node);\n return value;\n }\n return -1;\n }", "public int get(int key) {\n int pos = key % this.size;\n Bucket bucket = this.buckets[pos];\n return bucket.get(key);\n }", "public V getValue(K key);", "public V getValue(K key);", "int find(K key)\n {\n return Math.abs(key.hashCode() % this.buckets.length);\n }", "public int getInfoOrDefault(\n int key,\n int defaultValue) {\n \n java.util.Map<java.lang.Integer, java.lang.Integer> map =\n internalGetInfo().getMap();\n return map.containsKey(key) ? map.get(key) : defaultValue;\n }", "public Integer getInteger(String key, Integer defaultValue);", "public int i(String key) throws AgentBuilderRuntimeException {\n\t\treturn getInt(key);\n\t}", "boolean exists(Integer key);", "public Integer getIntegerData(String key) {\n return pref.getInt(key, 0);\n }", "public int getDataNumber(Key key) {\r\n\t\t\tint ret = -1;\r\n\t\t\t\r\n\t\t\tdata.reset();\r\n\t\t\t//find position of key\r\n\t\t\tfor (int i = 0; i < data.size(); i++) {\r\n\t\t\t\tif (data.get().getKey().compareTo(key) == 0) {\r\n\t\t\t\t\tret = i;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tdata.next();\r\n\t\t\t}\r\n\t\t\tdata.reset();\r\n\t\t\t\r\n\t\t\treturn ret;\r\n\t\t}", "int getInfoOrDefault(\n int key,\n int defaultValue);", "@Override\n public common.FileLocation lookup(int key) throws RemoteException {\n common.FileLocation fl = map.get(key);\n if (fl == null) {\n printAct(\">requested of key: \" + key + \", returned null\");\n } else {\n printAct(\">requested of key: \" + key + \", returned: \" + fl);\n }\n return fl;\n }", "public boolean contains(int key) {\n return map.containsKey(key);\n }", "public final synchronized V get(final K key) {\n\t\treturn map.get(key);\n\t}", "public V value(K key) {\n for(MapEntry<K, V> t : this) {\n if (t == null) continue;\n if (t.key().equals(key)) return t.value();\n }\n\n return null;\n }", "private int getPos(int key, int index) {\n\t\t// Each bucket contains a list.\n\t\tList<Integer> temp = set[index];\n\t\tif (temp == null) {\n\t\t\treturn -1;\n\t\t}\n\t\t// Iterate all the elements in the bucket to find the target key.\n\t\tfor (int i = 0; i < temp.size(); i++) {\n\t\t\tif (temp.get(i) == key) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "public static int getIndex(String key) {\r\n return KEYS.indexOf(key);\r\n }", "V getValue(final E key) {\r\n for (int i=0;i<kcount;i++) {\r\n if (equal(key, (E)k[i])) return (V)v[i];\r\n }\r\n return null;\r\n }" ]
[ "0.76459706", "0.7435398", "0.7300944", "0.7130443", "0.6853851", "0.68358415", "0.68350554", "0.6803229", "0.6754685", "0.6661285", "0.6642842", "0.6615104", "0.65980434", "0.647564", "0.64128166", "0.63261414", "0.6324729", "0.6260748", "0.6257934", "0.62374794", "0.62312406", "0.6215209", "0.6180936", "0.61745214", "0.61637837", "0.61553705", "0.6150413", "0.61463565", "0.6145443", "0.6108712", "0.6106599", "0.60925126", "0.604483", "0.6018138", "0.6017456", "0.601018", "0.5998852", "0.5942012", "0.5925317", "0.59192675", "0.59104764", "0.5906315", "0.589185", "0.5865131", "0.5852445", "0.5850736", "0.5830772", "0.58235604", "0.58190584", "0.57925045", "0.5791717", "0.5788011", "0.57842004", "0.5783962", "0.57717216", "0.57610196", "0.5757374", "0.57538563", "0.573537", "0.57271886", "0.5723775", "0.57218486", "0.571977", "0.57141054", "0.5704226", "0.57035166", "0.56987715", "0.56969213", "0.5694214", "0.5692465", "0.5686611", "0.5681333", "0.56779516", "0.5670712", "0.5666912", "0.5658702", "0.56547946", "0.56521475", "0.56516653", "0.56495106", "0.56453526", "0.56406265", "0.56327057", "0.5616713", "0.5616713", "0.5602828", "0.5591491", "0.5583473", "0.556617", "0.55577016", "0.5548819", "0.5546102", "0.5541758", "0.5532772", "0.55257595", "0.5522883", "0.55184305", "0.55174273", "0.5511961", "0.5509275" ]
0.5664435
75
Removes the mapping of the specified value key if this map contains a mapping for the key
public void remove(int key) { newkey = hashfunc(key); arr[newkey]= -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void remove(Object key, Object value) {\n map.get(key).remove(value);\n }", "public boolean remove(String key, V value) {\n Collection<V> values = map.get(key);\n\n if (values != null) {\n return values.remove(value);\n }\n\n return false;\n }", "public void remove(Object key){\n map.remove(key);\n }", "@Override\n\tpublic V remove(Object key) {\n\t\tkeys.remove(key);\n\t\treturn map.remove(key);\n\t}", "void removeValue(String key);", "public ObjectMap remove(String key, Object value) {\r\n\t\tif (hasKey(key) && hasValue(value))\r\n\t\t\tobjectMap.remove(key, value);\r\n\t\treturn this;\r\n\t}", "@Override\n public T remove(Object key) {\n // Do I have an entry for it?\n Map.Entry<String, T> entry = entries.get((String) key);\n if (entry != null) {\n entries.remove(key);\n // Change the underlying map.\n return map.remove(prefix + key);\n }\n return null;\n }", "public abstract void removeFromMap();", "@Override\n public V remove(K key, V value) {\n if (key == null) return null;\n if (get(key) != value) {\n return get(key);\n }\n root = remove(root, key);\n return get(key);\n }", "public V remove(K key, V value) {\n if (key == null || !keySet.contains(key))\n return null;\n int index = reduce(key, buckets.size());\n ArrayList<Entry> items = buckets.get(index);\n for (Entry e : items) {\n if (e.key.equals(key)) {\n if (e.value.equals(value)) {\n\n items.remove(e);\n keySet.remove(key);\n numEntries--;\n return e.value;\n }\n }\n }\n return null;\n }", "@Override\n synchronized public void removeKey(Integer key) {\n this.map.remove(key);\n }", "public void remove(int key) {\n map.remove(key);\n }", "public void remove(int key) {\n hashMap.removeIf(pair -> pair[0] == key);\n }", "public static void remove(final String key) {\r\n\t\tMap<String, String> map = new HashMap<String, String>(data.get());\r\n\t\tmap.remove(key);\r\n\t\tdata.set(map.isEmpty() ? Collections.<String, String> emptyMap() : Collections.<String, String> unmodifiableMap(map));\r\n\t}", "@Override\n public V remove(K key, V value) {\n if (get(root, key) == value) {\n return delete(root, key).val;\n }\n return null;\n }", "public void remove(Key key) {\n\n\t\tif (!contains(key)) return;\n\t\tint index = locate(key);\n\t\tkeys[index] = null;\n\t\tvalues[index] = null;\n\t\tthis.size--;\n\n\t\t// Check to see if any of the items in the table that follow\n\t\t// this one had collided with the key that was just removed.\n\t\t// If so, we need to rehash/reinsert them.\n\n\t\tint i = increment(index);\n\t\twhile (keys[i] != null) {\n\n\t\t\t// Save the key/value pair at this location.\n\n\t\t\tKey savedKey = keys[i];\n\t\t\tValue savedValue = values[i];\n\n\t\t\t// And temporarily remove it from the hash map.\n\n\t\t\tkeys[i] = null;\n\t\t\tvalues[i] = null;\n\n\t\t\t// Figure out where it should go now and reinsert it.\n\n\t\t\tindex = locate(savedKey);\n\t\t\tkeys[index] = savedKey;\n\t\t\tvalues[index] = savedValue;\n\n\t\t\t// Advance to the next item.\n\t\t\ti = increment(i);\n\t\t}\n\t}", "public V remove(K key)\r\n\t{\r\n\t\t//TODO: add your code here\r\n\t\tV oldVal;\r\n\t\tint slot = findSlot(key, false); // check if it already exists\r\n\t\t// sets the slot in the map to DUMMY value if it exists\r\n\t\tif (slot >= 0)\r\n\t\t{\r\n\t\t\toldVal = table[slot].getValue();\r\n\t\t\ttable[slot] = DUMMY;\r\n\t\t\tcount--;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\toldVal = null;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn oldVal;\r\n\t}", "boolean remove(Object key, Object value);", "public V remove(K key) {\r\n\t\t// TODO Complete this!\r\n\t\tint place = hash(key.hashCode());\r\n\t\tif (hashMapArray[place] != null) {\r\n\t\t\tLinkedList<KVPair> temp = hashMapArray[place];\r\n\t\t\tfor (KVPair i : temp) {\r\n\t\t\t\tif (i.getKey().equals(key)) {\r\n\t\t\t\t\tV oldKey = i.getValue();\r\n\t\t\t\t\ttemp.remove(i);\r\n\t\t\t\t\tsize--;\r\n\t\t\t\t\treturn oldKey;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public void remove(int key){\n\t\tif(get(key) != null){\n\t\t\tSystem.out.println(\"Removing \" + get(key) + \" from map\");\n\t\t\thashMap[key] = null;\n\t\t\treturn;\n\t\t}\n\t\tSystem.out.println(\"Key \" + key + \" not in map\");\n\t\treturn;\n\t}", "@Override\n public boolean remove( K key,\n V value ) {\n ValueIterator values = new ValueIterator(key);\n while (values.hasNext()) {\n if (ObjectUtil.isEqualWithNulls(values.next(), value)) {\n values.remove();\n return true;\n }\n }\n return false;\n }", "public String remove(String key, String value) throws DictionaryException {\n\t\tSystem.out.println(\"Going to remove value : \" + value + \" for Key : \" + key);\n\t\tMap<String, List<String>> dictMap = getDictionary();\n\t\tif (dictMap != null && dictMap.isEmpty() != true) {\n\t\t\tif (dictMap.containsKey(key)) {\n\t\t\t\tList<String> membersList = dictMap.get(key);\n\t\t\t\tif (membersList.contains(value)) {\n\t\t\t\t\tmembersList.remove(value);\n\t\t\t\t\tif (membersList != null && membersList.isEmpty())\n\t\t\t\t\t\tdictMap.remove(key);\n\t\t\t\t} else {\n\t\t\t\t\tthrow new DictionaryException(ExceptionConstant.VALUE_EXIST_ERROR);\n\t\t\t\t}\n\t\t\t} else\n\t\t\t\tthrow new DictionaryException(ExceptionConstant.KEY_EXIST_ERROR);\n\t\t}\n\t\treturn ApplicationMessage.REMOVE_SUCCESS_MSG;\n\n\t}", "public ObjectMap remove(String key) {\r\n\t\tif (hasKey(key))\r\n\t\t\tobjectMap.remove(key);\r\n\t\treturn this;\r\n\t}", "public boolean remove(Object key) {\n if (keyCardinality.get(key) == null) {\n return false;\n }\n // Remove cardinality of key\n keyCardinality.remove(key);\n // Remove key from hashmaps\n for (int i = 0; i < this.gcdBands; i++) {\n Map<Object, Set<Long>> segmentIdInfo = segmentIds.get(i);\n Map<Long, Set<Object>> hashTable = hashTables.get(i);\n if (segmentIdInfo.get(key) == null) continue;\n for (long segId : segmentIdInfo.get(key)) {\n hashTable.get(segId).remove(key);\n if (hashTable.get(segId).isEmpty()) {\n hashTable.remove(segId);\n }\n }\n segmentIdInfo.remove(key);\n }\n return true;\n }", "@Override\n\tpublic boolean removeVertex(Object value)\n\t{\n\t\tif(this.map.containsKey(value))\n\t\t{\n\t\t\t// remove the value from the map\n\t\t\tthis.map.remove(value);\n\t\t\t// iterate over the map and remove any edges of the value\n\t\t\tfor(Map.Entry<Object, SinglyLinkedList> vertex : map.entrySet())\n\t\t\t\tvertex.getValue().removeNode(value);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "@Override\n\t@TimeComplexity(\"O(n)\")\n\tpublic V remove(K key) {\n\t/* TCJ\n\t * Binary search operation: log n\n\t * Iterate through new collection: n\n\t */\n\t\tint j = findIndex(key);\n\t\tif ( j == size() || key.compareTo(map.get(j).getKey()) != 0 ) return null;\n\t\treturn map.remove(j).getValue();\n\t}", "public V remove(K key)\n {\n checkInitialization();\n if ((key == null))\n throw new IllegalArgumentException();\n else\n { \n V result = null;\n int keyIndex = locateIndex(key);\n if ((keyIndex < numberOfEntries) && \n key.equals(dictionary[keyIndex].getKey()))\n { \n // Key found; remove entry and return its value\n result = dictionary[keyIndex].getValue();\n removeGap(keyIndex);\n numberOfEntries--;\n } // end if\n // Else result is null\n return result;\n } // end if\n }", "boolean remove(final K key, final V value);", "public boolean remove(K key);", "@Override\n public void remove(K key) {\n super.remove(key);\n keySet.remove(key);\n }", "public boolean remove(Key key) ;", "V remove(Object key);", "public V remove(K key);", "public V remove(K key);", "public void remove(K key)\n {\n AssociationList<K, V> bucket = this.get(this.find(key));\n if (bucket != null)\n {\n bucket.remove(key);\n } // if (bucket != null)\n }", "public void remove(int key) {\n int hashedKey = hash(key);\n Entry entry = map.get(hashedKey);\n if (entry.key == -1) {\n return;\n } else if (entry.key == key) {\n if (entry.next != null) map.set(hashedKey, entry.next);\n else entry.key = -1;\n } else if (entry.next != null) {\n Entry pre = entry, cur = entry.next;\n while (cur.next != null && cur.key != key) {\n pre = cur;\n cur = cur.next;\n }\n if (cur.key == key) {\n pre.next = cur.next;\n }\n }\n }", "public void remove(K key);", "public MapComp<K, V> remove(K k) {\n return new MapBST<K, V>(this.bst.remove(new KVPairof<>(k, null)));\n }", "void remove(KeyType key, ValueType value);", "MapComp<K, V> remove(K k);", "default void remove(String key, Object value) {\n\t\tSearchCritera searchCritera = new SearchCritera(key, value);\n\t\tremove(() -> searchCritera);\n\t}", "@Override\n public synchronized Object remove(Object key) {\n String strkey = key.toString();\n if (this.ignoreCase) {\n strkey = (String) this.keyMap.remove(strkey.toLowerCase());\n if (strkey == null)\n return null;\n }\n return super.remove(strkey);\n }", "@Override\n\tpublic void remove(String k, Value v)\n\t{\n\t\t\n\t}", "@Override\n\tpublic void remove(String k, Value v)\n\t{\n\t\t\n\t}", "@Override\n public V remove(K key) {\n Entry<K, V> removed = new Entry<>(null, null);\n if(containsKey(key)) {\n LinkedList<Entry<K, V>> pointer = entryArr[Math.floorMod(key.hashCode(), entryArr.length)];\n for(int i = 0; i < pointer.size(); i++) {\n if(pointer.get(i).keyEquals(new Entry<K, V>(key, null))) {\n removed = pointer.get(i);\n pointer.remove(pointer.get(i));\n break;\n }\n }\n size--;\n }\n return removed.value;\n }", "void removeEntry(K key);", "@Override\n public V remove(K key, V value) {\n V val = get(key);\n if (val != null && value != null && val.equals(value)) {\n root = removeHelper(root, key);\n size -= 1;\n }\n return val;\n// throw new UnsupportedOperationException(\"Unsupported operation, sorry!\");\n }", "public void remove(int key) {\n store[key] = -1; // If the key is removed, the value of that key is replaced with -1, \n \t\t\t\t// that the item doesn't exist because hashmap requires removal of keys.\n }", "@Override\r\n\tpublic void removeEntry(String key) {\n\t\t\r\n\t}", "public <K> boolean remove(K key);", "public void deleteFromValueAtKey(String aKey, String aValue) {\n if (cars.containsKey(aKey)) {\n List<String> newValues = new ArrayList<String>();\n newValues = cars.get(aKey);\n newValues.remove(aValue);\n cars.remove(aKey);\n cars.put(aKey, newValues);\n }\n }", "Entry<Key, Value> remove(Entry<Key, Value> entry);", "@Override\n\tpublic V remove(Object key) {\n\t\tIterator it1 = tabla.iterator();\n\t\tV valor = null;\n\t\tint i = 0;\n\t\twhile (it1.hasNext()) {\n\t\t\tit1.next();\n\t\t\tint indice = tabla.get(i).keySet().indexOf(key);\n\t\t\tif (indice != -1) {\n\t\t\t\tvalor = tabla.get(i).valueSet().get(indice);\n\t\t\t\ttabla.get(i).keySet().remove(indice);\n\t\t\t\ttabla.get(i).valueSet().remove(indice);\n\t\t\t}\n\t\t\ti++;\n\n\t\t}\n\t\treturn valor;\n\t}", "V remove(K key);", "V remove(K key);", "V remove(K key);", "public V remove(K key)\n\t{\n\t\tcheckForNulls(key);\n\t\tint n = Math.abs(key.hashCode() % entries.length);\n\t\t\n\t\tif (entries[n] == null)\n\t\t\treturn null;\n\t\t\n\t\tV ret = null;\n\t\tfor (Entry e : entries[n])\n\t\t{\n\t\t\tif (key.equals(e.key) == true)\n\t\t\t\tret = e.value;\n\t\t}\n\t\t\n\t\tif (ret == null)\n\t\t\treturn null;\n\t\t\n\t\tentries[n].remove(new Entry(key, null));\n\t\treturn ret;\n\t}", "public void remove(int key) {\n int index = keys.indexOf(key);\n if(index > 0) {\n keys.remove(index);\n values.remove(index);\n }\n }", "public void remove(int key) {\n int index = key % n;\n MapNode node = keys[index];\n for (int i =0; i < node.list.size(); ++i) {\n if (node.list.get(i) == key) {\n node.list.remove(i);\n vals[index].list.remove(i);\n }\n }\n }", "public synchronized V remove(Object oKey)\n {\n // COH-6009: map mutations must be synchronized with event dispatch\n // to ensure in-order delivery\n Entry<K, V> entry = (Entry<K, V>) getEntryInternal(oKey);\n if (entry == null)\n {\n return null;\n }\n else\n {\n removeEntryInternal(entry);\n entry.onRemove();\n return entry.getValue();\n }\n }", "public int remove(K key, V value) {\n return remove(key, value, 1);\n }", "public Object remove(String key);", "public abstract boolean remove(Key key);", "private boolean delete(K key) {\n\t\t\tif (!keySet.contains(key)) {\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\tint index = keySet.indexOf(key);\n\t\t\t\tkeySet.set(index, keySet.get(size - 1));\n\t\t\t\tvalueSet.set(index, valueSet.get(size - 1));\n\t\t\t\tkeySet.set(size - 1, null);\n\t\t\t\tvalueSet.set(size - 1, null);\n\t\t\t\tsize--;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}", "@Override\n public void removeValue(String key) {\n SharedPreferences.Editor editor = preferences.edit();\n editor.remove(key);\n editor.apply();\n }", "@Override\n\tpublic String remove(String key) {\n\t\tint hashVal = hashFunc(key);\n\t\twhile (hashArray[hashVal] != null) {\n\t\t\tif (hashArray[hashVal].value.equals(key)) {\n\t\t\t\thashArray[hashVal] = deleted;\n\t\t\t\tthis.numOfItems--;\n\t\t\t\treturn key;\n\t\t\t}\n\t\t\thashVal++;\n\t\t\thashVal = hashVal % size;\n\n\t\t}\n\t\treturn null;\n\t}", "@Override\r\n\tpublic V remove(Object key) {\r\n\t\tint index = key.hashCode() % numBuckets;\r\n\t\treturn ((Bucket) buckets[index]).remove((K) key);\r\n\t}", "V remove(final K key);", "public void removeValue(Object value)\n\t{\n\t\tif (values.contains(value))\n\t\t{\n\t\t\tvalues.remove(value + \"\");\n\t\t}\n\t}", "public abstract V remove(K key);", "public Entry<K, V> remove(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 Entry<K, V> entry = (Entry<K, V>) node.getItem();\r\n node.remove();\r\n return entry;\r\n }\r\n } catch (Exception e) {\r\n System.out.println(\"Unhashable key: \" + e);\r\n }\r\n return null;\r\n }", "void remove(K key);", "void remove(K key);", "void remove(K key);", "boolean remove(K key);", "boolean remove(K key);", "public Object remove(String key) {\r\n Object res = attributeMap.remove(key);\r\n fireStateChanged();\r\n return res;\r\n }", "public Object removeProperty( String key );", "@Override\n public V remove(K key) {\n return delete(root, key).val;\n }", "public void remove(String key){\n urlParams.remove(key);\n mJsonmap.remove(key);\n }", "protected void remove(K key) {\n segment.remove(key);\n }", "public void remove(K key) {\n Object[] entries = entrySet();\n\n for (int i = 0; i < entries.length; i ++) {\n Entry<K,V> entry = (Entry<K, V>) entries[i];\n if(entry.getKey().equals(key)) {\n entries[i] = null;\n break;\n }\n }\n\n this.table = new Object[TABLE_SIZE];\n\n rebuild(entries);\n }", "@Override\n\tpublic V remove(K key) {\n\t\treturn null;\n\t}", "public boolean remove(int val) {\n if (map.containsKey(val)) {\n map.remove(val);\n return true;\n }\n return false;\n }", "@Override\n public V remove(Object key) {\n int index = key.hashCode() % table.length;\n if (index < 0) {\n index += table.length;\n }\n if (table[index] == null) {\n return null; // key is not in table\n }\n for (Entry<K, V> entry : table[index]) {\n if (entry.getKey().equals(key)) {\n V value = entry.getValue();\n table[index].remove(entry);\n numKeys--;\n if (table[index].isEmpty()) {\n table[index] = null;\n }\n return value;\n }\n }\n return null;\n }", "@Override\r\n\tpublic void removeElement(K key) {\n\t\tque.remove(key);\r\n\t\thashMap.remove(key);\r\n\t}", "public synchronized Object remove( Object key ) {\n\t\tObject intvalue = mapKeyPos.remove(key);\n\t\tif ( intvalue != null ) {\n\t\t\tint pos = ((Integer)intvalue).intValue();\n\t\t\tObject temp = values[pos];\n\t\t\tkeys[pos] = null;\n\t\t\tvalues[pos] = null;\n\t\t\tstatus[pos] = LRU_OLD;\n\t\t\t//System.out.println(\"CountLimiteLRU: remove(\"+key+\") = \"+temp);\n\t\t\treturn temp;\n\t\t}\n\t\treturn null;\n\t}", "@Override\n public V remove(K key) {\n return null;\n }", "@Override\n\tpublic V remove(Object key) {\n\t\treturn null;\n\t}", "@Override\n\tpublic V remove(Object key) {\n\t\treturn null;\n\t}", "public V remove(K key) {\n CacheableObject cObj;\n\n synchronized(theLock) {\n cObj = valueMap.remove(key);\n if (null != cObj) {\n currentCacheSize -= cObj.containmentCount;\n }\n }\n\n return (cObj == null) ? null : cObj.cachedObject;\n }", "public Object remove(Map<Prop, Object> map) {\n return map.remove(this);\n }", "public boolean remove(Object o) {\r\n return this.map.remove(o.hashCode()) != null;\r\n }", "@Override\n\t\tpublic Object removeProperty(String key) {\n\t\t\treturn null;\n\t\t}", "public void remove(K key) {\n synchronized (cacheMap) {\n cacheMap.remove(key);\n }\n }", "public MapVS<K, T, V> remove(T keySummary) {\n final SetVS<T> newKeys = keys.remove(keySummary);\n\n final Map<K, V> newEntries = new HashMap<>(entries);\n for (GuardedValue<?> guardedKey : ValueSummary.getGuardedValues(keySummary)) {\n V oldVal = entries.get(guardedKey.getValue());\n if (oldVal == null) {\n continue;\n }\n\n final V remainingVal = oldVal.restrict(guardedKey.getGuard().not());\n if (remainingVal.isEmptyVS()) {\n newEntries.remove(guardedKey.getValue());\n } else {\n newEntries.put((K) guardedKey.getValue(), remainingVal);\n }\n }\n\n return new MapVS<>(newKeys, newEntries);\n }", "public V remove(final K key)\n {\n // Remove from the map\n final StackElement removedElement = this.hashMap.remove(key);\n\n // If removed, fix the double linked list and update newest and eldest element\n if (removedElement != null)\n {\n this.removeStackElement(removedElement);\n return removedElement.value;\n }\n\n return null;\n }", "public Collection<V> remove(String key) {\n return map.remove(key);\n }", "public void remove(int key) {\n int index = getIndex(key);\n int index2 = getIndex2(key);\n if(buckets[index] != null){\n buckets[index][index2] = false;\n }\n }", "public V removeKey( K key ) {\r\n\t\tint bucketIndex = getBucketIndex( key );\r\n\t\tMapNode<K, V> head = buckets.get(bucketIndex);\r\n\t\tMapNode<K, V> prev = null;\r\n\t\twhile( head != null ) {\r\n\t\t\tif( head.key.equals(key)) {\r\n\t\t\t\tsize--;\r\n\t\t\t\tif( prev == null ) {\r\n\t\t\t\t\t//sbse first key hi h thn second key\r\n\t\t\t\t\t//ko point kra dege arraylist m \r\n\t\t\t\t\tbuckets.set(bucketIndex, head.next );\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tprev.next = head.next;\r\n\t\t\t\t}\r\n\t\t\t\treturn head.value;\r\n\t\t\t}\r\n\t\t\tprev = head;\r\n\t\t\thead = head.next;\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "@Override\r\n\tpublic Object removeObject(Object key) {\n\t\treturn null;\r\n\t}" ]
[ "0.7669792", "0.7440138", "0.7434685", "0.7231268", "0.71799254", "0.71202505", "0.6888043", "0.6804768", "0.6779287", "0.6738268", "0.6724534", "0.6662862", "0.6639248", "0.6628914", "0.65815824", "0.65797514", "0.6575589", "0.6513635", "0.6500174", "0.64954704", "0.6492725", "0.64805585", "0.6474132", "0.6452937", "0.6441589", "0.64409155", "0.64232343", "0.63966537", "0.63789076", "0.6364839", "0.6351365", "0.6326636", "0.6322484", "0.6322484", "0.63182014", "0.6302893", "0.6301411", "0.6293665", "0.6292387", "0.62913126", "0.62779987", "0.62763494", "0.6260221", "0.6260221", "0.6256602", "0.6253122", "0.62382764", "0.6222321", "0.6213179", "0.6212438", "0.6206874", "0.61986923", "0.6174025", "0.61723125", "0.61723125", "0.61723125", "0.61674994", "0.6162088", "0.6149052", "0.6144019", "0.6138946", "0.61106324", "0.6106635", "0.6075812", "0.60750633", "0.60712004", "0.607083", "0.60611856", "0.60609937", "0.606096", "0.60276407", "0.6019601", "0.6019601", "0.6019601", "0.6010864", "0.6010864", "0.6008549", "0.60084516", "0.60050887", "0.60032386", "0.60024506", "0.6001929", "0.5991821", "0.5991645", "0.59863865", "0.5980513", "0.5975622", "0.59749067", "0.5969363", "0.5969363", "0.59664035", "0.59656656", "0.5961491", "0.59570605", "0.5948599", "0.5922659", "0.5917275", "0.59164846", "0.5911845", "0.5910269", "0.59047383" ]
0.0
-1
String of the binary array representing the .obj model
public Model3dMetadata processBinaryData(Model3dBinaryData model3dBinaryData) throws IOException { String message = model3dBinaryData.getBinaryArrayString(); // Convert the string into a byte array byte[] backToBytes = Base64.decodeBase64(message); String test = new String(backToBytes); System.out.println("The message decoded: " + test.substring(0, 3)); final IOBJParser parser = new OBJParser(); InputStream targetStream = new ByteArrayInputStream(backToBytes); final OBJModel model = parser.parse(targetStream); System.out.println(MessageFormat.format( "OBJ model has {0} vertices, {1} normals, {2} texture coordinates, and {3} objects.", model.getVertices().size(), model.getNormals().size(), model.getTexCoords().size(), model.getObjects().size())); Model3dMetadata model3dMetadata = new Model3dMetadata(); model3dMetadata.setBinaryArray(message); model3dMetadata.setTitle(model3dBinaryData.getTitle()); model3dMetadata.setDescription(model3dBinaryData.getDescription()); model3dMetadata.setNumberOfFaces((long)(model.getNormals().size())); model3dMetadata.setNumberOfVertices((long)(model.getVertices().size())); model3dMetadata.setAssetBundleBinaryArray(model3dBinaryData.getAssetBundleBinaryArray()); return model3dMetadata; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String toString() {\n\t\treturn Arrays.toString(data);\n\t}", "@Override\n public String toString() {\n String result = \"\";\n byte[] data = buffer.data;\n for (int i = 0; i < (buffer.end - buffer.start) / bytes; i++) {\n if (i > 0) result += \", \";\n result += get(i).toString();\n }\n return type + \"[\" + result + \"]\";\n }", "com.google.protobuf.ByteString getObj();", "public String toString() { \n\treturn _binNum;\n }", "public String getSerializedObj() {\r\n String serializedObject = null;\r\n // serialize the object\r\n // format = file content,size,name\r\n File f = this.fileObject;\r\n serializedObject = f.getBody()+\",\"+f.getFileSize()+\",\"+f.getName();\r\n return serializedObject;\r\n }", "public String toString() {\n\t\treturn BlobUtil.string(buffer, offset, size);\n\t}", "@Override\n public String toString() {\n // TODO: Using Serializer\n return Serializer.toByteArray(this).toString();\n }", "@Override\n\tpublic String toString()\n\t{\n\t\treturn new String(bytes);\n\t}", "public String toString() {\n\t\treturn b.toString();\n\t}", "public String toString(){\r\n\t\treturn Arrays.toString(ray)+\"\";\r\n\t}", "public com.google.protobuf.ByteString getObj() {\n return obj_;\n }", "com.google.protobuf.ByteString getModelBytes();", "public String toString() {\n if (this.data.isEmpty()) {\n return super.toString();\n }\n return BytesUtil.bytes2HexString(toBinary());\n }", "public com.google.protobuf.ByteString getObj() {\n return obj_;\n }", "public byte[] serialize();", "public byte[] getBytes() {\r\n \treturn toString().getBytes();\r\n }", "String serialize();", "@Override\r\n public byte[] toBinary(Object obj) {\r\n return JSON.toJSONBytes(obj, SerializerFeature.WriteClassName);\r\n }", "@Override\r\n\tpublic String toString() {\r\n\t\treturn Base64.encode(mByteList);\r\n\t}", "public String toString() {\n\t\treturn Arrays.toString(ram);\n\t}", "public String toString(){\n \treturn \"todo: use serialize() method\";\r\n }", "public String toString()\n/* */ {\n/* 210 */ return \"[array type, component type: \" + this._componentType + \"]\";\n/* */ }", "public String toString() { \n\t\t String str=\"\";\n\t\t for(int i=0; i< size; i++)\n\t\t\t str += data[i]+\" \";\n\t\t return str;\n\t }", "@Override\n public String toString() {\n return Arrays.toString(bufferpool);\n }", "public String objectToString(Object ob){\n Object[] obj = (Object[])ob;\n\n return obj[3].toString()+\" vs. \"+obj[4].toString()+\" (\"+obj[2].toString()+\")\";\n }", "public com.google.protobuf.ByteString\n getOBytes() {\n java.lang.Object ref = o_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n o_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public String toString() {\n int[] d = new int[size];\n for (int k=0; k<size; k++)\n d[k] = data[k];\n return Arrays.toString(d);\n }", "private static String toString (byte[] ba) {\r\n return toString(ba, 0, ba.length);\r\n }", "public String toString(){\n\t\tStringBuilder s = new StringBuilder(\"\");\n\t\ts.append(\"\\nMD2 Model details\\n\");\n\t\ts.append(\"\\tThere are \" + numFrames + \" key framess\\n\");\n\t\ts.append(\"\\tThere are \"+ point.length + \" points (XYZ coordinates)\\n\");\n\t\ts.append(\"\\tFor rendering there are \" + glComannd.length + \" triangle strips/fans\\n\");\n\t\ts.append(\"\\t and these have \" + glVertex.length + \" vertex definitions\\n\");\n\t\ts.append(\"\\tThere are \" + state.length + \" animation sequences\\n\");\n\t\ts.append(\"Estimated memory used \" + memUsage() + \" bytes for model excluding texture.\");\n\n\t\treturn new String(s);\n\t}", "@Override\n public String toString()\n {\n return Arrays.toString(this.toArray());\n }", "com.google.protobuf.ByteString\n getSerBytes();", "public String toString() {\n return \"\" + data;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getOBytes() {\n java.lang.Object ref = o_;\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 o_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public byte[] serialize() { length 9 bits, each value == byte\n // info string\n final short scratch = (short) ((0x7f & this.type) << 9 | 0x1ff & this.length);\n final byte[] data = new byte[2 + this.length];\n final ByteBuffer bb = ByteBuffer.wrap(data);\n bb.putShort(scratch);\n if (this.value != null) {\n bb.put(this.value);\n }\n return data;\n }", "public abstract String serialise();", "public String toString() { return stringify(this, true); }", "public String toString()\n {\n\t return \"[\" + data + \"]\";\n }", "public String toString() {\n return Util.bytesToHex(getByteArray());\n }", "public String toString() {\n\t\treturn data.toString();\n\t}", "public String toString() {\n\t\treturn data.toString();\n\t}", "public String toString() {\n return \"\" + \"Magic=\" + Magic // NOI18N\n + \", Version=\" + Version // NOI18N\n + \", Reserved=\" + Reserved // NOI18N\n + \", StringsOffset=\" + StringsOffset // NOI18N\n + \", NumEntries=\" + NumEntries // NOI18N\n + \", NumBuckets=\" + NumBuckets // NOI18N\n + \", MaxValueLength=\" + MaxValueLength; // NOI18N\n }", "@Override\n public String toString() {\n\treturn ByteUtils.toHexString(toByteArray(), true);\n }", "private String stackObjToString(Object o)\n {\n if (o instanceof byte[])\n return BtcUtil.hexOut((byte[]) o);\n else\n return o.toString();\n }", "public synchronized String toString()\n\t{\n\t\treturn Arrays.toString(array);\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn JSONFormatter.formatArray(this, 0, false).toString();\n\t}", "public java.lang.String getO() {\n java.lang.Object ref = o_;\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 o_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public String toString()\r\n\t{\r\n\t\treturn data.toString();\r\n\t}", "public String toString() {\n\t\treturn data.toString();\n }", "public String toString() {\n\treturn createString(data);\n }", "public String toString() {\n int iMax = array.length - 1;\n if (iMax == -1)\n return \"[]\";\n\n StringBuilder b = new StringBuilder();\n b.append('[');\n for (int i = 0; ; i++) {\n b.append(getRaw(byteOffset(i)));\n if (i == iMax)\n return b.append(']').toString();\n b.append(',').append(' ');\n }\n }", "com.google.protobuf.ByteString\n getSerialBytes();", "@Test\r\n\tpublic void toStringValid() {\r\n\t\ttestObj.addNativeField(0);\r\n\t\ttestObj.addNativeField(1);\r\n\t\ttestObj.addRelatedTable(0);\r\n\t\ttestObj.addRelatedTable(1);\r\n\t\ttestObj.makeArrays();\r\n\t\ttestObj.toString();\r\n\t\tassertEquals(\"Output string should have valid data\", \"Table: 1\\r\\n{\\r\\nTableName: test\\r\\nNativeFields: 0|1\\r\\nRelatedTables: 0|1\\r\\nRelatedFields: 0|0\\r\\n}\\r\\n\", testObj.toString());\r\n\t}", "public String binaryName() {\n return fullName();\n }", "public String getDumpString() {\n return \"[clazz = \" + clazz + \" , name = \" + name + \" , elementType = \" + elementType + \" , primitivePointerType = \" + primitivePointerType + \"]\";\n }", "public String toString(){\n\t\treturn logicalClass.toString();\n\t}", "public abstract String toString(String bin);", "public String toString()\n\t{\n\t\tString result = \"\";\n\t\tresult += this.data;\n\t\treturn result;\n\t}", "public String[] toStrings(String bin) {\n\t String strs[] = new String[makers.length];\n\t for (int i=0;i<strs.length;i++) strs[i] = makers[i].toString(bin);\n\t return strs;\n\t}", "@java.lang.Override\n public java.lang.String getO() {\n java.lang.Object ref = o_;\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 o_ = s;\n return s;\n }\n }", "public String toString(){\r\n\t\tString output = \"\";\r\n\t\tfor(String s: this.data){\r\n\t\t\toutput = output + s + \"\\t\";\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}", "public String toString() {\n String str = \" \";\n\n for (int i = 0; i < ctxObjs.length; ++i) {\n str += ctxObjs[i] + \" \";\n }\n return str;\n }", "@Override\n\tpublic String toString() {\n\t\tString s = \"\";\n\t\ts += \"[\";\n\t\tif (size() > 0) {\n\t\t\ts += arr[0];\n\t\t\tfor (int i = 1; i < arr.length; i++) {\n\t\t\t\ts += \", \" + arr[i];\n\t\t\t}\n\t\t}\n\t\ts += \"]\";\n\t\treturn s;\n\t}", "com.google.protobuf.ByteString\n getSerialBytes();", "public String toString() {\r\n String modelString =\r\n \"value=\"\r\n + getValue()\r\n + \", \"\r\n + \"extent=\"\r\n + getExtent()\r\n + \", \"\r\n + \"min=\"\r\n + getMinimum()\r\n + \", \"\r\n + \"max=\"\r\n + getMaximum()\r\n + \", \"\r\n + \"adj=\"\r\n + getValueIsAdjusting();\r\n\r\n return getClass().getName() + \"[\" + modelString + \"]\";\r\n }", "public String toString(){\r\n\t\tString superString = super.toString();\r\n\t\tStringBuilder builder = new StringBuilder();\r\n\t\t//Add the object to the string\r\n\t\tbuilder.append(\". \");\r\n\t\tif (this.error != null) {\r\n\t\t\tbuilder.append(error.toString());\r\n\t\t\tbuilder.append(\". \");\r\n\t\t}\r\n\t\tbuilder.append(\"Object: \");\r\n\t\tbuilder.append(object.toString());\r\n\t\tif (this.recordRoute)\r\n\t\t\tbuilder.append(\", [RECORD_ROUTE]\");\r\n\t\tif (this.reRouting) \r\n\t\t\tbuilder.append(\", [RE-ROUTING]\");\r\n\t\t//Add the masks to the string\r\n\t\tif (this.mask != null) {\r\n\t\t\tbuilder.append(\", label set: \");\r\n\t\t\tbuilder.append(mask.toString());\r\n\t\t}\r\n\t\treturn superString.concat(builder.toString());\r\n\t}", "@Override\n public String toString() {\n return stringBuilder.toString() + OBJECT_SUFFIX;\n }", "public String[] asStringArray() {\n\t\tString array[] = new String[4];\n\t\tarray[0] = \"Name: \" + this.name;\n\t\tarray[1] = \"Money: \" + Double.toString(this.money);\n\t\tarray[2] = \"On table: \" + Double.toString(onTable);\n\t\tif (this.getBlind() == Blind.NONE) {\n\t\t\tarray[3] = \"\";\n\t\t} else {\n\t\t\tarray[3] = \"Blind \" + this.blind.name();\n\t\t}\n\t\treturn array;\n\t}", "public String toString() {\n StringBuffer ret = new StringBuffer(\"APDU_Buffer = \");\n ret.append(makeHex(getBytes()));\n ret.append(\" (hex) | lc = \");\n ret.append(lc);\n ret.append(\" | le = \");\n ret.append(le);\n\n // make hex representation of byte array\n return ret.toString();\n }", "public String toString(){\n\treturn Arrays.toString(a);\n }", "public String toString() {\n\t\tString s = \"\";\n\t\tfor (Coord x : array)\n\t\t\ts += x;\n\t\treturn s;\n\t}", "@Override\n public String toString() {\n double[][] temp = matx.getArray();\n String tempstr = \"[\";\n for (int i = 0; i < temp.length; i++) {\n for (int j = 0; j < temp.length; j++) {\n tempstr += (int) temp[i][j] + \", \";\n }\n tempstr = tempstr.substring(0, tempstr.length() - 2);\n tempstr += \"]\\n[\";\n }\n return tempstr.substring(0, tempstr.length() - 2);\n }", "@Override\n\tpublic String toString() {\n\t\treturn \"\\nContents of SimpleArray:\\n\" + Arrays.toString(array);\n\t}", "com.google.protobuf.ByteString\n getToBytes();", "public String toString()\n\t{\n\t\tString result = new String();\n\t\tfor (boolean bit : bits)\n\t\t{\n\t\t\tif (bit) result += '1';\n\t\t\telse result += '0';\n\t\t}\n\t\treturn result;\n\t}", "@Override\r\n\tpublic String toString() {\n\t\treturn data;\r\n\t}", "public synchronized String toString() {\n StringBuffer oBuffer = new StringBuffer();\n\n oBuffer\n .append(\"Preprocessing params: \").append(this.oPreprocessingParams).append(\"\\n\")\n .append(\"Feature extraction params: \").append(this.oFeatureExtractionParams).append(\"\\n\")\n .append(\"Classification params: \").append(this.oClassificationParams);\n\n return oBuffer.toString();\n }", "public java.lang.String getBin() {\r\n return bin;\r\n }", "public String toString() ;", "public String toString() {\n return Arrays.toString(id);\n }", "String toJSON();", "public String toString() {\n\t String outPut = \"byteValue(): \" + byteValue()\n\t \t\t+ \"\\nshortValue(): \" + shortValue()\n\t \t\t+ \"\\nintValue(): \" + intValue()\n\t \t\t+ \"\\nlongValue(): \" + longValue()\n\t \t\t+ \"\\nfloatValue(): \" + floatValue()\n\t \t\t+ \"\\ndoubleValue(): \" + doubleValue();\n\t \n\t return outPut;\n }", "public String toString() {\r\n\treturn data;\r\n }", "String objectWrite();", "com.google.protobuf.ByteString\n getField1818Bytes();", "@Override\r\n public String toString() {\r\n return com.butterfill.opb.util.OpbToStringHelper.toString(this);\r\n }", "@Override\n public String toString() {\n StringBuilder sb = new StringBuilder();\n sb.append(\"{\");\n if (getBias() != null)\n sb.append(\"Bias: \").append(getBias()).append(\",\");\n if (getExplainability() != null)\n sb.append(\"Explainability: \").append(getExplainability()).append(\",\");\n if (getModelQuality() != null)\n sb.append(\"ModelQuality: \").append(getModelQuality()).append(\",\");\n if (getModelDataQuality() != null)\n sb.append(\"ModelDataQuality: \").append(getModelDataQuality());\n sb.append(\"}\");\n return sb.toString();\n }", "@Override\n public String toString() {\n byte[] buffer = toBuffer();\n return (buffer == null) ? null : new String(buffer, StandardCharsets.UTF_8);\n }", "public String toString() {\n\t\treturn getClass().getName() + \"[mode=\" + mode + \",size=\" + size\n\t\t\t + \",hgap=\" + hgap + \",vgap=\" + vgap + \"]\";\n\t}", "@Override\n public String toString() {\n return mFeatureStructures.toString();\n }", "@Override\n public String toString() {\n return \"array read on \" + System.identityHashCode(array) + \"; index=\" + index + \"; stream=\" + getStream().getStreamNumber();\n }", "public String toString()\r\n\t{\r\n\t\tString s = \"Volume Name: \" + volumeName + \" \" + \"Number of Books: \" + numberOfBooks + \"\\n\";\r\n\r\n\t\ts = s + getBookArray();\r\n\t\treturn s;\r\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn data.toString();\n\t}", "public String serialize()\n {\n return String.format(\"invuln=%b, flying=%b, canfly=%b, instabuild=%b, flyspeed=%.4f, walkspped=%.4f\", new Object[] {Boolean.valueOf(this.func_149112_c()), Boolean.valueOf(this.func_149106_d()), Boolean.valueOf(this.func_149105_e()), Boolean.valueOf(this.func_149103_f()), Float.valueOf(this.func_149101_g()), Float.valueOf(this.func_149107_h())});\n }", "@Override\n public String toString() {\n String arrString = \"\";\n \n //loop to add all the elements\n for (int i = 0; i < this.array.length; i++) {\n arrString = arrString + \" \" + this.array[i];\n }\n \n return arrString;\n }", "public String getYOB()\r\n\t{\r\n\t\treturn yob.getModelObjectAsString();\r\n\t}", "public String\nrdataToString() {\n\tStringBuffer sb = new StringBuffer();\n\tif (signature != null) {\n\t\tsb.append (Type.string(covered));\n\t\tsb.append (\" \");\n\t\tsb.append (alg);\n\t\tsb.append (\" \");\n\t\tsb.append (labels);\n\t\tsb.append (\" \");\n\t\tsb.append (origttl);\n\t\tsb.append (\" \");\n\t\tif (Options.check(\"multiline\"))\n\t\t\tsb.append (\"(\\n\\t\");\n\t\tsb.append (formatDate(expire));\n\t\tsb.append (\" \");\n\t\tsb.append (formatDate(timeSigned));\n\t\tsb.append (\" \");\n\t\tsb.append (footprint);\n\t\tsb.append (\" \");\n\t\tsb.append (signer);\n\t\tif (Options.check(\"multiline\")) {\n\t\t\tsb.append(\"\\n\");\n\t\t\tsb.append(base64.formatString(signature, 64, \"\\t\",\n\t\t\t\t true));\n\t\t} else {\n\t\t\tsb.append (\" \");\n\t\t\tsb.append(base64.toString(signature));\n\t\t}\n\t}\n\treturn sb.toString();\n}", "public String toString() {\n\t\t// WRITE YOUR CODE HERE!\n\t\tStringBuffer buffer = new StringBuffer();\n\t\tbuffer.append(\"Virtual dataset with \" +attributes.length+\" attribute(s) and \"+map.length+\" row(s)\"+ System.lineSeparator());\n\t\tbuffer.append(\"Dataset is a view over weather-nominal.csv\"+System.lineSeparator());\n\t\tbuffer.append(\"Row indices in this dataset (w.r.t its source dataset) [\");\n\n\t\tfor(int i = 0; i < map.length; i++){\n\t\t\tbuffer.append(map[i]);\n\t\t\tif(i!=map.length-1)\n\t\t\t\tbuffer.append(\",\");\n\t\t}\n\t\tbuffer.append(\"]\").append(System.lineSeparator());\n\t\tfor(int i =0; i<attributes.length; i++){\n\t\t\tbuffer.append(attributes[i]);\n\t\t\tbuffer.append(System.lineSeparator());\n\t\t}\n\t\treturn buffer.toString();\n\t}", "public String toString()\r\n\t{\r\n\t\tStringBuffer OutString = new StringBuffer();\r\n\t\t// Open tag\r\n\t\tOutString.append(\"<\");\r\n\t\t// Add the object's type\r\n\t\tOutString.append(getType());\r\n\t\t// attach the ID if required.\r\n\t\tif (DEBUG)\r\n\t\t\tOutString.append(getObjID());\r\n\t\t// add the class attribute if required; default: don't.\r\n\t\tif (getIncludeClassAttribute() == true)\r\n\t\t\tOutString.append(getClassAttribute());\r\n\t\t// Add any transformation information,\r\n\t\t// probably the minimum is the x and y values.\r\n\t\t// again this is new to Java 1.4;\r\n\t\t// this function returns a StringBuffer.\r\n\t\tOutString.append(getAttributes());\r\n\t\t// close the tag.\r\n\t\tOutString.append(\">\");\r\n\t\tOutString.append(\"&\"+entityReferenceName+\";\");\r\n\t\t// close tag\r\n\t\tOutString.append(\"</\");\r\n\t\tOutString.append(getType());\r\n\t\tOutString.append(\">\");\r\n\r\n\t\treturn OutString.toString();\r\n\t}", "com.google.protobuf.ByteString\n getField1066Bytes();", "public String serialize() {\n Gson gson = new Gson();\n return gson.toJson(this);\n }", "public String serialize() {\n Gson gson = new Gson();\n return gson.toJson(this);\n }" ]
[ "0.64253813", "0.63937247", "0.6310018", "0.62705606", "0.62691885", "0.6266961", "0.6262739", "0.6236606", "0.6222059", "0.6182845", "0.61700696", "0.61528003", "0.61495763", "0.61267555", "0.61087817", "0.60796225", "0.6061921", "0.6026335", "0.6013733", "0.6007847", "0.6000437", "0.59609944", "0.5926443", "0.5914878", "0.59073657", "0.5900354", "0.58747506", "0.5869704", "0.58611786", "0.58579344", "0.58371145", "0.5836296", "0.5836151", "0.58219784", "0.5810381", "0.58040375", "0.5800631", "0.5799618", "0.578116", "0.578116", "0.5777984", "0.5776067", "0.5771319", "0.57697433", "0.5768379", "0.5766527", "0.57664776", "0.5753872", "0.5738778", "0.57315123", "0.57280445", "0.5725536", "0.5724763", "0.57111734", "0.56849676", "0.5679897", "0.5678377", "0.5662038", "0.5653571", "0.56530327", "0.5646208", "0.5644288", "0.5638662", "0.56315905", "0.56216407", "0.5619731", "0.56194955", "0.561898", "0.5616221", "0.56114006", "0.5609009", "0.5606654", "0.56000286", "0.5596273", "0.55931777", "0.5593162", "0.5586699", "0.55787593", "0.55787444", "0.5577666", "0.55767024", "0.55651075", "0.556067", "0.5559009", "0.5557771", "0.5556062", "0.5552369", "0.55507714", "0.5548189", "0.552633", "0.5514726", "0.5511645", "0.55036694", "0.5501764", "0.54990745", "0.54982185", "0.5497127", "0.5496802", "0.549183", "0.5490264", "0.5490264" ]
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { arrayExample4 arrayexample4 = new arrayExample4(); int input[] = { 15, 10, 19, 30, 122, 42, 99, -2, 12, 33 }; int ans = arrayexample4.maxNumber(input); byte ans1 = (byte) arrayexample4.minNumber(input); System.out.println("Minimum Number is: " + ans1); System.out.println("Maximum Number is: " + ans); arrayexample4.listNumbersAsc(); arrayexample4.listNumbersDesc(); arrayexample4.avgNumber(input); System.out.println("Average minmax:"+ arrayexample4.avgMinMax(input)); }
{ "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
Created by cnbo on 1741.
public interface IWebAuthorService { AdminDTO getAdminDTO(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "public final void mo51373a() {\n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "protected boolean func_70814_o() { return true; }", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tprotected void interr() {\n\t}", "private stendhal() {\n\t}", "private static void cajas() {\n\t\t\n\t}", "public void mo38117a() {\n }", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "private void poetries() {\n\n\t}", "private void m50366E() {\n }", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\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\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\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "private void kk12() {\n\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void getExras() {\n\n\t}", "private void init() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\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 public void init() {\n }", "@Override\r\n\tpublic void init() {}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n protected void init() {\n }", "@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 one() {\n\t\t\n\t}", "@Override\n public int describeContents() { return 0; }", "@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 void mo12628c() {\n }", "@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 public void init() {}", "public void method_4270() {}", "@Override\n void init() {\n }", "public void mo6081a() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n protected void initialize() {\n\n \n }", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "private void strin() {\n\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\n\tpublic void init() {\n\t}", "protected void mo6255a() {\n }", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "public abstract void mo70713b();", "@Override\n\tpublic void init()\n\t{\n\n\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "public void m23075a() {\n }", "private void init() {\n\n\n\n }", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "protected boolean func_70041_e_() { return false; }", "@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\t\tpublic void init() {\n\t\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "public void Tyre() {\n\t\t\r\n\t}", "@Override\n public void memoria() {\n \n }", "public void mo55254a() {\n }", "@Override\n protected void getExras() {\n }", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n protected void initialize() \n {\n \n }" ]
[ "0.60277534", "0.59956276", "0.59462297", "0.5932903", "0.59248155", "0.5893898", "0.5893898", "0.58239627", "0.58214056", "0.5809517", "0.57869935", "0.5757252", "0.5741674", "0.5739157", "0.5713668", "0.5699615", "0.5685925", "0.56802756", "0.5669666", "0.56685245", "0.56685245", "0.56685245", "0.56685245", "0.56685245", "0.5661111", "0.56526005", "0.5643099", "0.5637287", "0.56161743", "0.56009763", "0.55997133", "0.5588934", "0.55848455", "0.55658126", "0.5554056", "0.55459577", "0.55433804", "0.554201", "0.554201", "0.554201", "0.554201", "0.554201", "0.554201", "0.554201", "0.5535408", "0.5519437", "0.5515905", "0.5515905", "0.55153406", "0.55137086", "0.55137086", "0.55137086", "0.55103046", "0.5506381", "0.5490974", "0.5490974", "0.5490974", "0.5481718", "0.54801065", "0.54801065", "0.54801065", "0.5476611", "0.547592", "0.54754025", "0.54667777", "0.5465385", "0.54505205", "0.54416096", "0.54416096", "0.54412884", "0.54330826", "0.5430767", "0.5429653", "0.5425968", "0.5424947", "0.54247344", "0.54163575", "0.54105496", "0.5408873", "0.5408873", "0.5408873", "0.5408873", "0.5408873", "0.5408873", "0.5402161", "0.5402012", "0.5401737", "0.5398323", "0.53940505", "0.5385613", "0.5385252", "0.53845406", "0.53845406", "0.5374389", "0.53719366", "0.5368007", "0.5367874", "0.53640825", "0.53635764", "0.53603125", "0.5359163" ]
0.0
-1
Returns current value of the sensor.
public SensorValueWeb(int sensorId, long timestamp, double value, SensorValueState state, Double gradient) { this.sensorId = sensorId; this.timestamp = timestamp; this.value = value; this.state = state; this.gradient = gradient; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public double getValue() {\n\t\treturn sensorval;\n\t}", "@Override\r\n\tpublic Text getCurrentValue() throws IOException, InterruptedException {\n\t\treturn this.value;\r\n\t}", "public Result getCurrentValue() throws IOException, InterruptedException {\n return value;\n }", "public float getCurrentValue() {\n return currentValue;\n }", "public Number getValue() {\n return currentVal;\n }", "public byte getSensor() {\r\n\t\tbyte sensor;\r\n\t\tsensor=this.sensor;\r\n\t\treturn sensor;\r\n\t}", "private double getValue() {\n return value;\n }", "public double getValue() {\n\t\treturn(value);\n\t}", "public abstract VALUEIN getCurrentValue() throws IOException, \n InterruptedException;", "public double getValue() {\n return value;\n }", "public double getValue() {\n return value;\n }", "public double getValue() {\n return value;\n }", "public double getValue() {\n return value_;\n }", "public double getValue() {\n\t\treturn value;\n\t}", "public double getValue() {\n\t\treturn value;\n\t}", "public double getValue() {\n\t\treturn value;\n\t}", "public double getValue() {\r\n\t\treturn value;\r\n\t}", "public double getValue() {\n return value_;\n }", "public double getValue()\n {\n return this.value;\n }", "public double getValue(){\n return value;\n }", "public double getCurrentTemperature() {\n return this.currentTemperature;\n }", "public double getValue() {\r\n return this.value;\r\n }", "public double value() {\r\n return value;\r\n }", "public double getValue() {\n return this._value;\n }", "@Override\n\tpublic double getValue() {\n\t\treturn value;\n\t}", "public double getValue() {\n\t\treturn this.value; \n\t}", "public double getValue() {\n return this.value;\n }", "public double getValue() {\n return this.value;\n }", "public String getSensor()\n {\n return sensor;\n }", "public final float getValue() {\r\n\t\treturn value;\r\n\t}", "public int getCurrentValue() {\n\t\treturn this.currentValue;\n\t}", "@Override\n\tprotected int getSensorData() {\n\t\treturn sensor.getLightValue();\n\t}", "public double getValue() {\n\t\treturn this.value;\n\t}", "public double getCurrentValue()\r\n\t{\r\n\t\tcurrentValue=(2*border+24)/2;\r\n\t\treturn currentValue;\r\n\t}", "public Object getValue() {\n synchronized (mutex) {\n return statisticsAccumulator.getValue();\n }\n }", "String getCurrentValue();", "public float getCurrentTemp(){\n return currentTemp;\n }", "@Override\n public double getValue()\n {\n return value;\n }", "public float getValue() {\n return value;\n }", "public float getValue() {\n\t\treturn value;\n\t}", "public float getValue()\n\t{\n\t\treturn this.value;\n\t}", "public Double getValue() {\n return value;\n }", "public Double getValue() {\n return value;\n }", "@Override\n public double getValue(Pin pin) {\n super.getValue(pin);\n return isInitiated() ? readAnalog(toCommand((short) pin.getAddress())) : INVALID_VALUE;\n }", "public double getCurrent( )\n {\n // Implemented by student.\n }", "@Override\n\tpublic float value() {\n\t\treturn currnet().value();\n\t}", "public Integer getCurrentValue() {\n return currentValue;\n }", "public Integer getCurrentValue() {\n return currentValue;\n }", "public double getCurrent() {\n return elevatorSpark.getOutputCurrent();\n }", "@Override\n public double getValue() {\n return currentLoad;\n }", "public float getValue() {\n return value_;\n }", "double getValue();", "double getValue();", "double getValue();", "Sensor getSensor();", "private int getCurrentValue()\n {\n return\n // Overall wait time...\n _countdownValue -\n // ...minus the time we waited so far.\n (int)(_clock.currentTime() - _startWait);\n }", "double getValue() {\n return mValue;\n }", "public float getValue() {\n return value_;\n }", "public double getValue(){\n\t\treturn slider.getValue() ;\n\t}", "public T getValue() {\r\n return getValue(interval.start);\r\n }", "public int getValue() \n {\n return value;\n }", "public double getValue();", "public int getValue () {\n return value;\n }", "synchronized byte getCurrentValueLo()\n {\n return (byte)getCurrentValue();\n }", "public double getValue()\n\t{\n\t\treturn ifD1.getValue();// X100 lux\n\t}", "public long getValue() {\n return value_;\n }", "public double getValue()\r\n\t{\r\n\t\treturn (double) value;\r\n\t}", "public double getTemp(){\n return currentTemp;\n }", "public long getValue() {\n return value_;\n }", "public int getCurrentValue() throws DfException {\n\t\tfinal String valueStr = object.getString(CURRENT_VALUE);\n\t\tfinal int value = Integer.parseInt(valueStr);\n\t\treturn value;\n\t}", "public int getValue() \n {\n return value;\n }", "public long getValue()\n {\n return itsValue;\n }", "public V value()\n\t\t{\n\t\t\treturn _value;\n\t\t}", "public int readValue() { \n\t\treturn (port.readRawValue() - offset); \n\t}", "public S getValue() { return value; }", "public int getValue()\n {\n return value;\n }", "@Override\r\n public double doubleValue() {\r\n return this.m_current;\r\n }", "public int getValue(){\n return this.value;\n }", "public int getVoltage ()\n {\n return _voltage;\n }", "public int getValue()\r\n {\r\n return value;\r\n }", "public int getValue()\n {\n return value;\n }", "public Double value() {\n return this.value;\n }", "public long getValue() {\n\treturn value;\n }", "public double getValue() {\n\t\t// TODO Auto-generated method stub\n\t\treturn 1.00;\n\t}", "protected V getValue() {\n return this.value;\n }", "public V getValue() {\n return value;\n }", "public V getValue() {\n return value;\n }", "public V getValue() {\n return value;\n }", "public V getValue() {\n return value;\n }", "public V getValue() {\r\n\t\treturn value;\r\n\t}", "V getValue() {\n return value;\n }", "public V getValue() {\n\t\treturn value;\n\t}", "public V getValue() {\n\t\treturn value;\n\t}", "public V getValue() {\n return value;\n }", "public V getValue() {\n return value;\n }", "public int getValue() {\r\n return value;\r\n }", "float getValue();", "float getValue();", "float getValue();", "public int value() \n {\n return value;\n }", "public int getValue(){\n return value;\n }" ]
[ "0.84924704", "0.7442244", "0.7406158", "0.73879045", "0.73742396", "0.7288273", "0.72416127", "0.722366", "0.72083473", "0.7189823", "0.7189823", "0.7189823", "0.71692026", "0.7150131", "0.7150131", "0.7150131", "0.7148379", "0.714084", "0.7137793", "0.71091104", "0.708543", "0.70726484", "0.7066197", "0.70573986", "0.70487344", "0.704196", "0.703808", "0.703808", "0.7037442", "0.6997304", "0.69917566", "0.699027", "0.6986336", "0.69657373", "0.6944303", "0.69431704", "0.6934874", "0.6930078", "0.69257766", "0.6916218", "0.6914464", "0.69025916", "0.69025916", "0.6901544", "0.6893105", "0.6877992", "0.68703985", "0.68703985", "0.6863618", "0.68493783", "0.6824636", "0.68158394", "0.68158394", "0.68158394", "0.68136644", "0.6813251", "0.6801514", "0.67907614", "0.6780566", "0.67696035", "0.67680275", "0.676702", "0.676119", "0.6760892", "0.67490196", "0.6747142", "0.67450804", "0.67414063", "0.67365247", "0.67335063", "0.6731789", "0.67314744", "0.6731466", "0.6728462", "0.6723833", "0.6717525", "0.6717346", "0.6714596", "0.67141986", "0.6713455", "0.67120737", "0.670804", "0.67074", "0.6705444", "0.67045987", "0.67020375", "0.67020375", "0.67020375", "0.67020375", "0.66993153", "0.66912395", "0.6676853", "0.6676853", "0.6673871", "0.6673871", "0.6658869", "0.66582435", "0.66582435", "0.66582435", "0.6656592", "0.6648016" ]
0.0
-1
////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////for trace purposes display all variables and their value
public void displayVariables(TextArea textArea) { Enumeration enum1 = variableList.elements() ; while(enum1.hasMoreElements()) { RuleVariable temp = (RuleVariable)enum1.nextElement() ; textArea.appendText("\n" + temp.name + " value = " + temp.value) ; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void displayVariables() {\n Iterator i = dvm.getVariableNames().iterator();\n Object temp;\n while(i.hasNext()){\n temp = i.next();\n System.out.print(temp + \": \" + dvm.getValue(temp.toString()) + \"\\n\");\n }\n }", "public void displayValues()\n {\n \tSystem.out.println(\"The name of a bicycle is \"+name);\n \tSystem.out.println(\"The cost of a bicycle is \"+cost);\n \tSystem.out.println(\"The total numer of gears \"+gears);\n \t\n \t\n }", "public void dump() {\n List<String> variableStrings = new ArrayList<>();\n for (int i = 1; i <= VARIABLE_COUNT; i++) {\n if (variables.containsKey(i)) {\n variableStrings.add(variables.get(i).toString());\n }\n }\n System.out.println(String.format(\"site %d - %s\", id, String.join(\", \", variableStrings)));\n }", "static void PrintVarValues(String s){\n System.out.println(s);\n }", "public String variableValues() {\n\t\tif (name.values().size()==0)\n\t\t\treturn \"Symbol table is empty\";\n\t\tString s = \"Variable values\\n\";\n\t\tfor (NameSSA n : name.values()) {\n\t\t\tVariable v = var.get(n.current());\n\t\t\tif (v.isConstant())\n\t\t\t\ts += n.current() + \":\" + v.constantNumber();\n\t\t\telse \n\t\t\t\ts += n.current() + \":\" + \" unknown\";\n\t\t\ts+=\" \";\n\t\t}\n\t\treturn s;\n\t}", "public void printFields(){\n\t\tif(this.returnValueType==null){\n\t\t\tthis.returnValueType=\"\";\n\t\t}\n\t\tif(this.returnValueType==null){\n\t\t\tthis.className=\"\";\n\t\t}\n\t\tif(this.returnValueType==null){\n\t\t\tthis.methodName=\"\";\n\t\t}\n\t\tSystem.out.print(\"\t\"+this.address+\"\t\"+this.returnValueType+\" \"+this.className+\".\"+this.methodName+\" \");\n\t\tSystem.out.print(\"(\");\n\t\tif(this.hasParameter()){\n\t\t\t\n\t\t\tfor(int j=0;j<this.parameterType.length;j++){\n\t\t\t\tSystem.out.print(this.parameterType[j]);\n\t\t\t\tif(j!=(this.parameterType.length-1)){\n\t\t\t\t\tSystem.out.print(\", \");\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t}\n\t\tSystem.out.println(\")\");\n\n\t}", "public void printInfo()\n {\n System.out.println(\"position Value:\" + pos_.get(0).getPosition());\n System.out.println(\"velocitiy Value:\" + vel_.get(0).getVelocity());\n System.out.println(\"lastUpdateTime Value:\" + lastPosUpdateTime_);\n System.out.println(\"KalmanGain_ Value:\" + KalmanGain_);\n }", "public void printVal()\n {\n for (int i=0;i<intData.length;i++)\n System.out.print(intData[i] + \" \");\n System.out.println();\n System.out.println(\"Sum: \" + sum + \", Avg: \" + avg + \", Prod: \" + prod);\n }", "private static void showValues(Derived derived) {\n\t\tSystem.out.println(\"\\n\\tX = \" + derived.getX()\n\t\t+ \";\\tY = \" + derived.getY() + \";\\tZ = \"\n\t\t+ derived.getZ() + \";\\tThe Largest Value Is : \"\n\t\t+ derived.getLargestValue());\n\t}", "static void dumpVariablesInOrder( PrintWriter pw ) {\n try {\n for ( int i=0; i<Vtable.size(); i++ ) {\n int v = i+1;\n String varname = findVar(v);\n variable var = find(varname);\n if (var.userVisible)\n pw.println( \"c u \" + v + \" \" + varname );\n else\n pw.println( \"c c \" + v + \" \" + varname );\n }\n }\n catch ( Exception e ) {\n Util.fatalError( \"dumpVariablesInOrder Exception \" +\n e.getMessage() );\n }\n }", "String explainValue() {\n ArrayList ts = new ArrayList();\n\n // collect all variables together that contribute to this variable's\n // value\n\n ts.add((variable) this);\n collectAntecedents( ts );\n\n // now, iterate over this set in order from ground up\n\n String result = \"\";\n Iterator i = ts.iterator();\n /*while(i.hasNext()){\n variable v = (variable) i.next();\n System.out.println(\"ts: \" + v.name + v.reason);\n }\n i = ts.iterator();*/\n while (i.hasNext()) {\n variable v = (variable) i.next();\n //System.out.println(\"explainValue: \" + v.name);\n result = v.explainVariable() + result;\n //System.out.println(\"returned explainValue: \" + v.name);\n }\n return result;\n }", "public void printValues() {\n\t\tfor (int i = 0; i < 7; i++) {\n\t\t\tfor (int j = 0; j < 7; j++) {\n\t\t\t\tlblCenter[i][j].setText(\"\" + array.getElement(i, j));\n\t\t\t}\n\t\t\ttfWest[i].setText(\"\" + leftCol.getElement(i));\n\t\t\ttfSouth[i].setText(\"\" + bottomRow.getElement(i));\n\t\t}\n\t}", "public void displayStateValues()\n\t{\n\t\tfor (State s : stateSpace)\n\t\t{\n\t\t\tSystem.out.println(s.state + \"\\t\" + this.value.get(s));\n\t\t}\n\t}", "void printInfo() {\n\t\tdouble salary=120000;\n\t System.out.println(salary);\n\t\tSystem.out.println(name+\" \"+age);\n\t}", "private void diplay() {\n\t\tSystem.out.println(new StringBuilder(HUMIDITY_CONSTANT + humidity + TEMPRETURE_CONSTANT + temp\n\t\t\t\t+ PRESSURE_CONSTANT + pressure));\n\n\t}", "public void print_dev() {\n\t\tSystem.out.println(\r\n\t\t\t\t\t\t\t\t\t\"[System] 펫 정보입니다.\\n 이름 : \"+TMGCSYS.tmgcName\r\n\t\t\t\t\t\t\t\t+\t\", 레벨 : \"+TMGCSYS.tmgcLV+\", 경험치 : \"+TMGCSYS.tmgcEXP+\"/\"+(100*TMGCSYS.tmgcLV)\r\n\t\t\t\t\t\t\t\t+\t\", 체력 : \"+TMGCSYS.tmgcHP+\", 스트레스 : \"+TMGCSYS.tmgcStress+\"\\n\\n\\n\"\r\n\t\t\t\t\t\t\t\t+\t\" Function Limit Count\\n\"\r\n\t\t\t\t\t\t\t\t+\t\" Eat : \"+TMGCSYS.tmgcLimitEat+\", Sleep : \"+TMGCSYS.tmgcLimitSleep\r\n\t\t\t\t\t\t\t\t+\t\", Walk : \"+TMGCSYS.tmgcLimitWalk+\", Study : \"+TMGCSYS.tmgcLimitStudy+\"\\n\\n\\n\"\r\n\t\t\t\t\t\t\t\t+\t\" Character Ability\\n\"\r\n\t\t\t\t\t\t\t\t+\t\" STR : \"+TMGCSYS.tmgcSTR+\", INT : \"+TMGCSYS.tmgcINT\r\n\t\t\t\t\t\t\t\t+\t\", DEB : \"+TMGCSYS.tmgcDEB+\", HET : \"+TMGCSYS.tmgcHET+\"\\n\\n\\n\"\r\n\t\t\t\t\t\t\t\t+\t\" Character Job : \"+TMGCSYS.tmgc2ndJob\r\n\t\t\t\t\t\t\t\t);\r\n\t}", "static void print() {\n\t\tSystem.out.println(\"Value of x1 = \" +x1);\n\t}", "public void logDebugData() {\n SmartDashboard.putNumber(\"Ele Pos\", getPosition());\n SmartDashboard.putBoolean(\"Ele Switch\", bottomSwitchValue());\n SmartDashboard.putNumber(\"Ele Current\", getCurrent());\n SmartDashboard.putNumber(\"Ele Out %\", elevatorSpark.getAppliedOutput());\n }", "public void dump() {\n\t\tfor(Symbol s: assignments.keySet()) {\n\t\t\tSystem.out.println(s.toString() + \" = \" + assignments.get(s));\n\t\t}\t\n\t}", "void debug() {\n\t\tfor( int i = 0; i < N; i++ ) {\t\n\t\t\tSystem.out.print(i+\" \");\n\t\t\tfor( int j = 0; j < N; j++ )\n\t\t\t\tSystem.out.print(j+\":\"+(defined[i][j]?\"T\":\"F\")+\" \"+\n\t\t\t\t\t\tc[i][j]+\" p=\"+path[i][j]+\" f=\"+f[i][j]+\"; \");\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public void showInfo()\n\t{\n\t\tSystem.out.println(\"Account Number : \"+getAccountNumber());\n\t\tSystem.out.println(\"Balance : \"+getBalance());\n\t\tSystem.out.println(\"Tenure Year : \"+tenureYear);\n\t}", "public String getVariablesInternal() {\n StringBuilder b = new StringBuilder();\n JTable table = m_table.getTable();\n int numRows = table.getModel().getRowCount();\n\n for (int i = 0; i < numRows; i++) {\n String paramName = table.getValueAt(i, 0).toString();\n String paramValue = table.getValueAt(i, 1).toString();\n if (paramName.length() > 0 && paramValue.length() > 0) {\n b.append(paramName).append(SetVariables.SEP2).append(paramValue);\n }\n if (i < numRows - 1) {\n b.append(SetVariables.SEP1);\n }\n }\n\n return b.toString();\n }", "public void info() {\r\n System.out.println(\" Name: \" + name + \" Facility: \" + facility + \" Floor: \" + floor + \" Covid: \"\r\n + positive + \" Age: \" + age + \" ID: \" + id);\r\n }", "public void dispAll(){\n System.out.println(\"HISTORY :\");\n for(int i=0;i<history.size();i++)\n System.out.print(history.get(i) + \" | \");\n System.out.println(\"\\nSTACK :\");\n Stack <Object> acc = new Stack<>();\n while (!stack.isEmpty())acc.push(stack.pop());\n while (!acc.isEmpty()){\n System.out.print(acc.peek()+ \" | \");\n stack.push(acc.pop());\n }\n System.out.println(\"\\nVariables Stockes : \" + variables.toString());\n }", "public String toString()\n\t{\n\t\treturn \"\" + storedVar1 + storedVar2;\n\t}", "public void printForDebug() {\n\t\tif(Globalconstantable.DEBUG)\n\t\t{\n\t\t\tSystem.out.println(this.getSID());\n\t\t\tSystem.out.println(this.getScores());\n\t\t}\n\t}", "public void print() {\n\t\tSystem.out.println(\"[System] 펫 정보입니다.\\n 이름 : \"+TMGCSYS.tmgcName+\", 레벨 : \"+TMGCSYS.tmgcLV+\", 경험치 : \"+TMGCSYS.tmgcEXP+\"/\"+(100*TMGCSYS.tmgcLV)+\", 체력 : \"+TMGCSYS.tmgcHP+\", 스트레스 : \"+TMGCSYS.tmgcStress);\r\n\t}", "void displayDebugInformation() {\n\t\tmyParent.text(\"X\", X.x + 10, X.y + 5);\n\t\tmyParent.text(\"Y\", Y.x + 10, Y.y + 5);\n\t\tmyParent.text(\"Z\", Z.x + 10, Z.y + 5);\n\t\tmyParent.text(\"Q\", Q.x + 10, Q.y + 5);\n\t\tmyParent.fill(255);\n\n\t\tString pointFocuses = \"\";\n\t\tString stickedPoints = \"\";\n\t\tfor (int i = 0; i < amount; i++) {\n\t\t\tpointFocuses += point[i].isFocusedOnThePoint() + \" \";\n\t\t\tstickedPoints += point[i].sticked + \" \";\n\n\t\t\t// fill(200);\n\t\t\tmyParent.text(i, point[i].x + 10, point[i].y + 5);\n\t\t}\n\n\t\tmyParent.text(\"state: \" + state + \"\\nfocused on line: \" + selectedLine + \"\\nfocused on point: \" + selectedPoint\n\t\t\t\t+ \"\\nmouseLockedToLine: \" + mouseLockedToLine + \"\\npointFocuses: \" + pointFocuses + \"\\nstickedPoints: \"\n\t\t\t\t+ stickedPoints + \"\\ndragLock: \" + dragLock + \"\\ndiagonal scale factor: \" + diagonalScaleFactor\n\t\t\t\t+ \"\\npress D to hide debug\", 40, myParent.height - 160);\n\n\t\t// diplayNeighborPoints();\n\t}", "public void show()\n {\n System.out.println( getFullName() + \", \" +\n String.format(Locale.ENGLISH, \"%.1f\", getAcademicPerformance()) + \", \" +\n String.format(Locale.ENGLISH,\"%.1f\", getSocialActivity()) + \", \" +\n String.format(Locale.ENGLISH,\"%.1f\", getCommunicability()) + \", \" +\n String.format(Locale.ENGLISH,\"%.1f\", getInitiative()) + \", \" +\n String.format(Locale.ENGLISH,\"%.1f\", getOrganizationalAbilities())\n );\n }", "@Override\n\tpublic void display() {\n\t\tSystem.out.println(valueType+\": \"+value);\n\t}", "public void printInfo(){\n System.out.println(\" this is my y \"+(y+1)+\" this is my x \"+ X.valueOfInt(x));\n System.out.println(\"i am full: \"+ isFull);\n }", "private void dumpState() {\r\n\t\tfor (TextChunk location : locationalResult) {\r\n\t\t\tlocation.printDiagnostics();\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "void printData()\n {\n System.out.println(\"Studentname=\" +name);\n System.out.println(\"Student city =\"+city);\n System.out.println(\"Student age = \"+age);\n }", "public void debug()\r\n\t{\r\n\t\tfloat entriesPerSlot = (float) numEntries / (float) numFilledSlots;\r\n\r\n\t\tString result = \"Format of display is\\n\";\r\n\t\tresult += \"Slot number: data record\\n\\n\";\r\n\t\tresult += \"Current table size:\\t\\t\\t\\t\\t\\t\" + table.length + \"\\n\";\r\n\t\tresult += \"Number of elements in table:\\t\\t\\t\" + numEntries + \"\\n\";\r\n\t\tresult += \"Number of filled slots in table:\\t\\t\" + numFilledSlots + \"\\n\";\r\n\t\tresult += \"Average number of entries per slot is:\\t\" + entriesPerSlot + \"\\n\";\r\n\t\tSystem.out.println(result);\r\n\r\n\t\tfor (int i = 0; i < table.length; i++)\r\n\t\t{\r\n\t\t\t// If the current slot has a value in it\r\n\t\t\tif (table[i] != null && !table[i].isTombstone)\r\n\t\t\t{\r\n\t\t\t\t// Store the key that it stores\r\n\t\t\t\tresult = \"\\n\" + i + \":\\t\" + ((i < 100) ? \"\\t\" : \"\") + \"[\" + table[i].key.toString() + \", \";\r\n\r\n\t\t\t\t// Loop through all of the entries at that key\r\n\t\t\t\tfor (V entry : table[i].value)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Store the next value at that key\r\n\t\t\t\t\tresult += \"(\" + entry.toString() + \"), \";\r\n\t\t\t\t}\r\n\r\n\t\t\t\tresult = result.substring(0, result.length() - 2) + \"]\";\r\n\t\t\t\tSystem.out.println(result);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic void Print() {\r\n\t\tSystem.out.print(this.tav+\" \");\r\n\t\t\r\n\t}", "public String toDebugString();", "public void display(){\r\n System.out.println(\"The Vacancy Number is : \" + getVacancyNumber());\r\n System.out.println(\"The Designation is : \" + getDesignation());\r\n System.out.println(\"The Job Type is : \" + getJobType());\r\n }", "public void display() {\r\n\t\tArrayList<String> vnames = new ArrayList<>(vces.keySet());\r\n\t\tfor (String vname : vnames) {\r\n\t\t\tString str = vname + \" => \";\r\n\t\t\tVertex vtx = vces.get(vname);\r\n\r\n\t\t\tArrayList<String> nbrnames = new ArrayList<>(vtx.nbrs.keySet());\r\n\t\t\tfor (String nbrname : nbrnames) {\r\n\t\t\t\tstr += nbrname + \"[\" + vtx.nbrs.get(nbrname) + \"], \";\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.println(str + \".\");\r\n\t\t}\r\n\t}", "public void traceStatus() {\n logger.trace(\"jvmThread: {}, jvmMethod: {}\", jvmThread, jvmMethod);\n logger.trace(\"localVariables: {}\", localVariables);\n logger.trace(\"operandStacks: {}\", operandStacks);\n }", "public void debugPrint() {\n\t\tsuper.debugPrint();\n\t\tSystem.out.println(\"requestID: \" + requestID);\n\t\tSystem.out.println(\"jzn: \" + jzn);\n\t\tif (jzn != null) {\n\t\t\tfor (int i = 0; i < jzn.length; i++) {\n\t\t\t\tSystem.out.println(i + \": \" + (jzn[i] != null ? jzn[i].length() : 0));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"jzt: \" + jzt);\t\t\n\t}", "public String toString () {\n return nameOfVar;\n }", "private void printData() {\n\n\t\tfor (int i = 0; i < data.size(); i++) {\n\t\t\tlog(\" *** data index \" + i + \" = \" + data.elementAt(i));\n\t\t}\n\t}", "public void print (){\r\n\t\tSystem.out.print(\" > Inputs (\"+numInputAttributes+\"): \");\r\n\t\tfor (int i=0; i<numInputAttributes; i++){\r\n\t\t\tif (missingValues[Instance.ATT_INPUT][i]){\r\n\t\t\t\tSystem.out.print(\"?\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tswitch(Attributes.getInputAttribute(i).getType()){\r\n\t\t\t\tcase Attribute.NOMINAL:\r\n\t\t\t\t\tSystem.out.print(nominalValues[Instance.ATT_INPUT][i]); \r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase Attribute.INTEGER:\r\n\t\t\t\t\tSystem.out.print((int)realValues[Instance.ATT_INPUT][i]);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase Attribute.REAL:\r\n\t\t\t\t\tSystem.out.print(realValues[Instance.ATT_INPUT][i]);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.print(\" \");\r\n\t\t}\r\n\t\tSystem.out.print(\" > Outputs (\"+numOutputAttributes+\"): \");\r\n\t\tfor (int i=0; i<numOutputAttributes; i++){\r\n\t\t\tif (missingValues[Instance.ATT_OUTPUT][i]){\r\n\t\t\t\tSystem.out.print(\"?\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tswitch(Attributes.getOutputAttribute(i).getType()){\r\n\t\t\t\tcase Attribute.NOMINAL:\r\n\t\t\t\t\tSystem.out.print(nominalValues[Instance.ATT_OUTPUT][i]); \r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase Attribute.INTEGER:\r\n\t\t\t\t\tSystem.out.print((int)realValues[Instance.ATT_OUTPUT][i]);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase Attribute.REAL:\r\n\t\t\t\t\tSystem.out.print(realValues[Instance.ATT_OUTPUT][i]);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.print(\" \");\r\n\t\t}\r\n\r\n\t\tSystem.out.print(\" > Undefined (\"+numUndefinedAttributes+\"): \");\r\n\t\tfor (int i=0; i<numUndefinedAttributes; i++){\r\n\t\t\tif (missingValues[Instance.ATT_NONDEF][i]){\r\n\t\t\t\tSystem.out.print(\"?\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tswitch(Attributes.getUndefinedAttribute(i).getType()){\r\n\t\t\t\tcase Attribute.NOMINAL:\r\n\t\t\t\t\tSystem.out.print(nominalValues[Instance.ATT_NONDEF][i]); \r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase Attribute.INTEGER:\r\n\t\t\t\t\tSystem.out.print((int)realValues[Instance.ATT_NONDEF][i]);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase Attribute.REAL:\r\n\t\t\t\t\tSystem.out.print(realValues[Instance.ATT_NONDEF][i]);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.print(\" \");\r\n\t\t}\r\n\t}", "void display()\r\n\t {\n\t System.out.println(\"a = \" + a + \" b = \" + b);\r\n\t }", "public String toString() {\r\n return this.variable;\r\n }", "private void genDebugDumpValue(PrintWriter writer, String varName, String tabs) {\n genDebug(writer, tabs + \"std::cout << \\\"\" + varName + \" = \\\" << \" + varName + \" << std::endl;\");\n }", "@Override\n \tpublic void logVarUsed(String var) {\n \t\tSystem.out.println(\"\\tVariable used: \" + var);\n \t}", "void dump() {\n\t\tSystem.out.print(\"I am: \" + (territoryID));\n\t\tSystem.out.print(\"\\tNeighbour of:\");\n\n\t}", "private static void Display()\n\t{\n\t\tStringBuilder memoryValues = new StringBuilder();\n\t\tSystem.out.println(\"\\nPipleline Stages: \");\n\t\tif (stages.get(\"F\") != null)\n\t\t\tSystem.out.println(\"--------Fetch-----------> \" + stages.get(\"F\").getContent());\n\t\tif (stages.get(\"D\") != null)\n\t\t\tSystem.out.println(\"--------Decode----------> \" + stages.get(\"D\").getContent());\n\t\tif (stages.get(\"E\") != null)\n\t\t\tSystem.out.println(\"--------Execution1------> \" + stages.get(\"E\").getContent());\n\t\tif (stages.get(\"E2\") != null)\n\t\t\tSystem.out.println(\"--------Execution2------> \" + stages.get(\"E2\").getContent());\n\t\tif (stages.get(\"B1\") != null)\n\t\t\tSystem.out.println(\"--------Branch----------> \" + stages.get(\"B1\").getContent());\n\t\tif (stages.get(\"Dly\") != null)\n\t\t\tSystem.out.println(\"--------Delay-----------> \" + stages.get(\"Dly\").getContent());\n\t\tif (stages.get(\"M\") != null)\n\t\t\tSystem.out.println(\"--------Memory----------> \" + stages.get(\"M\").getContent());\n\t\tif (stages.get(\"W\") != null)\n\t\t\tSystem.out.println(\"--------Writeback-------> \" + stages.get(\"W\").getContent());\n\n\t\tSystem.out.println(\"\\nRegister File Details: \\n\");\n\t\tfor (Entry<String, Integer> register : registerFile.entrySet())\n\t\t{\n\t\t\tSystem.out.print(register.getKey() + \" : \" + register.getValue() + \"|\\t|\");\n\t\t}\n\t\tSystem.out.println(\"Special Register X:\" + specialRegister);\n\t\tSystem.out.println(\"\\n0 to 99 Memory Address Details: \");\n\t\tfor (int i = 0; i < 100; i++)\n\t\t{\n\t\t\tmemoryValues.append(\" [\" + i + \" - \" + memoryBlocks[i] + \"] \");\n\t\t\tif (i > 0 && i % 10 == 0)\n\t\t\t\tmemoryValues.append(\"\\n\");\n\t\t}\n\t\tSystem.out.println(memoryValues);\n\n\t}", "public String toString() {\n StringBuilder sb = new StringBuilder();\n\n sb.append(super.toString());\n sb.append(this.locals.toString());\n sb.append(\"At: \" + this.stage + \"stage\\n\");\n\n return sb.toString();\n }", "public void display() {\n\tSystem.out.println(\"student id is \"+studentid+\"\\t\"+\"student name is \"+studentName+\"\\t\"+\"marks is \"+marks);\r\n}", "public void print(){\r\n\r\n\r\n System.out.println(\"File: \" + file.getName());\r\n Set<String> keys = getDataMap().keySet();\r\n System.out.println(\"Die Variablen in diesem File: \" + keys);\r\n System.out.println(\"Geben Sie eine Variable an: \");\r\n\r\n Scanner wert = new Scanner(System.in);\r\n String wert1 = wert.nextLine();\r\n\r\n DataContainer dc = getDataMap().get(wert1);\r\n\r\n if (dc != null) {\r\n System.out.println(wert1 + \":\" + dc.getValues());\r\n }\r\n /*System.out.println(\"File: \" + file.getName());\r\n\r\n\r\n if (dc1 != null && dc2 != null) {\r\n System.out.println(dc1.getVariableName() + \": \" + dc1.getValues());\r\n System.out.println(dc2.getVariableName() + \": \" + dc2.getValues());*/\r\n }", "public void display() {\n\t\tSystem.out.println(x + \" \" + y + \" \" + z);\n\t}", "private static void dbg(Object... objects) {\n\t\tSystem.out.println(Arrays.deepToString(objects));\r\n\t}", "public void printInfo(){\n\t}", "public void printInfo(){\n\t}", "public void printInfo() {\r\n System.out.printf(\"%-25s\", \"Nomor Rekam Medis Pasien\");\r\n System.out.println(\": \" + getNomorRekamMedis());\r\n System.out.printf(\"%-25s\", \"Nama Pasien\");\r\n System.out.println(\": \" + getNama());\r\n System.out.printf(\"%-25s\", \"Tempat, Tanggal Lahir\");\r\n System.out.print(\": \" + getTempatLahir() + \" , \");\r\n getTanggalKelahiran();\r\n System.out.printf(\"%-25s\", \"Alamat\");\r\n System.out.println(\": \" + getAlamat());\r\n System.out.println(\"\");\r\n }", "public void PrintMe()\n\t{\n\t\t/**************************************/\n\t\t/* AST NODE TYPE = AST CFIELD_VARDEC */\n\t\t/**************************************/\n\t\tSystem.out.print(\"AST NODE CFIELD VAR DEC\\n\");\n\n\t\t/*************************************/\n\t\t/* RECURSIVELY PRINT HEAD + TAIL ... */\n\t\t/*************************************/\n\t\tif (vardec != null) vardec.PrintMe();\n\n\t\t/**********************************/\n\t\t/* PRINT to AST GRAPHVIZ DOT file */\n\t\t/**********************************/\n\t\tAST_GRAPHVIZ.getInstance().logNode(\n\t\t\tSerialNumber,\n\t\t\t\"CFIELD\\nVAR DEC\\n\");\n\t\t\n\t\t/****************************************/\n\t\t/* PRINT Edges to AST GRAPHVIZ DOT file */\n\t\t/****************************************/\n\t\tif (vardec != null) AST_GRAPHVIZ.getInstance().logEdge(SerialNumber,vardec.SerialNumber);\n\t}", "public void showSamples(){\n\t\tfor(int i=0; i<arrIns.size(); i++){\n\t\t\tfor(int j=0; j<arrIns.get(i).numAttributes(); j++){\n\t\t\t\tSystem.out.print(\" | \" + arrIns.get(i).value(j) + \" | \");\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}", "void getInfo() {\n\tSystem.out.println(\"My name is \"+name+\" and I am going to \"+school+\" and my grade is \"+grade);\n\t}", "public void printValues(){\r\n\r\n for(String key : values.keySet()){\r\n String value = values.get(key).toString();\r\n System.out.println(key + \" = \" + value);\r\n }\r\n\r\n }", "protected void dumpStats() {\n\t\t// Print the header.\n\t\tSystem.out.println(\"\\n\"+phCode+\" \"+minDelta+\" \"+maxDelta);\n\t\t\n\t\t// Print the data.\n\t\tSystem.out.println(\"Bias:\");\n\t\tfor(int j=0; j<bias.size(); j++) {\n\t\t\tSystem.out.format(\" %3d range = %6.2f, %6.2f fit = %11.4e, \"+\n\t\t\t\t\t\"%11.4e\\n\",j,bias.get(j).minDelta,bias.get(j).maxDelta,\n\t\t\t\t\tbias.get(j).slope,bias.get(j).offset);\n\t\t}\n\t\tSystem.out.println(\"Spread:\");\n\t\tfor(int j=0; j<spread.size(); j++) {\n\t\t\tSystem.out.format(\" %3d range = %6.2f, %6.2f fit = %11.4e, \"+\n\t\t\t\t\t\"%11.4e\\n\",j,spread.get(j).minDelta,spread.get(j).maxDelta,\n\t\t\t\t\tspread.get(j).slope,spread.get(j).offset);\n\t\t}\n\t\tSystem.out.println(\"Observability:\");\n\t\tfor(int j=0; j<observ.size(); j++) {\n\t\t\tSystem.out.format(\" %3d range = %6.2f, %6.2f fit = %11.4e, \"+\n\t\t\t\t\t\"%11.4e\\n\",j,observ.get(j).minDelta,observ.get(j).maxDelta,\n\t\t\t\t\tobserv.get(j).slope,observ.get(j).offset);\n\t\t}\n\t}", "public void info()\n {\n System.out.println(toString());\n }", "public void printAnalysis(){\n System.out.println(\"Product: \" + this.getName());\n System.out.println(\"History: \" + this.history());\n System.out.println(\"Largest amount of product: \" + this.inventoryHistory.maxValue());\n System.out.println(\"Smallest amount of product: \" + this.inventoryHistory.minValue());\n System.out.println(\"Average: \" + this.inventoryHistory.average());\n }", "void display(){\n System.out.println(\"Name:\"+name);\n System.out.println(\"Age:\"+age);\n System.out.println(\"Faculty:\"+faculty);\n System.out.println(\"Department:\"+department);\n System.out.println(\"IsHandicapped:\"+isHandicapped);\n }", "public void printInfo() {\n\t\tString nodeType = \"\";\n\t\tif (nextLayerNodes.size() == 0) {\n\t\t\tnodeType = \"Output Node\";\n\t\t} else if (prevLayerNodes.size() == 0) {\n\t\t\tnodeType = \"Input Node\";\n\t\t} else {\n\t\t\tnodeType = \"Hidden Node\";\n\t\t}\n\t\tSystem.out.printf(\"%n-----Node Values %s-----%n\", nodeType);\n\t\tSystem.out.printf(\"\tNumber of nodes in next layer: %d%n\", nextLayerNodes.size());\n\t\tSystem.out.printf(\"\tNumber of nodes in prev layer: %d%n\", prevLayerNodes.size());\n\t\tSystem.out.printf(\"\tNext Layer Node Weights:%n\");\n\t\tNode[] nextLayer = new Node[nextLayerNodes.keySet().toArray().length];\n\t\tfor (int i = 0; i < nextLayer.length; i++) {\n\t\t\tnextLayer[i] = (Node) nextLayerNodes.keySet().toArray()[i];\n\t\t}\n\t\tfor (int i = 0; i < nextLayerNodes.size(); i++) {\n\t\t\tSystem.out.printf(\"\t\t# %f%n\", nextLayerNodes.get(nextLayer[i]));\n\t\t}\n\t\tSystem.out.printf(\"%n\tPartial err partial out = %f%n%n\", getPartialErrPartialOut());\n\t}", "public void showAssignments(){\n\t\tIterator it = this.clauses.iterator();\n\t\tint numVar = this.getVocabulary().getMaxVariableId();\n\t\tint[] assign = new int[numVar*2+1]; \n\n\t\twhile (it.hasNext()) {\n\t\t\tSystem.out.println(\"___________________________\");\n IClause cl = (IClause) it.next();\n Iterator litIterator = cl.literalIterator();\n while (litIterator.hasNext()){\n \tILiteral lit = (ILiteral) litIterator.next();\n \tint idx = lit.getId();\n \tif (idx<0) \n \t\tidx = numVar - idx;\n \tassign[idx] = lit.value();\n }\n }\n\t\t\n\t\tfor (int i=1;i<assign.length;i++){\n\t\t\tint k = i;\n\t\t\tif (i>numVar)\n\t\t\t\tk = numVar - i;\n\t\t\tSystem.out.print(k + \"|\" + assign[i] + \";\");\n\t\t}\n\t\tSystem.out.println();\n\t}", "public void regDump() {\r\n\t\t// Print each available register (id) and its value\r\n\t\tfor (int i = 0; i < NUMGENREG; i++) {\r\n\t\t\tSystem.out.print(\"r\" + i + \"=\" + m_registers[i] + \" \");\r\n\t\t}// for\r\n\t\t\r\n\t\t// Removed unnecessary concatenation\r\n\t\tSystem.out.print(\"PC=\" + getPC());\r\n\t\tSystem.out.print(\" SP=\" + getSP());\r\n\t\tSystem.out.print(\" BASE=\" + getBASE());\r\n\t\tSystem.out.print(\" LIM=\" + getLIM());\r\n\t\tSystem.out.println(\"\");\r\n\t}", "void display() {\n System.out.println(id + \" \" + name + \" \" + age);\n }", "public void inventoryPrint() {\n System.out.println(\"Artifact Name: \" + name);\r\n System.out.println(\"Desc:\" + description);\r\n System.out.println(\"Value: \" + value);\r\n System.out.println(\"Mobility: \" + mobility); \r\n }", "void dump_stacks(int count)\n {\n int i;\n System.out.println(\"=index==state====value= s:\"+stateptr+\" v:\"+valptr);\n for (i=0;i<count;i++)\n System.out.println(\" \"+i+\" \"+statestk[i]+\" \"+valstk[i]);\n System.out.println(\"======================\");\n }", "public void printRoutine()\n\t{\n\t\tfor (String name: vertices.keySet())\n\t\t{\n\t\t\tString value = vertices.get(name).toString();\n\t\t\tSystem.out.println(value);\n\t\t}\n\t}", "public void dump()\n {\n System.out.println(toString());\n }", "private void cmdInfoVars() throws NoSystemException {\n MSystem system = system();\n \n System.out.print(system.getVariableEnvironment());\n }", "public static void printInfo(){\n }", "public void print(){\n System.out.println(\"(\"+a.getAbsis()+\"_a,\"+a.getOrdinat()+\"_a)\");\n System.out.println(\"(\"+b.getAbsis()+\"_b,\"+b.getOrdinat()+\"_b)\");\n System.out.println(\"(\"+c.getAbsis()+\"_b,\"+c.getOrdinat()+\"_c)\");\n }", "public void printInfo(){\n\t\tSystem.out.println(\"id : \" + id + \" label : \" + label);\n\t\tSystem.out.println(\"vms : \" );\n\t\tfor(VirtualMachine v : vms){\n\t\t\tv.printInfo();\n\t\t}\n\t}", "private static void displayDebugInfo() {\n showDeckInfo();\n showPlayerDeckInfo();\n showMatchedDeckInfo();\n\n// for(int i = 0; i< playerDeck.size(); i++) {\n// //system.out.println(\"Card Value:\" + GameDeck.getCardValue(playerDeck.get(i)));\n// //system.out.println(\"Card Id:\" + GameDeck.getCardId(playerDeck.get(i))); //syntax for accessing the card id\n// //system.out.println(\"Card Suit:\" + GameDeck.getCardSuit(playerDeck.get(i))); //syntax for accessing the card suit\n// //system.out.println(\"Card Name:\" + GameDeck.getCardName(playerDeck.get(i))); //syntax for accessing the card name\n// //system.out.println(\"Card Color:\" + GameDeck.getCardColor(playerDeck.get(i)));\n// }\n// //system.out.println(\"Pattern Length:\" + patterns.length);\n }", "public static String traceCpuEnvironment() {\r\n\r\n StringWriter sw = new StringWriter();\r\n PrintWriter pw = new PrintWriter(sw);\r\n pw.println(\"General information: \");\r\n\r\n Properties p = System.getProperties();\r\n\r\n String[] split = p.toString().split(\",\");\r\n\r\n for (String string : split) {\r\n pw.println(string);\r\n }\r\n\r\n return sw.toString();\r\n }", "public String print() {\n\t\tString offID = getID();\n\t\tString offName = getName();\n\t\tint offAge = getAge();\n\t\tString offState = getState();\n\t\tString data = String.format(\"ID: %-15s \\t Name: %-35s \\t Age: %-15s \\t State: %s\", offID, offName, offAge, offState);\n\t\treturn data;\n\t}", "public java.lang.String toDebugString () { throw new RuntimeException(); }", "private void printStats()\n\t{\n\t\t// X\n\t\tSystem.out.println(\"X:\");\n\t\tfor(int i = 0; i < xPosList.size(); i++)\n\t\t{\n\t\t\tSystem.out.println(xPosList.get(i));\n\t\t}\n\n\t\t// Y\n\t\tSystem.out.println(\"Y:\");\n\t\tfor(int i = 0; i < yPosList.size(); i++)\n\t\t{\n\t\t\tSystem.out.println(yPosList.get(i));\n\t\t}\n\n\t\t// Time\n\t\tSystem.out.println(\"Time:\");\n\t\tfor(int i = 0; i < timeList.size(); i++)\n\t\t{\n\t\t\tSystem.out.println(timeList.get(i));\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tint a,b=4,c;\n\t\ta =1;\n\t\tc=11;\n\t\tSystem.out.printf(\"variable a is %d b is %d and c %d\\n\",a,b,c);\n\t}", "public static void show_local() {\n\n\t}", "public void dump(String prefix) {\n\t\tSystem.out.println(prefix+\"Stats \"+hp+\",\"+mp+\",\"+age+\",\"+exp);\n\t}", "public String getVals(){\n return (\"a: \" + a + \"\\nr: \" + r + \"\\nb: \" + b + \"\\ng: \" + g);\n }", "public void printCountersAndDiagnostics() {\n\t\tSystem.out.println(\"Node \" + myAssignedID + \"::\" + \"\\t\" + \"Sent\" + \"\\t\"\n\t\t\t\t+ \"Rec'd\" + \"\\t\" + \"Relayed\" + \"\\t\" + \"SumSent\" + \"\\t\"\n\t\t\t\t+ \"SumRecd\");\n\t\tSystem.out.println(\"\\t\\t\" + this.sendTracker + \"\\t\"\n\t\t\t\t+ this.receiveTracker + \"\\t\" + this.relayTracker + \"\\t\"\n\t\t\t\t+ this.sendSummation + \"\\t\" + this.receiveSummation);\n\t}", "public void PrintMe()\r\n\t{\r\n\t\t/********************************************/\r\n\t\t/* AST NODE TYPE = AST VAR.PARAM_FUNC EXPRESSION */\r\n\t\t/********************************************/\r\n\t\tSystem.out.print(\"AST NODE VAR.PARAM_FUNC EXPRESSION \\n\");\r\n\r\n\t\t/***********************************/\r\n\t\t/* RECURSIVELY PRINT var + expList ... */\r\n\t\t/***********************************/\r\n\t\tif (var != null) var.PrintMe();\r\n//\t\tif (expList != null) expList.PrintMe();\r\n\r\n\t\t/***************************************/\r\n\t\t/* PRINT Node to AST GRAPHVIZ DOT file */\r\n\t\t/***************************************/\r\n\t\tAST_GRAPHVIZ.getInstance().logNode(\r\n\t\t\tSerialNumber,\r\n\t\t\tString.format(\"EXP VAR PARAM FUNC\\n()%S\", name));\r\n\t\t\r\n\t\t/****************************************/\r\n\t\t/* PRINT Edges to AST GRAPHVIZ DOT file */\r\n\t\t/****************************************/\r\n\t\tAST_GRAPHVIZ.getInstance().logEdge(SerialNumber,var.SerialNumber);\r\n//\t\tAST_GRAPHVIZ.getInstance().logEdge(SerialNumber,expList.SerialNumber);\r\n\t}", "public void printDetails() {\r\n\t\tSystem.out.println(\" \");\r\n\t\tSystem.out.println(showtimeId + \" \" + movie.getTitle() + \" starts at \" + startTime.toString());\r\n\t}", "public String print(){\r\n\t\treturn String.format(\"%9d\\t%-5s\\t\\t%-3d\\t\\t%-15s\",\r\n\t\t\t\tthis.trackNumber, \r\n\t\t\t\tthis.engineNumber, \r\n\t\t\t\tthis.numRailCars, \r\n\t\t\t\tthis.destCity);\r\n\t\t}", "@Override\n\tpublic void display() {\n\t\tDexUtil qualifiedName = new DexUtil();\n\t\tsuper.display();\n\t\n\t\tint dest = ((OneRegisterInstruction) instruction).getRegisterA();\n\t FieldReference f = (FieldReference) ((ReferenceInstruction) instruction).getReference();\n\t \n\t String name= qualifiedName.getQualifiedName(f.getDefiningClass())+\".\"+qualifiedName.getQualifiedName(f.getName());\n\t String type= qualifiedName.getQualifiedName(f.getType());\n\t \n\t \n\t Variable variable=new Variable(null, 0, 0, 0, 0);\n\t \n\t variable.setName(name);\n\t variable.setType(type);\n\t DexMethodDefinition.registerLocals[dest]=variable;\n\t System.out.println(variable.getName());\n\t \n\t}", "public void display()\n\t{\n\t\tSystem.out.println(data+\" \");\n\t}", "void display() {\r\n\t\tSystem.out.println(id + \" \" + name);\r\n\t}", "void printInfo();", "public String toString(){return \"(X\" + variable + \" (\"+ zero + \")\" + \" (\" + one +\"))\";}", "private void printMap() {\n\t\tfor(Integer key: location.keySet()){\n\t\t\tString val= location.get(key).toString();\n\t\t\tSystem.out.println(\"(\" + key.toString() + \", \" + val+ \")\");\n\t\t}\n\t}", "private static void showvalue(int n) {\n\t\tSystem.out.println(\"n is\"+ n);\r\n\t}", "void printincomingLobs()\n {\n printloadDetails(iIncomingLobs.getLoadDetails());\n printload(iIncomingLobs.getLoad(0));\n printtotal(iIncomingLobs.getTotal());\n }", "@Override\n public String getTrace() {\n return trace;\n }", "public void show() {\n\n System.out.println(a);\n System.out.println(b);\n System.out.println(c);\n System.out.println(\"In a nested class method\");\n }", "void dump()\n\t\t{\n\t\t\tlog.info(\"Ch # \"+ch+\" Mode=\"+Hex.formatByte(mode)+\" Base=\"+Hex.formatWord(base.getValue())+\" Count=\"+Hex.formatWord(count.getValue()));\n\t\t\tlog.info(\"Ch # \"+ch+\" Hold=\"+hold+\" Request=\"+request+\" TC=\"+tc+\" Enabled=\"+enabled+\" Mask=\"+mask);\n\t\t}" ]
[ "0.76579076", "0.70802784", "0.69276536", "0.6867682", "0.6580172", "0.64711", "0.6459355", "0.6434381", "0.63780487", "0.6356905", "0.633795", "0.62702554", "0.6269726", "0.62428904", "0.6210993", "0.6188652", "0.6177139", "0.6167727", "0.6167158", "0.6156252", "0.614393", "0.61327434", "0.6129346", "0.6116726", "0.60932434", "0.6087316", "0.6083771", "0.6083222", "0.60818195", "0.60737133", "0.6072936", "0.606563", "0.60634536", "0.6061126", "0.60529095", "0.60378206", "0.6036059", "0.60337377", "0.6025618", "0.6012367", "0.6009715", "0.60069126", "0.5990375", "0.59857816", "0.5972855", "0.59665644", "0.5955753", "0.5951406", "0.5937904", "0.593219", "0.592992", "0.5927235", "0.5925739", "0.5916564", "0.59134346", "0.59134346", "0.590491", "0.5896058", "0.58909607", "0.5874978", "0.5862948", "0.5858069", "0.58440685", "0.58402663", "0.5834025", "0.58315367", "0.58241135", "0.5822283", "0.5812302", "0.58118314", "0.58073217", "0.58049035", "0.5798208", "0.5787294", "0.5777411", "0.5771757", "0.5766602", "0.5761009", "0.57535505", "0.5750653", "0.57503897", "0.5747614", "0.5735807", "0.573541", "0.5729741", "0.57263124", "0.5725734", "0.5723969", "0.57209516", "0.5718839", "0.57177603", "0.5711738", "0.57107395", "0.57099116", "0.57094467", "0.57066864", "0.57038647", "0.57013124", "0.5700165", "0.5697189", "0.5695418" ]
0.0
-1
////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////for trace purposes display all rules in text format
public void displayRules(TextArea textArea) { textArea.appendText("\n" + name + " Rule Base: " + "\n"); Enumeration enum2 = ruleList.elements() ; while(enum2.hasMoreElements()) { Rule temp = (Rule)enum2.nextElement() ; temp.display(textArea) ; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String rulesAsText();", "public static void printRules(Rule[] rules) {\n System.out.println(\"\\nRulebase generated\\n------------------\");\n int i =1;\n for (Rule rule : rules) {\n String cond = \"\";\n for (int j = 0; j < rule.cond.length; j++) {\n cond = cond + rule.cond[j];\n }\n String output = rule.output;\n System.out.println(\"Rule\" + i + \" : \" + cond + \" = \" + output);\n i++;\n }\n System.out.println(\"\\n\");\n }", "public void showRules(Application app){\n System.out.println(\"Here are your rules: \\n • GPA >= \" + app.getStand().getReqGPA() + \"\\n • SAT >= \" + app.getStand().getReqSAT() + \"\\n • A valid intended major, either aligned towards STEM or Humanities.\" + \"\\n • Three valid extracurriculars. \\n \\t • A valid extracurricular is defined as a productive use of time and/or a standout accomplishment. \\n \\t • It must align with the student's STEM or Humanities focus. \\n \\t • All three extracurriculars must be valid. \\n • A statement of purpose without spelling errors.\");\n System.out.println(\" • Students admitted to Harvard must have a passion for Humanities. Students admitted to MIT must have a passion for STEM. This can be determined through their intended major and extracurriculars, assuming both are valid.\");\n System.out.println(\" • All students with errors in their applications should be admitted to Greendale Community College.\");\n System.out.println();\n System.out.println(\"Good luck!\");\n }", "public void printRule()\n {\n System.out.print(lhs + \" ::= \");\n for( String s : rhsSymbols)\n System.out.print(s + \" \");\n System.out.println();\n }", "public void printRules () {\n \n System.out.println(\"PRINTING RULESET ID : \" + this.id + \" (\" + this.size() + \") entries.\");\n for (int i = 0; i < this.size(); i++) {\n \n System.out.println(\"Rule \" + (i+1) + \" (ID \" + references.get(i) + \") : \" + this.rulelist.getRuleByID(references.get(i)) + \" Prob : \" + this.rulelist.getRuleByID(references.get(i)).getProb() + \" TIMES \" + this.rulelist.getRuleByID(references.get(i)).occurrencies + \" PREC \" + this.rulelist.getRuleByID(references.get(i)).prec_occurrencies);\n }\n System.out.println(\"Total Prob : \" + this.totalProb);\n System.out.println(\"Precedences : \" + this.precedences);\n }", "public String toString(){\r\n\t\treturn \"This email passes \"+rulesPassed+\" rules\";\r\n\t}", "public String toString() {\n\n if (m_rules == null) {\n return \"Prism: No model built yet.\";\n }\n return \"Prism rules\\n----------\\n\" + m_rules.toString();\n }", "String getRules();", "public String toString()\n/* */ {\n/* 885 */ StringBuilder result = new StringBuilder();\n/* 886 */ for (int i = 0; i < this.ruleSets.length; i++) {\n/* 887 */ result.append(this.ruleSets[i].toString());\n/* */ }\n/* 889 */ return result.toString();\n/* */ }", "public String toDebugString(RuleSet rs){\n\t\tString res = \"\";\n\t\tif(body != null)\n\t\t\tfor(Integer e : body){\n\t\t\t\tres = res + (res.equals(\"\") ? \"\" : \" & \") + OWLPrinter.getString(rs.debugLookup(e));\n\t\t\t}\n\n\t\tres += \" -> \";\n\t\tif(head != null) res += OWLPrinter.getString(rs.debugLookup(head));\n\t\telse{\n\t\t\tres += OWLPrinter.getString(rs.debugLookup(axiom));\n\t\t\tif(define != null){\n\t\t\t\tres += \" def \" + OWLPrinter.getString(rs.debugLookup(define));\n\t\t\t}\n\t\t}\n\n\t\t//if(head instanceof OWLAxiom) \tres += \" -> \" + ClassPrinter.printAxiom((OWLAxiom) head);\n\t\t//else \t\t\t\t\t\t\tres += \" -> \" + ClassPrinter.printClass(head);\n\t\treturn res;\n\t}", "public void dumpRules()\n\t{\n\t\tif(chain == null)\n\t\t\treturn;\n\t\t\n\t\tIterator it = chain.keySet().iterator();\n\t\tIterator subIt = null;\n\t\t\n\t\tString key = null;\n\t\twhile(it.hasNext())\n\t\t{\n\t\t\tkey = (String)it.next();\n\t\t\tSystem.out.print(key + \" --> \");\n\t\t\t\n\t\t\tsubIt = (chain.get(key)).iterator();\n\t\t\t\n\t\t\twhile(subIt.hasNext())\n\t\t\t\tSystem.out.print(subIt.next() + \", \");\n\t\t\t\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public String toString() {\n return this.grammarRules.keySet() + \"\";\n\t}", "@Override\n\tpublic String toString() {\n\t\t\n\t\treturn \"Standard Text Analyse\";\n\t}", "public void printRules_RVLR () {\n \n System.out.println(\"PRINTING RULESET ID : \" + this.id + \" (\" + this.size() + \") entries.\");\n for (int i = 0; i < this.size(); i++) {\n \n System.out.println(\"Rule \" + (i+1) + \" (ID \" + references.get(i) + \") : \" + this.rulelist.getRuleByID(references.get(i)) + \" Prob : \" + this.rulelist.getRuleByID(references.get(i)).getProb() + \" TIMES \" + this.rulelist.getRuleByID(references.get(i)).occurrencies + \" PREC \" + this.rulelist.getRuleByID(references.get(i)).prec_occurrencies + \" Value : \" + this.rulelist.getRuleByID(references.get(i)).get_RVRL());\n }\n System.out.println(\"Total Prob : \" + this.totalProb);\n //System.out.println(\"Precedences : \" + this.precedences);\n }", "@Override\n public String toString() {\n if (tree != null) {\n\n String s = tree.render();\n\n s += \"\\n\\nNumber of positive rules: \"\n + getMeasure(\"measureNumPositiveRules\") + \"\\n\";\n s += \"Number of conditions in positive rules: \"\n + getMeasure(\"measureNumConditionsInPositiveRules\") + \"\\n\";\n\n return s;\n } else {\n return \"No model built yet!\";\n }\n }", "private String getRulesOfBestSolutionAsHumanReadableString() {\n\t\t// TODO change this to actually save the text in a file, and maybe in a cleaner format...\n\t\tIndividual bestSolution = this.controller.getBestSolution();\n\t\t\n\t\tVector<Rule> bestSolutionRules = bestSolution.getRules();\n\n\t\tString humanReadableRulesOfBestSolution = \"Add element to summary if (\";\n\t\tfor (int i = 0; i < bestSolutionRules.size(); i++) {\n\t\t\thumanReadableRulesOfBestSolution += \" ( \"; \n\t\t\tint j = 0;\n\t\t\tfor (Entry<String, Integer> entry : bestSolutionRules.get(i).getThresholds().entrySet()) {\n\t\t\t\t\n\t\t\t\thumanReadableRulesOfBestSolution += entry.getKey() + \" > \" + entry.getValue();\n\t\t\t\tString logicalConnector = ( j < bestSolutionRules.get(i).getAndBetweens().size() ? (bestSolutionRules.get(i).getAndBetweens().get(j) ? \" && \" : \" OR \") : (\"\"));\n\t\t\t\thumanReadableRulesOfBestSolution += logicalConnector;\n\t\t\t\tj++;\n\t\t\t}\n\t\t\thumanReadableRulesOfBestSolution += \" )\";\n\t\t\tif ( bestSolutionRules.size() - 1 > i ) {\n\t\t\t\thumanReadableRulesOfBestSolution += \" || \"; \n\t\t\t}\n\t\t}\n\t\thumanReadableRulesOfBestSolution += \")\\n\";\n\t\t\n\t\treturn humanReadableRulesOfBestSolution;\n\t}", "@Override\n public String toString() {\n StringBuilder sb = new StringBuilder();\n sb.append(\"{\");\n if (getRuleVariables() != null)\n sb.append(\"RuleVariables: \").append(getRuleVariables());\n sb.append(\"}\");\n return sb.toString();\n }", "private String toRules(){\n\n if (numInstances() == 0)\n\treturn \"No Rules (Empty Exemplar)\";\n\n String s = \"\", sep = \"\";\n\t\n for(int i = 0; i < numAttributes(); i++){\n\t \n\tif(i == classIndex())\n\t continue;\n\t \n\tif(attribute(i).isNumeric()){\n\t if(m_MaxBorder[i] != m_MinBorder[i]){\n\t s += sep + m_MinBorder[i] + \"<=\" + attribute(i).name() + \"<=\" + m_MaxBorder[i];\n\t } else {\n\t s += sep + attribute(i).name() + \"=\" + m_MaxBorder[i];\n\t }\n\t sep = \" ^ \";\n\t \n\t} else {\n\t s += sep + attribute(i).name() + \" in {\";\n\t String virg = \"\";\n\t for(int j = 0; j < attribute(i).numValues() + 1; j++){\n\t if(m_Range[i][j]){\n\t s+= virg;\n\t if(j == attribute(i).numValues())\n\t\ts += \"?\";\n\t else\n\t\ts += attribute(i).value(j);\n\t virg = \",\";\n\t }\n\t }\n\t s+=\"}\";\n\t sep = \" ^ \";\n\t}\t \n }\n s += \" (\"+numInstances() +\")\";\n return s;\n }", "java.lang.String getRule();", "public String toString(){\n\t\tStringBuffer buffer = new StringBuffer();\n\t\t\n\t\tbuffer.append(lhs);\n\t\tbuffer.append(\" -> \");\n\t\t\n\t\t// if this is a lexical rule, prefix it with the lexical symbol\n\t\tif( lexical ){\n\t\t\tbuffer.append(LEXICAL_PREFIX);\n\t\t}\n\t\t\n\t\tfor( String s: rhs ){\n\t\t\tbuffer.append(s + \" \");\n\t\t}\n\t\t\n\t\t// delete the trailing whitespace\n\t\tbuffer.deleteCharAt(buffer.length()-1);\n\t\t\n\t\tbuffer.append(\"\\t\\t\" + weight);\n\t\t\n\t\treturn buffer.toString();\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn this.ruleController.toString();\n\t}", "public String toString()\n\t\t{\n\t\t\tsynchronized(ExecutionPolicy.class)\n\t\t\t{\n\t\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\t\ttoStringIndent++;\n\t\t\t\tif (rules == null) sb.append(indent()).append(\"null\\n\");\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tfor (ExecutionPolicy ep: rules) sb.append(ep.toString());\n\t\t\t\t}\n\t\t\t\ttoStringIndent--;\n\t\t\t\treturn sb.toString();\n\t\t\t}\n\t\t}", "private void explore(RuleContext ctx) {\n if (ctx.getChildCount() != 1) {\n String ruleName = Python3Parser.ruleNames[ctx.getRuleIndex()];\n astRepresenation.append(ruleName);\n astRepresenation.append(\": \");\n astRepresenation.append(ctx.getText());\n astRepresenation.append(\"\\n\");\n }\n for (int i = 0; i < ctx.getChildCount(); i++) {\n ParseTree element = ctx.getChild(i);\n if (element instanceof RuleContext) {\n explore((RuleContext) element);\n }\n }\n }", "@Override\r\n public String toString() {\r\n return this.bnfRuleMap.keySet().toString();\r\n }", "String diagnosticsOutput();", "public String toString() {\n\t\treturn \"Analysis using the following analyzer:\\n\"\n\t\t\t\t+ _analyzer.toString();\n\t}", "String toString(boolean legend) {\n Formatter out = new Formatter();\n if (!legend) {\n for (char i = '5'; i >= '1'; i = (char) (i - 1)) {\n out.format(\" \");\n for (char j = 'a'; j <= 'e'; j = (char) (j + 1)) {\n out.format(\" \");\n out.format(\"%s\", get(j, i).shortName());\n }\n if (i != '1') {\n out.format(\"%n\");\n }\n }\n } else {\n if (legend) {\n int s = SIDE;\n for (char i = '5'; i >= '1'; i = (char) (i - 1)) {\n out.format(\"%s \", i);\n for (char j = 'a'; j <= 'e'; j = (char) (j + 1)) {\n out.format(\" \");\n out.format(\"%s\", get(j, i).shortName());\n }\n if (i != '1') {\n out.format(\"%n\");\n }\n }\n out.format(\" a b c d e\");\n }\n }\n return out.toString();\n }", "@Override\r\n public final void toStringBuilder(final StringBuilder sb) {\r\n Rule[] r;\r\n int i;\r\n\r\n r = this.m_rules;\r\n for (i = 0; i < r.length; i++) {\r\n if (i > 0)\r\n sb.append(TextUtils.LINE_SEPARATOR);\r\n r[i].toStringBuilder(sb);\r\n }\r\n }", "public java.lang.String GetRules() throws IOException {\r\n java.lang.String RulesString = new java.lang.String();\r\n Scanner scanner = new Scanner(new FileInputStream(RulesFile), \"UTF-8\");\r\n while (scanner.hasNextLine()) {\r\n RulesString = RulesString + scanner.nextLine() + \"\\n\";\r\n }\r\n return RulesString;\r\n }", "@Override\n public String toString() {\n return String.format(\"MyCustomRule[shouldIfail=%b]\", shouldIfail);\n }", "@Override\n public String toString() {\n return super.toString() + \" --> \" + getCorrectedText();\n }", "public static void printRule() {\n int counter = 0;\n\n System.out.print(\" Welcome to Tic Tac Toe Number\");\n\n System.out.println(\n \"\\n\\t -------------\"\n + \"\\n\\t | T | T | T |\"\n + \"\\n\\t -------------\"\n + \"\\n\\t | N | U | M |\"\n + \"\\n\\t -------------\"\n + \"\\n\\t | B | E | R |\"\n + \"\\n\\t -------------\");\n\n System.out.println(\"Rules: \"\n + \"\\n\" + ++counter + \". Enter an amount of players, 1 or 2.\"\n + \"\\n\" + ++counter + \". If you play with the Computer, enter 1 player, it will always play Odd number.\"\n + \"\\n\" + ++counter + \". The players, Odd and Even, take turn filling a cell with their numbers.\"\n + \"\\n\" + ++counter + \". The ODD number player goes FIRST by selecting a row and a column [1, 2, or 3],\"\n + \"\\n\" + \" then an odd number [1, 3, 5, 7, or 9].\"\n + \"\\n\" + ++counter + \". Follow by the EVEN number player doing the same thing,\"\n + \"\\n\" + \" except the set of even numbers is [2, 4, 6, and 8].\"\n + \"\\n\" + ++counter + \". Who reach the sum of \\\"\" + BINGO + \"\\\" in a row,\"\n + \"\\n\" + \" may be Vertical, Horizontal, or Diagonal, first will be a WINNER!\");\n }", "public void showRuleDescription() {\n PopUpAlerts.ruleDescription(gOL.getRuleName(), gOL.getRuleString(), gOL.getRuleDescription());\n }", "public static String explodeRulesAndCreateString(String rules)\n\t{\n\t\tGrammar grammar = new Grammar();\n\t\tList<IPattern> patterns = explodeRules(grammar, rules);\n\t\tStringBuilder str = new StringBuilder(100);\n\n\t\tboolean first = true;\n\t\tfor (IPattern pattern : patterns)\n\t\t{\n\t\t\tif (!first)\n\t\t\t{\n\t\t\t\tstr.append(\"\\n\");\n\t\t\t}\n\t\t\tstr.append(pattern.toString2(grammar));\n\t\t\tfirst = false;\n\t\t}\n\t\t\n\t\tif (debugFlag)\n\t\t{\n\t\t\tOut.print(str.toString());\n\t\t}\n\n\t\treturn str.toString();\n\t}", "@Override\n public String toString() {\n String isStudyAbroadTextRepresentation = (isStudyAbroad) ? \":study abroad\" : \"\";\n return String.format(\"%s:international%s\", super.toString(), isStudyAbroadTextRepresentation);\n }", "public void print()\n/* */ {\n/* 226 */ boolean emptyTarget = true;\n/* 227 */ Iterator it; if ((this.subjects != null) && (this.subjects.size() > 0)) {\n/* 228 */ System.out.println(\"\\nSubjects ---->\");\n/* 229 */ emptyTarget = false;\n/* 230 */ for (it = this.subjects.iterator(); it.hasNext();)\n/* 231 */ ((MatchList)it.next()).print();\n/* */ }\n/* 234 */ if ((this.resources != null) && (this.resources.size() > 0)) {\n/* 235 */ System.out.println((emptyTarget ? \"\\n\" : \"\") + \"Resources ---->\");\n/* 236 */ emptyTarget = false;\n/* 237 */ for (it = this.resources.iterator(); it.hasNext();)\n/* 238 */ ((MatchList)it.next()).print();\n/* */ }\n/* 241 */ if ((this.actions != null) && (this.actions.size() > 0)) {\n/* 242 */ System.out.println((emptyTarget ? \"\\n\" : \"\") + \"Actions ---->\");\n/* 243 */ emptyTarget = false;\n/* 244 */ for (it = this.actions.iterator(); it.hasNext();)\n/* 245 */ ((MatchList)it.next()).print();\n/* */ }\n/* 248 */ if ((this.environments != null) && (this.environments.size() > 0)) {\n/* 249 */ System.out.println((emptyTarget ? \"\\n\" : \"\") + \"Environments ---->\");\n/* 250 */ emptyTarget = false;\n/* 251 */ for (it = this.environments.iterator(); it.hasNext();) {\n/* 252 */ ((MatchList)it.next()).print();\n/* */ }\n/* */ }\n/* 255 */ if (emptyTarget) System.out.print(\"EMPTY\");\n/* */ }", "public String summary()\n {\n String summary = mName;\n \n if(isARuleBreaker())\n {\n summary += \" – \" + numberOfBrokenRules() + \" st regelbrott, \" + fineAmountOfBrokenRules() + \" kronor\";\n }\n else\n {\n summary += \" – INGA regelbrott!\";\n }\n \n return summary;\n }", "public void printTable() {\n\t\tString s = String.format(\"Routing table (%.3f)\\n\"\n\t\t\t\t+ \"%10s %10s %8s %5s %10s \\t path\\n\", now, \"prefix\", \n\t\t\t\t\"timestamp\", \"cost\",\"link\", \"VLD/INVLD\");\n\t\tfor (Route rte : rteTbl) {\n\t\t\ts += String.format(\"%10s %10.3f %8.3f\",\n\t\t\t\t\trte.pfx.toString(), rte.timestamp, rte.cost);\n\n\t\t\ts += String.format(\" %5d\", rte.outLink);\n\n\t\t\tif (rte.valid == true)\n\t\t\t\ts+= String.format(\" %10s\", \"valid\");\n\t\t\telse\n\t\t\t\ts+= String.format(\" %10s \\t\", \"invalid\");\n\n\t\t\tfor (int r :rte.path)\n\t\t\t\ts += String.format (\" %s\",Util.ip2string(r));\n\n\t\t\tif (lnkVec.get(rte.outLink).helloState == 0)\n\t\t\t\ts += String.format(\"\\t ** disabled link\");\n\t\t\ts += \"\\n\";\n\t\t}\n\t\tSystem.out.println(s);\n\t}", "public void showRules() {\r\n data.rulesFlag = true;\r\n setChanged();\r\n notifyObservers(data);\r\n data.rulesFlag = false;\r\n }", "public String print()\n\t{\n\t\tString s = \"\";\n\t\t\n\t\ts = \"<explanation text=\\\"\" + text + \"\\\">\";\n\t\ts = s + commentContainer.printComments();\n\t\tif (expression != null)\n\t\t{\n\t\t\ts = s + expression.print(); \n\t\t}\n\t\ts = s + \"</explanation>\";\n\t\t\n\t\treturn s;\n\t}", "public abstract void printConstraint();", "@Override\n public String toString() {\n StringBuilder sb = new StringBuilder();\n sb.append(\"{\");\n if (getViolationTarget() != null)\n sb.append(\"ViolationTarget: \").append(getViolationTarget()).append(\",\");\n if (getViolationTargetDescription() != null)\n sb.append(\"ViolationTargetDescription: \").append(getViolationTargetDescription()).append(\",\");\n if (getPartialMatches() != null)\n sb.append(\"PartialMatches: \").append(getPartialMatches()).append(\",\");\n if (getPossibleSecurityGroupRemediationActions() != null)\n sb.append(\"PossibleSecurityGroupRemediationActions: \").append(getPossibleSecurityGroupRemediationActions());\n sb.append(\"}\");\n return sb.toString();\n }", "public String getRules() { \n\t\treturn getRulesElement().getValue();\n\t}", "public String[] getRuleSetDisplayNames()\n/* */ {\n/* 1015 */ return getRuleSetDisplayNames(ULocale.getDefault(ULocale.Category.DISPLAY));\n/* */ }", "public String getRulesRep(){\r\n return RulesRep;\r\n }", "public String toString()\r\n {\r\n return String.format(getTexto()+\"|\"+getCondition());\r\n }", "@Override\n public String toString() {\n StringBuilder sb = new StringBuilder();\n sb.append(\"{\");\n if (getARN() != null)\n sb.append(\"ARN: \").append(getARN()).append(\",\");\n if (getExcludedRules() != null)\n sb.append(\"ExcludedRules: \").append(getExcludedRules()).append(\",\");\n if (getRuleActionOverrides() != null)\n sb.append(\"RuleActionOverrides: \").append(getRuleActionOverrides());\n sb.append(\"}\");\n return sb.toString();\n }", "private void debugRenderTextInfos() {\n\t\tdebugRenderEntityTextInfosList(layerNegOneEntities);\n\t\tdebugRenderEntityTextInfosList(layerZeroEntities);\n\t\tdebugRenderEntityTextInfosList(layerOneEntities);\n\t}", "public String toString()\n\t\t{\n\t\t\tif (computedToString == null)\n\t\t\t{\n\t\t\t\tsynchronized(ExecutionPolicy.class)\n\t\t\t\t{\n\t\t\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\t\t\tsb.append(indent()).append(\"<NOT>\\n\");\n\t\t\t\t\ttoStringIndent++;\n\t\t\t\t\tif (rule == null) sb.append(indent()).append(\"null\\n\");\n\t\t\t\t\telse sb.append(rule.toString());\n\t\t\t\t\ttoStringIndent--;\n\t\t\t\t\tsb.append(indent()).append(\"</NOT>\\n\");\n\t\t\t\t\tcomputedToString = sb.toString();\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn computedToString;\n\t\t}", "@Override\n public String toString() {\n if (valid())\n return \"valid\";\n return print(errors + \":\" + validator);\n }", "public String toString() {\r\n\t\tString[] analysis = new String[26];\r\n\t\tString bigLine = String.format(\"LETTER ANALYSIS: \" + '\\n' + \"%-6s\" + '\\t' + \"%-6s\" + '\\t' + \"%-6s\" +\r\n\t\t\t\t\t\t\t'\\t' + \"%-6s\" + '\\t' + \"%-6s\" + '\\n', \"Letter\", \"Freq\", \"Freq%\", \"AvFreq%\", \"Diff\");\r\n\t\tfor(int i = 0; i < 26; i++) {\r\n\t\t\tanalysis[i] = returnAnArray(i);\r\n\t\t\tbigLine+=analysis[i];\r\n\t\t} bigLine += \"The most frequent letter is \" + mostFrequent + \" at \" + formatDoubles(max);\r\n\t\treturn bigLine;\r\n\t\t\r\n\t}", "public String toString() {\n StringBuffer buffer = new StringBuffer();\n\n for (int i = 0; i < patterns.length; i++) {\n buffer.append(patterns[i]);\n buffer.append(\"\\n\\n\");\n }\n return buffer.toString();\n }", "public String toString() {\n StringBuffer sb = new StringBuffer();\n sb.append(\"Summary for \");\n sb.append(method.toString());\n sb.append(':');\n sb.append(Strings.lineSep);\n// for (Iterator i=nodes.keySet().iterator(); i.hasNext(); ) {\n// Node n = (Node)i.next();\n// sb.append(\"\\t\");\n// sb.append(n.toString_long());\n// sb.append(Strings.lineSep);\n// }\n if(params != null && params.length > 0) {\n sb.append(\"\\tParams: \");\n sb.append(Arrays.asList(params));\n sb.append(Strings.lineSep);\n }\n if (returned != null && !returned.isEmpty()) {\n sb.append(\"\\tReturned: \");\n sb.append(returned);\n sb.append(Strings.lineSep);\n }\n if (thrown != null && !thrown.isEmpty()) {\n sb.append(\"\\tThrown: \");\n sb.append(thrown);\n sb.append(Strings.lineSep);\n }\n if (calls != null && !calls.isEmpty()) {\n sb.append(\"\\tCalls: \");\n sb.append(calls);\n sb.append(Strings.lineSep);\n }\n return sb.toString();\n }", "List<RuleInfo> listRulesInfo() throws IOException;", "private void displayConditions(){\n\n\t\tString[] possibleConditions = new String[countPossibleRoutes()];\n\t\tQuestionlistModel = new DefaultListModel();\n\t\t\n\t\tString currentRule = \"\";\n\t\tint currentRuleIndex;\n\t\tint possCondInd = 0;\n\t\t\n\t\tfor(int i=0;i<ConditionTree.length;i++){\n\t\t\tcurrentRule = ConditionTree[i][0];\n\t\t\tcurrentRuleIndex = i;\n\t\t\t \n\t\t\t// if current Rule is final rule\n\t\t\tif(ConditionTree[i][5].equals(\"Y\")){\n\t\t\t\t\n\t\t\t\tpossibleConditions[possCondInd] = String.valueOf(currentRuleIndex) + \",\";\n\t\t\t\t//loop until not founds the top rule\n\t\t\t\t//System.out.println(\"value of i: \" + possCondInd + \" \" + currentRule + \" index is:\" + currentRuleIndex);\n\t\t\t\twhile(!ConditionTree[currentRuleIndex][1].equals(\"-\")){\n\t\t\t\t\t//setting current rule to current parent rule\n\t\t\t\t\tcurrentRuleIndex = getRuleIndex(ConditionTree[currentRuleIndex][1]);\n\t\t\t\t\tcurrentRule = ConditionTree[currentRuleIndex][0];\n\t\t\t\t\tpossibleConditions[possCondInd] += String.valueOf(currentRuleIndex) + \",\";\n\t\t\t\t\t//System.out.println(\"value of i: \" + possCondInd + \" \" + currentRule + \" index is:\" + currentRuleIndex);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tpossibleConditions[possCondInd] = possibleConditions[possCondInd].substring(0, possibleConditions[possCondInd].length()-1);\n\t\t\t\t//System.out.println(possibleConditions[possCondInd]);\n\t\t\t\tpossCondInd++;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t//Displaying in human language\n\t\tfor(int k=0;k<possibleConditions.length;k++){\n\t\t\tString currRoute[] = possibleConditions[k].split(\",\");\n\n\t\t\tint curRutInd;\n\t\t\tint nxtRutInd;\n\t\t\tString str = \"if \";\n\t\t\tfor(int i=currRoute.length-1;i>0;i--){\n\t\t\t\tcurRutInd = Integer.parseInt(currRoute[i-1]);\n\t\t\t\tnxtRutInd = Integer.parseInt(currRoute[i]);\n\t\t\t\t\n\t\t\t\tfor(int a=0;a<ConditionTree.length;a++){\n\n\t\t\t\t\tif(ConditionTree[a][0].equals(ConditionTree[curRutInd][1]) && \n\t\t\t\t\t\t\tConditionTree[a][1].equals(ConditionTree[nxtRutInd][1])){\n\t\t\t\t\t\t//System.out.println(ConditionTree[curRutInd][1] + \" is \" + ConditionTree[curRutInd][2] + \" \" + ConditionTree[curRutInd][3]);\n\t\t\t\t\t\tQuestionlistModel.addElement(ConditionTree[curRutInd][1] + \" is \" + ConditionTree[curRutInd][2] + \" \" + ConditionTree[curRutInd][3]);\n\t\t\t\t\t\tif(ConditionTree[curRutInd][5].equals(\"Y\")){\n\t\t\t\t\t\t\t//System.out.println(ConditionTree[curRutInd][0]);\n\t\t\t\t\t\t\tQuestionlistModel.addElement(ConditionTree[curRutInd][0]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tQuestionlistModel.addElement(\"\\n\");\n\t\t}\n\t\tQuestionList.setModel(QuestionlistModel);\n\t}", "public String toString() {\n \t\treturn getCssText();\n \t}", "private void print( org.antlr.v4.tool.Grammar grammar, ParseTree tree, String indentStep, String indent )\n {\n if ( tree != null )\n {\n Object payload = tree.getPayload();\n if ( payload instanceof InterpreterRuleContext )\n {\n String ruleName = grammar.getRule( ((InterpreterRuleContext) payload).getRuleIndex() ).name;\n System.out.println( indent + ruleName );\n }\n else\n {\n System.out.println( indent + \"\\\"\" + tree.getText() + \"\\\"\" );\n }\n for ( int i = 0; i <= tree.getChildCount(); i++ )\n {\n print( grammar, tree.getChild( i ), indentStep, indent + indentStep );\n }\n }\n }", "@Override \r\npublic String toString() { \r\n\treturn String.format(\"Action programmer: %s%n%s: $%,.2f; %s: %,.2f\",\r\n\t\t\tsuper.toString(), \"hourly wage\", getWage(), \r\n\t\t\t\"pieces worked\", getPieces()); }", "public String toString()\n {\n StringBuffer sb = new StringBuffer();\n sb.append(\"ReportConstraints:\");\n sb.append(\" TimeStart=\" + this.getTimeStart());\n sb.append(\" TimeEnd=\" + this.getTimeEnd());\n sb.append(\" ValidGPSRequired=\" + this.getValidGPSRequired());\n sb.append(\" SelectionLimitType=\" + this.getSelectionLimitType());\n sb.append(\" SelectionLimit=\" + this.getSelectionLimit());\n sb.append(\" ReportLimit=\" + this.getReportLimit());\n sb.append(\" Where='\" + this.getWhere() + \"'\");\n return sb.toString();\n }", "public String toString ()\n\t{\n\t\tString s = \"\";\n for (Production production : productions.values()) s += production + \"\\n\";\n\t\treturn s;\n\t}", "public String toString() {\n StringBuilder out = new StringBuilder(\"Requirements:\\n\");\n for (Fact fact: requiredFacts) {\n out.append(fact.toString());\n if (requiredFacts.indexOf(fact) < requiredFacts.size() - 1) out.append(reqIsAnd ? \"AND\\n\" : \"OR\\n\");\n }\n return out.toString();\n }", "public void printStats() {\n\t\tSystem.out.println(\"============= RULEGROWTH - STATS ========\");\n\t\tSystem.out.println(\"Sequential rules count: \" + ruleCount);\n\t\tSystem.out.println(\"Total time: \" + (timeEnd - timeStart) + \" ms\");\n\t\tSystem.out.println(\"Max memory: \" + MemoryLogger.getInstance().getMaxMemory());\n\t\tSystem.out.println(\"==========================================\");\n\t}", "public void printConstraint() {\n\t\tSystem.out.println(this.object + \" \" + this.closeObject + \" \" + this.farObject);\r\n\t}", "public String compressStringifiedRules() {\n StringBuilder ruleBuilder = new StringBuilder();\n for (SecurityGroupRulesCmd.IpPortAndProto ipPandP : getIngressRuleSet()) {\n ruleBuilder.append(\"I:\").append(ipPandP.getProto()).append(\":\").append(ipPandP.getStartPort()).append(\":\").append(ipPandP.getEndPort()).append(\":\");\n for (String cidr : ipPandP.getAllowedCidrs()) {\n ruleBuilder.append(cidr).append(\",\");\n }\n ruleBuilder.append(\"NEXT\");\n ruleBuilder.append(\" \");\n }\n for (SecurityGroupRulesCmd.IpPortAndProto ipPandP : getEgressRuleSet()) {\n ruleBuilder.append(\"E:\").append(ipPandP.getProto()).append(\":\").append(ipPandP.getStartPort()).append(\":\").append(ipPandP.getEndPort()).append(\":\");\n for (String cidr : ipPandP.getAllowedCidrs()) {\n ruleBuilder.append(cidr).append(\",\");\n }\n ruleBuilder.append(\"NEXT\");\n ruleBuilder.append(\" \");\n }\n String stringified = ruleBuilder.toString();\n ByteArrayOutputStream out = new ByteArrayOutputStream();\n try {\n //Note : not using GZipOutputStream since that is for files\n //GZipOutputStream gives a different header, although the compression is the same\n DeflaterOutputStream dzip = new DeflaterOutputStream(out);\n dzip.write(stringified.getBytes());\n dzip.close();\n } catch (IOException e) {\n s_logger.warn(\"Exception while compressing security group rules\");\n return null;\n }\n return Base64.encodeBase64String(out.toByteArray());\n }", "String getTraceabilityNotes();", "public void printResults() {\r\n\t\tif (net.isFlow()) {\r\n\t\t\tSystem.out.println(\"The assignment is a valid flow\");\r\n\t\t\tSystem.out.println(\"A maximum flow has value: \"+net.getValue());\r\n\t\t\tSystem.out.println(\"The flows along the edges are as follows:\");\r\n\t\t\tnet.printFlow();\r\n\t\t}\r\n\t\telse\r\n\t\t\tSystem.out.println(\"The assignment is not a valid flow\");\r\n\t}", "@Override\n\tpublic String toString() {\n\t\tString out = \"\";\n\t\tfor (Literal s : literals) {\n\t\t\tout = out + \" (\"+ s.getLiteral()+\" \"+((s.getArithmetic_value()==null)?s.isLiteral_positivity():s.getArithmetic_value())+\") \";\n\t\t}\n\t\treturn out;\n\t}", "public java.lang.String getRule() {\n java.lang.Object ref = rule_;\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 rule_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "private static void writeFinalRuleBase (boolean printStdOut) throws IllegalArgumentException, IOException{\n \t\n \tFileSystem fs = FileSystem.get(Mediator.getConfiguration());\n \tPath textPath = new Path(Mediator.getHDFSLocation()+Mediator.getLearnerRuleBasePath()+\"_text.txt\");\n BufferedWriter bwText = new BufferedWriter(new OutputStreamWriter(fs.create(textPath,true)));\n FileStatus[] status = fs.listStatus(new Path(Mediator.getHDFSLocation()+Mediator.getLearnerRuleBasePath()+\"_TMP\"));\n \tWriter writer = SequenceFile.createWriter(Mediator.getConfiguration(), \n \t\t\tWriter.file(new Path(Mediator.getHDFSLocation()+Mediator.getLearnerRuleBasePath())), \n \t\t\tWriter.keyClass(ByteArrayWritable.class), Writer.valueClass(FloatWritable.class));\n Reader reader;\n\t\tByteArrayWritable rule = new ByteArrayWritable();\n\t\tFloatWritable ruleWeight = new FloatWritable();\n\t\tint id = 0;\n \n bwText.write(\"\\nRULE BASE:\\n\\n\");\n if (printStdOut)\n \tSystem.out.println(\"\\nRULE BASE:\\n\");\n \t\n \t// Read all sequence files from stage 2\n \tfor (FileStatus fileStatus:status){\n \t\t\n \t\tif (!fileStatus.getPath().getName().contains(\"_SUCCESS\")){\n \t\t\n\t \t\t// Open sequence file\n\t \t\treader = new Reader(Mediator.getConfiguration(), Reader.file(fileStatus.getPath()));\n\t \n\t // Read all rules\n\t while (reader.next(rule, ruleWeight)) {\n\t \t\n\t \t// Write rule in the output sequence file\n\t \twriter.append(rule, ruleWeight);\n\t \t\n\t \tbwText.write(\"Rule (\"+id+\"): IF \");\n\t \tif (printStdOut)\n\t \t\tSystem.out.print(\"Rule (\"+id+\"): IF \");\n\t \t\n\t \t// Write antecedents\n\t \tfor (int i = 0; i < rule.getBytes().length - 2; i++){\n\t \t\t\n\t \t\tbwText.write(Mediator.getVariables()[i].getName()+\" IS \");\n\t \t\tif (printStdOut)\n\t \t\tSystem.out.print(Mediator.getVariables()[i].getName()+\" IS \");\n\t \t\tif (Mediator.getVariables()[i] instanceof NominalVariable){\n\t \t\t\tbwText.write(((NominalVariable)Mediator.getVariables()[i]).getNominalValue(rule.getBytes()[i])+\" AND \");\n\t \t\t\tif (printStdOut)\n\t \t\tSystem.out.print(((NominalVariable)Mediator.getVariables()[i]).getNominalValue(rule.getBytes()[i])+\" AND \");\n\t \t\t}\n\t \t\t\telse {\n\t \t\t\t\tbwText.write(\"L_\"+rule.getBytes()[i]+\" AND \");\n\t \t\t\t\tif (printStdOut)\n\t \t\tSystem.out.print(\"L_\"+rule.getBytes()[i]+\" AND \");\n\t \t\t\t}\n\t \t\t\n\t \t}\n\t \t\n\t \t// Write the last antecedent\n\t \tbwText.write(Mediator.getVariables()[rule.getBytes().length-2].getName()+\" IS \");\n\t \tif (printStdOut)\n\t \t\tSystem.out.print(Mediator.getVariables()[rule.getBytes().length-2].getName()+\" IS \");\n\t \tif (Mediator.getVariables()[rule.getBytes().length-2] instanceof NominalVariable){\n\t \t\tbwText.write(((NominalVariable)Mediator.getVariables()[rule.getBytes().length-2]).getNominalValue(rule.getBytes()[rule.getBytes().length-2]));\n\t \t\tif (printStdOut)\n\t \t\tSystem.out.print(((NominalVariable)Mediator.getVariables()[rule.getBytes().length-2]).getNominalValue(rule.getBytes()[rule.getBytes().length-2]));\n\t \t}\n\t \t\telse {\n\t \t\t\tbwText.write(\"L_\"+rule.getBytes()[rule.getBytes().length-2]);\n\t \t\t\tif (printStdOut)\n\t \t\tSystem.out.print(\"L_\"+rule.getBytes()[rule.getBytes().length-2]);\n\t \t\t}\n\t \t\n\t \t// Write the class and rule weight\n\t \tbwText.write(\" THEN CLASS = \"+Mediator.getClassLabel(rule.getBytes()[rule.getBytes().length-1]));\n\t \tbwText.write(\" WITH RW = \"+ruleWeight.get()+\"\\n\\n\");\n\t \tif (printStdOut){\n\t \t\tSystem.out.print(\" THEN CLASS = \"+Mediator.getClassLabel(rule.getBytes()[rule.getBytes().length-1]));\n\t \t\tSystem.out.print(\" WITH RW = \"+ruleWeight.get()+\"\\n\\n\");\n\t \t}\n\t\n\t \tid++;\n\t \t\n\t }\n\t \n\t reader.close();\n \n \t\t}\n \t\t\n \t}\n \t\n \tbwText.close();\n writer.close();\n \t\n \t// Remove temporary rule base\n \tfs.delete(new Path(Mediator.getHDFSLocation()+Mediator.getLearnerRuleBasePath()+\"_TMP\"),true);\n \t\n }", "public String toString() {\n\t\tif (hierarchy.equals(\"n\")) {\n\t\t\treturn visability + \" class \" + className + \"{ \\n \";\n\t\t} else if (isFinished == true) {\n\n\t\t\treturn \"}\";\n\t\t} else {\n\t\t\treturn visability + \" \" + hierarchy + \" class \" + className\n\t\t\t\t\t+ \"{ \\n \";\n\t\t}\n\t}", "@Override\n\t\tpublic String toString() {\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tpreOrderTraverse(expression.root, 1, sb);\n\t\t\treturn sb.toString();\n\t\t}", "public String toString()\n{\n StringBuffer buf = new StringBuffer();\n buf.append(\"[SOURCE: \" + for_source.getName() + \",\\n\");\n if (getTransforms() != null) {\n buf.append(\"TRANS:\");\n for (S6Transform.Memo m : getTransforms()) {\n\tbuf.append(\" \");\n\tbuf.append(m.getTransformName());\n }\n }\n else {\n buf.append(\" TEXT: \" + getFragment().getText());\n }\n buf.append(\"]\");\n\n return buf.toString();\n}", "private void textilize () {\n\n textIndex = 0;\n int textEnd = line.length() - 1;\n listChars = new StringBuffer();\n linkAlias = false;\n while (textIndex < line.length()\n && (Character.isWhitespace(textChar()))) {\n textIndex++;\n }\n while (textEnd >= 0\n && textEnd >= textIndex\n && Character.isWhitespace (line.charAt (textEnd))) {\n textEnd--;\n }\n boolean blankLine = (textIndex >= line.length());\n if (blankLine) {\n textilizeBlankLine();\n }\n else\n if ((textIndex > 0)\n || ((line.length() > 0 )\n && (line.charAt(0) == '<'))) {\n // First character is white space of the beginning of an html tag:\n // Doesn't look like textile... process it without modification.\n }\n else\n if (((textEnd - textIndex) == 3)\n && line.substring(textIndex,textEnd + 1).equals (\"----\")) {\n // && (line.substring(textIndex, (textEnd + 1)).equals (\"----\")) {\n textilizeHorizontalRule(textIndex, textEnd);\n } else {\n textilizeNonBlankLine();\n };\n }", "@Override\n public String toString() {\n StringBuilder sb = new StringBuilder();\n int startIndex = 0;\n while (startIndex < total - laneSize - 1) {\n startIndex = printOddLane(sb, startIndex);\n startIndex = printEvenLane(sb, startIndex + laneSize);\n }\n\n return sb.toString();\n }", "private String toStringBody(int depth) {\n if (depth <= 1) return \"\";\n\n String ret;\n if (operator == null) {\n ret = \"\\nOperator: null\";\n }\n else {\n ret = \"\\nOperator: \" + operator.getName().toString() + \" \"\n + operator.getUid() + \" \";\n }\n\n if (unboundedBoundSymbols!=null && unboundedBoundSymbols.length > 0) {\n ret += \"\\nUnbounded bound symbols: \";\n for (int i = 0; i < unboundedBoundSymbols.length; i++) {\n ret += Strings.indent(2,unboundedBoundSymbols[i].toString(depth-1));\n }\n }\n\n if (boundedBoundSymbols != null && boundedBoundSymbols.length > 0) {\n ret += \"\\nBounded bound symbols: \" + getNumberOfBoundedBoundSymbols();\n for (int i = 0; i < boundedBoundSymbols.length; i++) {\n if (boundedBoundSymbols[i] != null && boundedBoundSymbols[i].length > 0) {\n for (int j = 0; j < boundedBoundSymbols[i].length; j++) {\n ret += Strings.indent(2, \"\\n[\" + i + \",\" + j + \"]\" +\n Strings.indent(2,boundedBoundSymbols[i][j].toString(depth-1)));\n }\n }\n }\n }\n\n if (ranges.length > 0) {\n ret += \"\\nRanges: \";\n for (int i = 0; i < ranges.length; i++)\n ret += Strings.indent(2,(ranges[i] != null ?\n ranges[i].toString(depth-1) : \"null\" ));\n }\n\n if (tupleOrs != null && tupleOrs.length > 0 /* && tupleOrs[0] */) {\n ret += \"\\nTupleOrs: \";\n for (int i = 0; i < tupleOrs.length; i++) {\n ret += Strings.indent(2, (tupleOrs[i] ? \"\\ntrue\" : \"\\nfalse\"));\n }\n }\n\n if (operands != null) {\n if (operands.length > 0) {\n ret += \"\\nOperands: \" + operands.length;\n for (int i = 0; i < operands.length; i++) {\n ret += Strings.indent(2,\n (operands[i] == null ? \"\\nnull\" : operands[i].toString(depth-1)));\n }\n }\n }\n else {\n ret += \"\\nOperands: null\";\n }\n return Strings.indent(2, ret);\n }", "public String actionsToString() {\n String res = \"\";\n for (UserCheck userCheck: checks) {\n res += userCheck.toString() + \" \\n\";\n }\n return res;\n }", "@Override\n public String toString() {\n if ((!isOccupied()) && (getLevel()==0)) {\n return \"-- --\";\n }\n else if ((isOccupied()) && (getLevel()==0)) {\n return getColor().abbrev()+\"- --\";\n }\n else if ((!isOccupied()) && (getLevel()>0) && (!isDomed())) {\n return \"-- \"+getLevel()+\"-\";\n }\n else if ((!isOccupied()) && (getLevel()>0) && (isDomed())) {\n return \"-- \"+getLevel()+\"*\";\n }\n else if (isOccupied() && getLevel()>0 && (isDomed())) {\n return getColor().abbrev()+\"- \"+getLevel()+\"*\";\n }\n else if (isOccupied() && getLevel()>0 && (!isDomed())) {\n return getColor().abbrev()+\"- \"+getLevel()+\"-\";\n }\n else return \"err\";\n }", "public String toString(){\n\t\tString temp = new String();\n\n\t\tif(cancelled){\n\t\t\ttemp+=\"WARNING COURSE SHOULD BE CANCELLED!\\n\";\n\t\t}\n\n\t\ttemp += \" Course subject ID: \" + subject.getID();\n\t\ttemp += \"\\n \" + (getStatus() < 0 ? \"Due to start\" : \"Finishes\") + \" in: \" + Math.abs(getStatus());\n\t\ttemp += \"\\n \" + (instructor == null ? \"Instructor not assigned\" : \"Instructor: \" + instructor.getName());\n\t\ttemp += \"\\n Amount of students enrolled: \" + enrolled.size() + \"\\n Enrolled list:\\n\";\n\n\t\tfor(Student student : enrolled){\n\t\t\ttemp+= \" * \" + student.getName() + \"\\n\";\n\t\t}\n\t\treturn temp;\n\t}", "public void flush() {\n\t\t\n\t\tif (Verbose.DEFAULT.equals(VERBOSE_LEVEL)) {\n\t\t\treturn;\t//no output\n\t\t}\n\t\t\n\t\t/* Verbose.VERBOSE | Verbose.ALL */\n\t\t\t\t\n\t\t/* Each constructor/ method to be crashed = non-private, non-abstract */\n\t\tStringBuffer sb = new StringBuffer(\"*** Methods and constructors under testclasses:\");\n\t\tfor (ClassUnderTest cPlan: plans.values()) {\n\t\t\tsb.append(LS+LS+cPlan.getWrappedClass().getCanonicalName()); //qualified class name\n\t\t\t\n\t\t\tfor (PlanSpaceNode pNode: cPlan.getChildren()) {\n\t\t\t\tFunctionNode fNode = (FunctionNode) pNode;\n\t\t\t\tsb.append(LS+\"\\t\"+fNode.toString());\t//method or constructor under testclasses\n\t\t\t}\t\t\t\t\n \t}\n \t\t\n\t\t\n\t /*\n\t * 2. Each value and public, non-abstract constructing function \n\t * of each needed instance and all of their children.\n\t */\n sb.append(LS+LS+LS+\"*** Rules to create needed values:\");\n\t\tsb.append(flushRules(true));\t\t\n\t\t\n \tif (Verbose.ALL.equals(VERBOSE_LEVEL)) {\n sb.append(LS+LS+LS+\"*** Rules that were not needed:\");\n \t\tsb.append(flushRules(false));\n \t}\n\n sb.append(LS+LS);\n System.out.println(sb);\n\t}", "public String toString() {\r\n\t\tStringBuilder s = new StringBuilder(\"\");\r\n\t\tif (objective != null) {\r\n\t\t\ts.append(\"Objective: \").append(objective.getName())\r\n\t\t\t .append('=').append(objective.getDomain())\r\n\t\t\t .append('\\n');\r\n\t\t}\r\n\t\tfor (Variable v : variables) {\r\n\t\t\ts.append(v.getName()).append('=').append(v.getDomain())\r\n\t\t\t .append('\\n');\r\n\t\t}\r\n\t\tfor (Constraint c : constraints) {\r\n\t\t\ts.append(c.toString()).append('\\n');\r\n\t\t}\r\n\t\treturn s.toString();\r\n\t}", "private String perRuleStatistics(Map<Feature<Boolean>, Set<String>> featureResults, int total) {\n StringBuffer statisticsTable = new StringBuffer();\n for (Feature<Boolean> feature : featureResults.keySet()) {\n statisticsTable.append(String.format(\"\\n### Project statistics for %s (%s)\\n\\n\", \n formatter.identifierOf(feature).orElseGet(() -> \"unknown\"), formatter.nameOf(feature)));\n Set<String> resultsForFeature = featureResults.get(feature);\n if (resultsForFeature.isEmpty()) {\n statisticsTable.append(\"*All projects are compliant with this rule.*\\n\");\n } else {\n statisticsTable.append(\"| | # of projects | % of projects |\\n\");\n statisticsTable.append(\"| ------- | :----- | :------------------ |\\n\");\n statisticsTable.append(String.format(\"| Passed | %d | %2.1f%% |\\n\", \n total - resultsForFeature.size(), \n (double) (total - resultsForFeature.size()) / total * 100));\n statisticsTable.append(String.format(\"| Failed | %d | %2.1f%% |\\n\\n\", \n resultsForFeature.size(), (double) resultsForFeature.size() / total * 100));\n statisticsTable.append(\"**Failed projects:**\\n\");\n resultsForFeature.stream()\n .forEach(result -> statisticsTable.append(String.format(\"- %s\\n\", result)));\n }\n }\n return statisticsTable.toString();\n }", "public String toString() {\n/* 666 */ return this.pattern;\n/* */ }", "public String printFormat(){\n return \"The workout: \" + getName() + \" should be done for \" + getSets() + \" sets and in each set should be \"\n + getReps() + \" reps.\";\n }", "public String toString() {\n String color = translateColor(card.getColor());\n StringBuilder build = new StringBuilder();\n build.append(color).append(\" \").append(color).append(card.getCardID()).append(color).append(\" \").append(Color.reset()).append(\"\\n\").append(color).append(\"╔════\").append(color).append(\"Level\").append(color).append(\"════╗\").append(Color.reset()).append(\"\\n\").append(color).append(\"║ \").append(color).append(card.getLevel()).append(color).append(\" ║\").append(Color.reset()).append(\"\\n\").append(color).append(\"╠════\").append(color).append(\"Cost\").append(color).append(\"═════╣\").append(Color.reset()).append(\"\\n\");\n for (Resource resource : card.getCost().keySet()) {\n build.append(color).append(\"║ \").append(CLI.colorResource(resource)).append(card.getCost().get(resource)).append(\" \").append(CLI.shapeResource(resource)).append(color).append(\" ║\").append(Color.reset()).append(\"\\n\");\n }\n build.append(color).append(\"╠═\").append(color).append(\"Production\").append(color).append(\"══╣\").append(Color.reset()).append(\"\\n\");\n for (Resource resource : card.getProductionPower().getConsumedResources().keySet()) {\n build.append(color).append(\"║ \").append(CLI.colorResource(resource)).append(card.getProductionPower().getConsumedResources().get(resource)).append(\" \").append(CLI.shapeResource(resource)).append(color).append(\" ║\").append(Color.reset()).append(\"\\n\");\n }\n if (card.getProductionPower().getRequiredResourceOfChoice() != 0) {\n build.append(color).append(\"║ \").append(color).append(+card.getProductionPower().getRequiredResourceOfChoice()).append(\" \").append(\"?\").append(color).append(\" ║\").append(Color.reset()).append(\"\\n\");\n }\n build.append(color).append(\"║ \").append(color).append(\"--->>> \").append(color).append(\" ║ \").append(Color.reset()).append(\"\\n\");\n for (Resource resource : card.getProductionPower().getProducedResources().keySet()) {\n build.append(color).append(\"║ \").append(CLI.colorResource(resource)).append(card.getProductionPower().getProducedResources().get(resource)).append(\" \").append(CLI.shapeResource(resource)).append(color).append(\" ║\").append(Color.reset()).append(\"\\n\");\n }\n if (card.getProductionPower().getFaithPointsProduced() != 0) {\n build.append(color).append(\"║ \").append(color).append(+card.getProductionPower().getFaithPointsProduced()).append(\" \").append(\"+\").append(color).append(\" ║\").append(Color.reset()).append(\"\\n\");\n }\n if (card.getProductionPower().getProducedResourceOfChoice() != 0) {\n build.append(color).append(\"║ \").append(color).append(+card.getProductionPower().getProducedResourceOfChoice()).append(\" \").append(\"?\").append(color).append(\" ║\").append(Color.reset()).append(\"\\n\");\n }\n\n\n build.append(color).append(\"╠═══\").append(color).append(\"VPoints\").append(color).append(\"═══╣\").append(Color.reset()).append(\"\\n\");\n if (card.getVictoryPoints() < 10) {\n build.append(color).append(\"║ \").append(color).append(card.getVictoryPoints()).append(color).append(\" ║\").append(Color.reset()).append(\"\\n\");\n } else\n build.append(color).append(\"║ \").append(color).append(card.getVictoryPoints()).append(color).append(\" ║\").append(Color.reset()).append(\"\\n\");\n build.append(color).append(\"╚════\").append(color).append(color).append(\"═════════╝\").append(Color.reset()).append(\"\\n\");\n build.append((color + \" \" + color + color + \" \" + Color.reset() + \"\\n\").repeat(5));\n return build.toString();\n }", "public void printRoute() {\n\t\tString route = new String(\"[ROUTE INFO] - Cost: \");\n\t\tif(cost == 0) {\n\t\t\troute += \" Not Yet Calculated, \";\n\t\t}\n\t\telse {\n\t\t\troute += (\"\" + this.cost + \", \");\n\t\t}\n\t\troute += (\"Route Length: \" + solutionLength + \", Route: \");\n\t\troute += \"(\" + solutionRepresentation.get(0).getX() + \",\" + solutionRepresentation.get(0).getY() + \")\";\n\t\tfor(int i = 1; i < solutionLength; i++) {\n\t\t\troute+= \" -> (\" + solutionRepresentation.get(i).getX() + \",\" + solutionRepresentation.get(i).getY() + \")\";\n\t\t}\n\t\tSystem.out.println(route);\n\t}", "public String toString(){\r\n\t\tString cons = \"Conditions\\n\";\r\n\t\t//enhanced for loop could also be used\r\n\t\tfor(int i = 0; i<conditions.size(); i++){\r\n\t\t\tcons += conditions.get(i).getName()+\"\\n\";\r\n\t\t}\r\n\t\treturn \"Name : \" + fname + \" \" + lname+\"\\nDate Of Birth: \" + age+ \"\\n\" + cons; \r\n\t}", "@Override\n public String toString()\n {\n\n StringBuilder sb = new StringBuilder();\n\n if ( type != null )\n {\n sb.append( type );\n }\n\n if ( dnAttributes )\n {\n sb.append( \":dn\" );\n }\n\n if ( matchingRule == null )\n {\n\n if ( type == null )\n {\n return \"Extended Filter wrong syntax\";\n }\n }\n else\n {\n sb.append( ':' ).append( matchingRule );\n }\n\n sb.append( \":=\" ).append( matchValue );\n\n return sb.toString();\n }", "@Override\n public String toString() {\n return \"\\n AntMode {\"\n + (antEfficiency != null ? \" antEfficiency [\" + antEfficiency + \"]\" : \"\")\n + (antFreqs != null ? \" antFreqs [\" + antFreqs + \"]\" : \"\")\n + (antGain != null ? \" antGain [\" + antGain + \"]\" : \"\")\n + (antPattern != null ? \" antPattern [\" + antPattern + \"]\" : \"\")\n + (beamType != null ? \" beamType [\" + beamType + \"]\" : \"\")\n + (description != null ? \" description [\" + description + \"]\" : \"\")\n + (horzBwMax != null ? \" horzBwMax [\" + horzBwMax + \"]\" : \"\")\n + (horzBwMin != null ? \" horzBwMin [\" + horzBwMin + \"]\" : \"\")\n + (horzScanRate != null ? \" horzScanRate [\" + horzScanRate + \"]\" : \"\")\n + (horzScanSector != null ? \" horzScanSector [\" + horzScanSector + \"]\" : \"\")\n + (horzScanSpeed != null ? \" horzScanSpeed [\" + horzScanSpeed + \"]\" : \"\")\n + (horzScanType != null ? \" horzScanType [\" + horzScanType + \"]\" : \"\")\n + (maxPower != null ? \" maxPower [\" + maxPower + \"]\" : \"\")\n + (modeID != null ? \" modeID [\" + modeID + \"]\" : \"\")\n + (modeName != null ? \" modeName [\" + modeName + \"]\" : \"\")\n + (modeUse != null ? \" modeUse [\" + modeUse + \"]\" : \"\")\n + (motionType != null ? \" motionType [\" + motionType + \"]\" : \"\")\n + (observedLobeAnalysis != null ? \" observedLobeAnalysis [\" + observedLobeAnalysis + \"]\" : \"\")\n + (observedPolarisationAnalysis != null ? \" observedPolarisationAnalysis [\" + observedPolarisationAnalysis + \"]\" : \"\")\n + (observedScanAnalysis != null ? \" observedScanAnalysis [\" + observedScanAnalysis + \"]\" : \"\")\n + (polarisationAngle != null ? \" polarisationAngle [\" + polarisationAngle + \"]\" : \"\")\n + (polarisationType != null ? \" polarisationType [\" + polarisationType + \"]\" : \"\")\n + (portIsolation != null ? \" portIsolation [\" + portIsolation + \"]\" : \"\")\n + (rotationDirection != null ? \" rotationDirection [\" + rotationDirection + \"]\" : \"\")\n + (rotationRateMax != null ? \" rotationRateMax [\" + rotationRateMax + \"]\" : \"\")\n + (rotationRateMin != null ? \" rotationRateMin [\" + rotationRateMin + \"]\" : \"\")\n + (sectBlanking != null ? \" sectBlanking [\" + sectBlanking + \"]\" : \"\")\n + (vertBwMax != null ? \" vertBwMax [\" + vertBwMax + \"]\" : \"\")\n + (vertBwMin != null ? \" vertBwMin [\" + vertBwMin + \"]\" : \"\")\n + (vertScanAngleMax != null ? \" vertScanAngleMax [\" + vertScanAngleMax + \"]\" : \"\")\n + (vertScanAngleMin != null ? \" vertScanAngleMin [\" + vertScanAngleMin + \"]\" : \"\")\n + (vertScanRate != null ? \" vertScanRate [\" + vertScanRate + \"]\" : \"\")\n + (vertScanSpeed != null ? \" vertScanSpeed [\" + vertScanSpeed + \"]\" : \"\")\n + (vertScanType != null ? \" vertScanType [\" + vertScanType + \"]\" : \"\")\n + (vswr != null ? \" vswr [\" + vswr + \"]\" : \"\")\n + \"}\";\n }", "public String rulesNiceAndTidy(boolean player){\n\tPlayer p = (player?p1:p2);\n\tString rules = (player?\"Player Row:\":\"Player Column:\")+\"\\n\";\n\tfor (String rule: p.getRuleString()){\n\t if (rule!=null){\n\t\trules+=rule+\"\\n\";\n\t }\n\t}\n\treturn rules+\"\\n\";\n }", "@Override\n public String toString() {\n StringBuilder sb = new StringBuilder();\n sb.append(\"{\");\n if (getPullRequestId() != null)\n sb.append(\"PullRequestId: \").append(getPullRequestId()).append(\",\");\n if (getApprovalRuleName() != null)\n sb.append(\"ApprovalRuleName: \").append(getApprovalRuleName()).append(\",\");\n if (getExistingRuleContentSha256() != null)\n sb.append(\"ExistingRuleContentSha256: \").append(getExistingRuleContentSha256()).append(\",\");\n if (getNewRuleContent() != null)\n sb.append(\"NewRuleContent: \").append(getNewRuleContent());\n sb.append(\"}\");\n return sb.toString();\n }", "abstract public String asText(boolean pretty);", "public String toString(){\r\n\t\tString superString = super.toString();\r\n\t\tStringBuilder builder = new StringBuilder();\r\n\t\t//Add the object to the string\r\n\t\tbuilder.append(\". \");\r\n\t\tif (this.error != null) {\r\n\t\t\tbuilder.append(error.toString());\r\n\t\t\tbuilder.append(\". \");\r\n\t\t}\r\n\t\tbuilder.append(\"Object: \");\r\n\t\tbuilder.append(object.toString());\r\n\t\tif (this.recordRoute)\r\n\t\t\tbuilder.append(\", [RECORD_ROUTE]\");\r\n\t\tif (this.reRouting) \r\n\t\t\tbuilder.append(\", [RE-ROUTING]\");\r\n\t\t//Add the masks to the string\r\n\t\tif (this.mask != null) {\r\n\t\t\tbuilder.append(\", label set: \");\r\n\t\t\tbuilder.append(mask.toString());\r\n\t\t}\r\n\t\treturn superString.concat(builder.toString());\r\n\t}", "@Override\n public String toString(){\n return String.format(\"%s%s%s%n%s%s%n \",super.toString(),\"The taxes is \",calcTaxes(),\n \"The total cost is \",calcCost());\n }", "public String getRule() {\r\n return rule;\r\n }", "public String toTextList() {\r\n Iterator<Match> itr = this.resultsTree.iterator();\r\n Match m;\r\n StringBuilder str = new StringBuilder();\r\n \r\n while (itr.hasNext()) {\r\n m = itr.next();\r\n //Match without results\r\n if (m.getScore1() == -1) {\r\n str\r\n .append(this.leftAlign(m.getTeam1().getName(), 10))\r\n .append(this.centerAlign(\" vs \", 10))\r\n .append(this.leftAlign(m.getTeam2().getName(), 10))\r\n .append(this.centerAlign(\"*** no results yet ***\", 30))\r\n .append(System.lineSeparator());\r\n }\r\n else {\r\n str\r\n .append(this.leftAlign(m.getTeam1().getName(), 10))\r\n .append(\" \")\r\n .append(m.getScore1())\r\n .append(\" \")\r\n .append(this.leftAlign(m.getTeam2().getName(), 10))\r\n .append(\" \")\r\n .append(m.getScore2())\r\n .append(System.lineSeparator());\r\n }\r\n }\r\n \r\n return str.toString();\r\n }", "public String toString() {\n\t\tString resultString = \"\\r\\n\";\n\t\t//resultString += \"Checkerboard state: \\r\\n\";\n\t\tfor (int i = 0; i < checkerboard.length; i++) {\n\t\t\tfor (int j = 0; j < checkerboard.length; j++) {\n\t\t\t\tif (checkerboard[i][j] == WHITE) {\n\t\t\t\t\tresultString += \"o \";\n\t\t\t\t} else if (checkerboard[i][j] == BLACK) {\n\t\t\t\t\tresultString += \"x \";\n\t\t\t\t} else {\n\t\t\t\t\tresultString += \"- \";\n\t\t\t\t}//Of if\n\t\t\t}//Of for j\n\t\t\tresultString += \"\\r\\n\";\n\t\t}//Of for i\n\t\t\n\t\tresultString += currentState;\n\n\t\t//resultString += \"\\r\\nThe current situation is: \" + gameSituation;\n\t\treturn resultString;\n\t}", "public String toString()\n\t{\n\treturn msg + \"\\t\" + \"Priority Level: \" + level + \"\\t\" + priority;\n\t}", "@Override\n\tpublic String toString (int printText){\n\t\tString printOut = \"\";\n\n\t\tif(printText != 2){\n\t\t\tprintOut = super.program + \" \" + super.year + \" \" + super.average;\n\t\t\t\n\t\t\tif(printText == 1 && this.isPhD){//print the text version of the phd status\n\t\t\t\tprintOut += \" \" + this.supervisor + \" PhD \" + this.undergraduateSchool;\n\t\t\t}else if(printText == 1 && !this.isPhD){\n\t\t\t\tprintOut += \" \" + this.supervisor + \" Masters \" + this.undergraduateSchool;\n\t\t\t}\n\n\t\t\tif(printText == 0 && this.isPhD){//print the number version of the phd status\n\t\t\t\tprintOut += \" \" + this.supervisor + \" 1 \" + this.undergraduateSchool;\n\t\t\t}else if(printText == 0 && !this.isPhD){\n\t\t\t\tprintOut += \" \" + this.supervisor + \" 0 \" + this.undergraduateSchool;\n\t\t\t}\n\n\t\t\tprintOut += \" \" + this.lastName;\n\t\t}else{\n\t\t\tprintOut = super.toString(printText);//if the printText is equal to 2, concat only the program name, year, and last name\n\t\t}\n\t\treturn printOut;\n\t}", "public String toString() { return kind() + \":\"+ text() ; }", "public void print(){\n System.out.println(\"(\"+a.getAbsis()+\"_a,\"+a.getOrdinat()+\"_a)\");\n System.out.println(\"(\"+b.getAbsis()+\"_b,\"+b.getOrdinat()+\"_b)\");\n System.out.println(\"(\"+c.getAbsis()+\"_b,\"+c.getOrdinat()+\"_c)\");\n }" ]
[ "0.74102616", "0.68778807", "0.68263954", "0.66535187", "0.6571331", "0.64908546", "0.6469041", "0.6392463", "0.63802195", "0.6305136", "0.62976956", "0.62816757", "0.624716", "0.6240161", "0.6228881", "0.6166707", "0.6070753", "0.60315746", "0.6023995", "0.60237277", "0.59862256", "0.5895551", "0.58185357", "0.5814207", "0.58068407", "0.57267326", "0.5695752", "0.56943405", "0.5656925", "0.56451327", "0.5621795", "0.5621375", "0.56117857", "0.560022", "0.5592651", "0.55704427", "0.5559709", "0.55553555", "0.55374485", "0.55168146", "0.5514995", "0.5510885", "0.5501742", "0.54954064", "0.54749376", "0.5463762", "0.54556435", "0.54341817", "0.5420268", "0.5411194", "0.53966284", "0.5389106", "0.5370447", "0.5367824", "0.53593427", "0.5358351", "0.53540045", "0.53472006", "0.5337127", "0.53134274", "0.53132516", "0.53073615", "0.52948016", "0.5281842", "0.527526", "0.52660227", "0.52576584", "0.52551806", "0.52545875", "0.52508146", "0.52472425", "0.52468085", "0.5246087", "0.5238637", "0.52360165", "0.5231029", "0.52284515", "0.5227504", "0.52266425", "0.5224026", "0.5219274", "0.52192444", "0.52175206", "0.52086776", "0.52020836", "0.5201782", "0.5201004", "0.51966214", "0.5195924", "0.5190803", "0.518991", "0.518935", "0.5187788", "0.51814944", "0.51814854", "0.51808846", "0.5173408", "0.5171909", "0.51689863", "0.51682466" ]
0.5901528
21
////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////for trace purposes display all rules in the conflict set
public void displayConflictSet(Vector ruleSet) { textArea1.appendText("\n\n" + " -- Rules in conflict set:\n\n"); Enumeration enum2 = ruleSet.elements() ; while(enum2.hasMoreElements()) { Rule temp = (Rule)enum2.nextElement() ; textArea1.appendText(temp.name + "(" + temp.numAntecedents()+ "), " ) ; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void dumpRules()\n\t{\n\t\tif(chain == null)\n\t\t\treturn;\n\t\t\n\t\tIterator it = chain.keySet().iterator();\n\t\tIterator subIt = null;\n\t\t\n\t\tString key = null;\n\t\twhile(it.hasNext())\n\t\t{\n\t\t\tkey = (String)it.next();\n\t\t\tSystem.out.print(key + \" --> \");\n\t\t\t\n\t\t\tsubIt = (chain.get(key)).iterator();\n\t\t\t\n\t\t\twhile(subIt.hasNext())\n\t\t\t\tSystem.out.print(subIt.next() + \", \");\n\t\t\t\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "protected static List<Conflict> getConflicts(){\n\t\treturn setOfConflicts;\n\t}", "public void printRules () {\n \n System.out.println(\"PRINTING RULESET ID : \" + this.id + \" (\" + this.size() + \") entries.\");\n for (int i = 0; i < this.size(); i++) {\n \n System.out.println(\"Rule \" + (i+1) + \" (ID \" + references.get(i) + \") : \" + this.rulelist.getRuleByID(references.get(i)) + \" Prob : \" + this.rulelist.getRuleByID(references.get(i)).getProb() + \" TIMES \" + this.rulelist.getRuleByID(references.get(i)).occurrencies + \" PREC \" + this.rulelist.getRuleByID(references.get(i)).prec_occurrencies);\n }\n System.out.println(\"Total Prob : \" + this.totalProb);\n System.out.println(\"Precedences : \" + this.precedences);\n }", "public String toString()\n/* */ {\n/* 885 */ StringBuilder result = new StringBuilder();\n/* 886 */ for (int i = 0; i < this.ruleSets.length; i++) {\n/* 887 */ result.append(this.ruleSets[i].toString());\n/* */ }\n/* 889 */ return result.toString();\n/* */ }", "public String[] getRuleSetDisplayNames()\n/* */ {\n/* 1015 */ return getRuleSetDisplayNames(ULocale.getDefault(ULocale.Category.DISPLAY));\n/* */ }", "String rulesAsText();", "public void printRules_RVLR () {\n \n System.out.println(\"PRINTING RULESET ID : \" + this.id + \" (\" + this.size() + \") entries.\");\n for (int i = 0; i < this.size(); i++) {\n \n System.out.println(\"Rule \" + (i+1) + \" (ID \" + references.get(i) + \") : \" + this.rulelist.getRuleByID(references.get(i)) + \" Prob : \" + this.rulelist.getRuleByID(references.get(i)).getProb() + \" TIMES \" + this.rulelist.getRuleByID(references.get(i)).occurrencies + \" PREC \" + this.rulelist.getRuleByID(references.get(i)).prec_occurrencies + \" Value : \" + this.rulelist.getRuleByID(references.get(i)).get_RVRL());\n }\n System.out.println(\"Total Prob : \" + this.totalProb);\n //System.out.println(\"Precedences : \" + this.precedences);\n }", "private void computeConflicts() {\n\t\tthis.conflictGraph = new HashMap<Class, List<Class>>();\n\n\t\tfor (Class c : this.core) {\n\t\t\tif (c.getSuperClasses().size() >= 2) {\n\n\t\t\t\tList<List<Class>> linExts = new ArrayList<List<Class>>();\n\t\t\t\tfor (int i = 0; i < c.getSuperClasses().size(); i++) {\n\t\t\t\t\tlinExts.add(this.linearExts.get(c.getSuperClasses().get(i)));\n\t\t\t\t\tlinExts.get(i).add(c.getSuperClasses().get(i));\n\t\t\t\t}\n\n\t\t\t\tList<HashSet<Class>> diffs = new ArrayList<HashSet<Class>>();\n\n\t\t\t\t// Compute lini - linj for all i != j\n\t\t\t\tfor (List<Class> linExt : linExts) {\n\t\t\t\t\tfor (List<Class> linExt2 : linExts) {\n\t\t\t\t\t\tif (linExt != linExt2) {\n\t\t\t\t\t\t\tHashSet<Class> diff = new HashSet<Class>();\n\t\t\t\t\t\t\tfor (Class p : linExt2) {\n\t\t\t\t\t\t\t\tif (!linExt.contains(p))\n\t\t\t\t\t\t\t\t\tdiff.add(p);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdiffs.add(diff);\n\n\t\t\t\t\t\t\tdiff = new HashSet<Class>();\n\t\t\t\t\t\t\tfor (Class p : linExt) {\n\t\t\t\t\t\t\t\tif (!linExt2.contains(p))\n\t\t\t\t\t\t\t\t\tdiff.add(p);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdiffs.add(diff);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Compute conflicts di * dj for all j != i\n\t\t\t\tfor (HashSet<Class> diff : diffs) {\n\t\t\t\t\tfor (HashSet<Class> diff2 : diffs) {\n\t\t\t\t\t\tif (diff != diff2) {\n\t\t\t\t\t\t\tfor (Class c1 : diff) {\n\t\t\t\t\t\t\t\tList<Class> conflicts = new ArrayList<Class>();\n\t\t\t\t\t\t\t\tif (this.conflictGraph.containsKey(c1))\n\t\t\t\t\t\t\t\t\tconflicts = this.conflictGraph.get(c1);\n\n\t\t\t\t\t\t\t\tfor (Class c2 : diff2) {\n\t\t\t\t\t\t\t\t\tconflicts.add(c2);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tthis.conflictGraph.put(c1, conflicts);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "String getRules();", "public static String getConflictsDescription(Set<? extends ConflictKnowledge<?>> conflicts, Locale locale)\n {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n PrependablePrintStream ps = new PrependablePrintStream(baos, \" \", 0);\n for (ConflictKnowledge<?> conflict : conflicts)\n {\n generateKnowledgeDescription(conflict, ps, locale);\n }\n ps.close();\n return baos.toString();\n }", "public void printRule()\n {\n System.out.print(lhs + \" ::= \");\n for( String s : rhsSymbols)\n System.out.print(s + \" \");\n System.out.println();\n }", "public void showRules(Application app){\n System.out.println(\"Here are your rules: \\n • GPA >= \" + app.getStand().getReqGPA() + \"\\n • SAT >= \" + app.getStand().getReqSAT() + \"\\n • A valid intended major, either aligned towards STEM or Humanities.\" + \"\\n • Three valid extracurriculars. \\n \\t • A valid extracurricular is defined as a productive use of time and/or a standout accomplishment. \\n \\t • It must align with the student's STEM or Humanities focus. \\n \\t • All three extracurriculars must be valid. \\n • A statement of purpose without spelling errors.\");\n System.out.println(\" • Students admitted to Harvard must have a passion for Humanities. Students admitted to MIT must have a passion for STEM. This can be determined through their intended major and extracurriculars, assuming both are valid.\");\n System.out.println(\" • All students with errors in their applications should be admitted to Greendale Community College.\");\n System.out.println();\n System.out.println(\"Good luck!\");\n }", "@Override\r\n public String toString() {\r\n return this.bnfRuleMap.keySet().toString();\r\n }", "private void updateFringeAndConflicts(List<String> changed) {\n //update fringe\n for (Clause ci : fringe) {\n for (CLiteral l : ci.getCLiterals()) {\n if (changed.contains(l.getName())) {\n ci.updateClause(labels);\n if ( ci.numOfNegative>0)\n // else if (c.numUnknownLiterals==0 && c.numOfNegative==c.numUnknownLiterals)\n if (!conflicts.contains(ci)) {\n if (conflicts.size()+1<=maxConflicts)\n conflicts.add(ci);\n\n break;\n }\n }\n }\n }\n\n // check rest of clauses which not in fringe or conflicts.\n for (Clause c : clauses) {\n if (!fringe.contains(c) && !conflicts.contains(c)) {\n for (CLiteral l : c.getCLiterals()) {\n if (changed.contains(l.getName())) {\n c.updateClause(labels);\n\n if (c.getNumUnknownLiterals() == 1 && c.getNumOfNegative() == c.getNumOfLiterals() - c.getNumUnknownLiterals()) {\n fringe.push(c);\n break;\n } else if (c.numOfNegative >0) {\n // else if (c.numUnknownLiterals==0 && c.numOfNegative==c.numUnknownLiterals)\n if (!conflicts.contains(c)) {\n if (conflicts.size()+1<=maxConflicts)\n conflicts.add(c);\n\n break;\n }\n }\n }\n }\n }\n }\n }", "public ArrayList<Clause> solve() {\n for (Clause c : clauses) {\n for (CLiteral l : c.getCLiterals()) {\n if (labels.get(l.getName()) == null)\n labels.put(l.getName(), -1);\n }\n }\n init();\n\n return (ArrayList<Clause>) conflicts;\n }", "public void showRules() {\r\n data.rulesFlag = true;\r\n setChanged();\r\n notifyObservers(data);\r\n data.rulesFlag = false;\r\n }", "public String toDebugString(RuleSet rs){\n\t\tString res = \"\";\n\t\tif(body != null)\n\t\t\tfor(Integer e : body){\n\t\t\t\tres = res + (res.equals(\"\") ? \"\" : \" & \") + OWLPrinter.getString(rs.debugLookup(e));\n\t\t\t}\n\n\t\tres += \" -> \";\n\t\tif(head != null) res += OWLPrinter.getString(rs.debugLookup(head));\n\t\telse{\n\t\t\tres += OWLPrinter.getString(rs.debugLookup(axiom));\n\t\t\tif(define != null){\n\t\t\t\tres += \" def \" + OWLPrinter.getString(rs.debugLookup(define));\n\t\t\t}\n\t\t}\n\n\t\t//if(head instanceof OWLAxiom) \tres += \" -> \" + ClassPrinter.printAxiom((OWLAxiom) head);\n\t\t//else \t\t\t\t\t\t\tres += \" -> \" + ClassPrinter.printClass(head);\n\t\treturn res;\n\t}", "public static List<ExtendRule> removeRedundantExtendedRules_rangeBased(List<ExtendRule> rules) {\n LOGGER.info(\"STARTED removeRedundantExtendedRules - range based\");\n LOGGER.info(\"Rules on start:\" + rules.size());\n ExtendRule defRule = rules.get(rules.size()-1);\n Consequent defClass = defRule.getConsequent(); \n for (Iterator<ExtendRule> it = rules.iterator(); it.hasNext();) { \n ExtendRule PRCandidate = it.next();\n // PRCandidate = go through all rules with default class in the consequent\n if (!PRCandidate.getConsequent().toString().equals(defClass.toString()))\n {\n continue;\n }\n // skip default rule\n if (PRCandidate.equals(defRule))\n {\n continue;\n } \n ArrayList<RuleMultiItem> PR_items = PRCandidate.getAntecedent().getItems();\n //create hashmap for fast access\n HashMap<Attribute,RuleMultiItem> PR_itemsMap = new HashMap();\n for (RuleMultiItem rmi : PR_items)\n {\n PR_itemsMap.put(rmi.getAttribute(), rmi);\n }\n \n // check if there is no other rule classifying to different class that shares part of the region\n // matched by the antecedent of PRCandidate \n boolean clashingRuleFound=false;\n boolean positionBelowPRCand = false;\n for (Iterator<ExtendRule> innerIt = rules.iterator(); innerIt.hasNext();) {\n ExtendRule candidateClash = innerIt.next();\n // candidateClash is PRCandidate, which would always evaluate to overlap!\n\n if (candidateClash.equals(PRCandidate))\n {\n positionBelowPRCand=true;\n continue;\n }\n // candidateClash = go through all rules with OTHER than default class in consequent \n if (candidateClash.getConsequent().toString().equals(defClass.toString()))\n {\n continue;\n }\n if (!positionBelowPRCand) continue;\n \n // check if at leat one literal in PRCandidate has empty intersection with Clash on shared attribute\n \n //in case there is no shared attribute, the intersection is non empty\n ArrayList<RuleMultiItem> literalsInClashOnSharedAtt = new ArrayList();\n for (RuleMultiItem clash_rmi : candidateClash.getAntecedent().getItems())\n {\n if (PR_itemsMap.containsKey(clash_rmi.getAttribute()))\n {\n literalsInClashOnSharedAtt.add(clash_rmi);\n }\n } \n if (literalsInClashOnSharedAtt.isEmpty())\n {\n clashingRuleFound =true;\n break;\n }\n // if there is NO intersection on at leat one of the shared attributes => no CLASH\n // ELSE => CLASH\n boolean attLeastOneAttDisjunct=true;\n for (RuleMultiItem clash_rmi : literalsInClashOnSharedAtt)\n {\n //PRCandidate has a literal created over the same attribute\n RuleMultiItem machingPR_RMI = PR_itemsMap.get(clash_rmi.getAttribute());\n\n //do values in the candidate clash intersect with values in PRCandidate?\n \n for (AttributeValue v : machingPR_RMI.getAttributeValues())\n {\n if (clash_rmi.getAttributeValues().contains(v))\n {\n attLeastOneAttDisjunct=false;\n }\n }\n if (attLeastOneAttDisjunct) // if we have non-empty intersection on one att we do not have to test the other ones, rule matches different part of the data space\n {\n //go to next PRCandidate \n break;\n } \n } \n if (!attLeastOneAttDisjunct)\n {\n //go to next PRCandidate \n clashingRuleFound=true;\n break;\n } \n }\n if (clashingRuleFound == false)\n {\n //no other rule with different consequent covering at least one shared value was found\n //this rule can be removed\n LOGGER.fine(\"Removing rule:\" + PRCandidate.toString());\n it.remove();\n } \n }\n LOGGER.info(\"Rules on finish:\" + rules.size());\n LOGGER.info(\"FINISHED removeRedundantExtendedRules - range based\");\n return rules;\n }", "public void analize() {\n\t\t//clearing dropping rules\n\t\tthis.droppingRules.clear();\n\t\t//analysing new rules\n\t\tanalizeParts();\n\t}", "@Override\n public String toString() {\n return String.format(\"set: {%s}\", getSortedReplacements().toString());\n }", "public static <T> void displayMessages(Set<ConstraintViolation<T>> violations) {\r\n\t\tfor (final ConstraintViolation<?> constraintViolation : violations) {\r\n\t\t\tSystem.out.println(constraintViolation.getMessage());\r\n\t\t}\r\n\t\tSystem.out.println(\"====================================================\");\r\n\t}", "public String toString() {\n return this.grammarRules.keySet() + \"\";\n\t}", "public int getConflicts() {\r\n return conflicts;\r\n }", "public void displayRules(TextArea textArea) {\r\n textArea.appendText(\"\\n\" + name + \" Rule Base: \" + \"\\n\");\r\n Enumeration enum2 = ruleList.elements() ;\r\n while(enum2.hasMoreElements()) {\r\n Rule temp = (Rule)enum2.nextElement() ;\r\n temp.display(textArea) ;\r\n }\r\n }", "@Override\r\n\tpublic final void onConstraintViolation(Set<ConstraintViolation<?>> violations) {\n\t\tList<ConstraintViolation<?>> violationsWithOrder = Lists.newArrayList(violations);\r\n\t\t\r\n\t\tCollections.sort(violationsWithOrder, new Comparator<ConstraintViolation<?>>() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic int compare(ConstraintViolation<?> o1, ConstraintViolation<?> o2) {\r\n\t\t\t\t\r\n\t\t\t\treturn o1.getPropertyPath().toString().compareToIgnoreCase(o2.getPropertyPath().toString());\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tArrayList<String> messages = Lists.newArrayList();\r\n\t\t\r\n\t\tfor (ConstraintViolation<?> constraintViolation : violationsWithOrder) {\r\n\t\t\tString path = constraintViolation.getPropertyPath().toString();\r\n\t\t\tString message;\r\n\t\t\ttry {\r\n\t\t\t\tLog.debug(\"constraintViolation message: \" + constraintViolation.getMessage());\r\n\t\t\t\tmessage = enumConstants.getString(constraintViolation.getMessage());\r\n\t\t\t}catch (Exception e) {\r\n\t\t\t\tmessage = path + \" \" + constraintViolation.getMessage();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tmessages.add(message);\r\n\t\t\t\r\n\t\t\tif(localViewMap.containsKey(path)) {\r\n\t\t\t\t//Log.info(\"Violated key: \" + path);\r\n\t\t\t\t//Log.info(\"Violated value: \" + localViewMap.get(path));\r\n\t\t\t\tlocalViewMap.get(path).addStyleName(\"higlight_onViolation\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tshowMessage(messages);\r\n\t}", "public static void printRules(Rule[] rules) {\n System.out.println(\"\\nRulebase generated\\n------------------\");\n int i =1;\n for (Rule rule : rules) {\n String cond = \"\";\n for (int j = 0; j < rule.cond.length; j++) {\n cond = cond + rule.cond[j];\n }\n String output = rule.output;\n System.out.println(\"Rule\" + i + \" : \" + cond + \" = \" + output);\n i++;\n }\n System.out.println(\"\\n\");\n }", "public void printConstraint() {\n\t\tSystem.out.println(this.object + \" \" + this.closeObject + \" \" + this.farObject);\r\n\t}", "public String toString() {\n\n if (m_rules == null) {\n return \"Prism: No model built yet.\";\n }\n return \"Prism rules\\n----------\\n\" + m_rules.toString();\n }", "private String getRulesOfBestSolutionAsHumanReadableString() {\n\t\t// TODO change this to actually save the text in a file, and maybe in a cleaner format...\n\t\tIndividual bestSolution = this.controller.getBestSolution();\n\t\t\n\t\tVector<Rule> bestSolutionRules = bestSolution.getRules();\n\n\t\tString humanReadableRulesOfBestSolution = \"Add element to summary if (\";\n\t\tfor (int i = 0; i < bestSolutionRules.size(); i++) {\n\t\t\thumanReadableRulesOfBestSolution += \" ( \"; \n\t\t\tint j = 0;\n\t\t\tfor (Entry<String, Integer> entry : bestSolutionRules.get(i).getThresholds().entrySet()) {\n\t\t\t\t\n\t\t\t\thumanReadableRulesOfBestSolution += entry.getKey() + \" > \" + entry.getValue();\n\t\t\t\tString logicalConnector = ( j < bestSolutionRules.get(i).getAndBetweens().size() ? (bestSolutionRules.get(i).getAndBetweens().get(j) ? \" && \" : \" OR \") : (\"\"));\n\t\t\t\thumanReadableRulesOfBestSolution += logicalConnector;\n\t\t\t\tj++;\n\t\t\t}\n\t\t\thumanReadableRulesOfBestSolution += \" )\";\n\t\t\tif ( bestSolutionRules.size() - 1 > i ) {\n\t\t\t\thumanReadableRulesOfBestSolution += \" || \"; \n\t\t\t}\n\t\t}\n\t\thumanReadableRulesOfBestSolution += \")\\n\";\n\t\t\n\t\treturn humanReadableRulesOfBestSolution;\n\t}", "public List<String> getRulesName(){\r\n\t\tList<String> names = new ArrayList<String>();\r\n\r\n\t\tfor(Column c: columns)\r\n\t\t\tnames.add(c.getRuleName());\r\n\r\n\t\treturn names;\r\n\t}", "void printSubgraphs() {\n StringBuilder sb = new StringBuilder();\n for(int sgKey: listOfSolutions.keySet()) {\n HashMap<Integer, Long> soln = listOfSolutions.get(sgKey);\n // inside a soln\n //sb.append(\"S:8:\");\n for(int key: soln.keySet()) {\n sb.append(key + \",\" + soln.get(key) + \";\");\n\n }\n sb.setLength(sb.length() - 1);\n sb.append(\"\\n\");\n }\n System.out.println(\"\\n\" + sb.toString());\n }", "public void printExitDiscrepancies() {\n// violations.stream()\n// .filter((ValidationError t) -> t.getType() == ValidationError.ViolationType.SYSTEM)\n// .forEach(e -> {\n// System.out.println(e.getEmployee());\n// });\n printEmployeesForViolationType(ValidationError.ViolationType.SYSTEM);\n }", "@Override\n public List<GraphModification> debugRules (HashMap<String, String> graphs, TransformationContext context, TableVersion tableVersion)\n\t\t\tthrows TransformerException {\n\t\ttry {\n\t\t\tCollection<String> originalGraphs = graphs.keySet();\n\n\t\t\t/**\n\t\t\t * Start collecting modifications of the individual graphs\n\t\t\t */\n\t\t\tList<GraphModification> result = new ArrayList<GraphModification>();\n\n\t\t\tIterator<String> it = originalGraphs.iterator();\n\n\t\t\t/**\n\t\t\t * In case we need to know what changed we need to create copies of the graph to compare them after\n\t\t\t * the rule was applied\n\t\t\t */\n\t\t\tUniqueURIGenerator generator = new UUIDUniqueURIGenerator(ODCSInternal.DEBUG_TEMP_GRAPH_URI_PREFIX + this.getClass().getSimpleName() + \"/diff/\");\n\n\t\t\toriginal = generator.nextURI();\n\t\t\tmodified = generator.nextURI();\n\n\t\t\twhile (it.hasNext()) {\n\t\t\t\tString originalName = it.next();\n\t\t\t\tString temporaryName = graphs.get(originalName);\n\n\t\t\t\tGraphModification subResult = getGraphModifications(temporaryName,\n\t\t\t\t\t\tcontext.getCleanDatabaseCredentials(),\n\t\t\t\t\t\tcontext.getDirtyDatabaseCredentials(),\n\t\t\t\t\t\ttableVersion);\n\t\t\t\tsubResult.setGraphName(originalName);\n\n\t\t\t\tresult.add(subResult);\n\t\t\t}\n\n\t\t\treturn result;\n\t\t} catch (Exception e) {\n\t\t\tLOG.error(\"Debugging of Data Normalization rules failed.\");\n\n\t\t\tthrow new TransformerException(e);\n\t\t}\n\t}", "private void cleanMnemonicsConflict() {\n Enumeration enumer = mnemonicConflict.keys();\n \n while(enumer.hasMoreElements()) {\n String key = (String)enumer.nextElement();\n HashSet hs = (HashSet)mnemonicConflict.get(key);\n if(hs.size()==1)\n mnemonicConflict.remove(key);\n }\n \n }", "private void filterAllRuleSetsForConfAndLift()\n\t{\n\t\truleCollection.forEach(lastRules->{\n\t\t\t\n\t\t\tif(!ListHelper.isNullOrEmpty(lastRules))\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Current Filter Rule Size:\"+lastRules.get(0).getRuleSize());\n\t\t\t}\n\t\t\t\n\t\t\tIterator<RuleCompartment<T>> iter = lastRules.iterator();\n\t\t\t\n\t\t\twhile(iter.hasNext())\n\t\t\t{\n\t\t\t\tRuleCompartment<T> eachRule = iter.next();\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tint ruleLength = eachRule.getRuleSize();\n\t\t\t\t\t\t\t\n\t\t\t\tif(ruleLength<config.getMinRuleLength())\n\t\t\t\t{\n\t\t\t\t\titer.remove();\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tdouble conf = eachRule.calculateConfidence(storage, evaluation);\n\t\t\t\t\n\t\t\t\tif(conf < config.minConf())\n\t\t\t\t{\n\t\t\t\t\titer.remove();\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tif(config.minLift()>0)\n\t\t\t\t{\n\t\t\t\t\tdouble lift = eachRule.calculateLift(storage, evaluation);\n\t\t\t\t\t\n\t\t\t\t\tif(lift < config.minLift())\n\t\t\t\t\t{\n\t\t\t\t\t\titer.remove();\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "public abstract void printConstraint();", "private void printContrib() {\n \t\tSystem.out.println(\"-- Current Contributions --\");\n \t\tfor (int y = 0; y < contrib.length; y++) {\n \t\t\tfor (int x = 0; x < contrib[y].length; x++) {\n \t\t\t\tString s = contrib[y][x] == null ? \"-\" : (\"\" + contrib[y][x].current);\n \t\t\t\twhile (s.length() < 4)\n \t\t\t\t\ts = \" \" + s;\n \t\t\t\tSystem.out.print(s);\n \t\t\t}\n \t\t\tSystem.out.println();\n \t\t}\n \t\tSystem.out.println();\n \t\tSystem.out.println(\"-- Target Contributions --\");\n \t\tfor (int y = 0; y < contrib.length; y++) {\n \t\t\tfor (int x = 0; x < contrib[y].length; x++) {\n \t\t\t\tString s = contrib[y][x] == null ? \"-\" : (\"\" + contrib[y][x].target);\n \t\t\t\twhile (s.length() < 4)\n \t\t\t\t\ts = \" \" + s;\n \t\t\t\tSystem.out.print(s);\n \t\t\t}\n \t\t\tSystem.out.println();\n \t\t}\n \t}", "public static List<ExtendRule> removeRedundantExtendedRules_transactionBased(List<ExtendRule> rules) {\n LOGGER.info(\"STARTED removeRedundantExtendedRules - transaction based\");\n LOGGER.info(\"Rules on start:\" + rules.size());\n ExtendRule defRule = rules.get(rules.size()-1);\n if (defRule.getAntecedent().getItems().size()>0)\n {\n LOGGER.warning(\"Default rule is not last rule. Returning null. Last rule:\" + defRule.toString() );\n \n return null;\n }\n Consequent defClass = defRule.getConsequent(); \n for (Iterator<ExtendRule> it = rules.iterator(); it.hasNext();) { \n ExtendRule PRCandidate = it.next();\n // PRCandidate = go through all rules with default class in the consequent\n if (!PRCandidate.getConsequent().toString().equals(defClass.toString()))\n {\n\n }\n // skip default rule\n else if (PRCandidate.equals(defRule))\n {\n \n } \n else{\n Set<Transaction> suppTran = PRCandidate.getAntecedent().getSupportingTransactions();\n // get transactions only CORRECTLY classified by the candidate rule\n Set<Transaction> consTran = PRCandidate.getConsequent().getSupportingTransactions();\n suppTran.retainAll(consTran);\n\n // Check if transactions correctly classified by pruning candidate intersect with transactions covered by those rules below prunCand in the rule list that assign to different than default class. If there are no such transactions PRCandidate can be removed\n boolean nonEmptyIntersection=false;\n boolean positionBelowPRCand = false;\n for (Iterator<ExtendRule> innerIt = rules.iterator(); innerIt.hasNext();) {\n ExtendRule candidateClash = innerIt.next();\n // candidateClash is PRCandidate, which would always evaluate to overlap!\n if (candidateClash.equals(PRCandidate))\n {\n positionBelowPRCand = true;\n continue;\n }\n if (!positionBelowPRCand) continue;\n // candidateClash = go through all rules with OTHER than default class in consequent \n if (candidateClash.getConsequent().toString().equals(defClass.toString()))\n {\n continue;\n }\n\n // check if transactions covered by PRCandidate intersect with transactions covered by candidateClash \n\n for (Transaction t : candidateClash.getAntecedent().getSupportingTransactions())\n {\n\n if (suppTran.contains(t))\n {\n nonEmptyIntersection=true;\n }\n break;\n } \n if (nonEmptyIntersection)\n {\n //go to next PRCandidate \n break;\n } \n }\n if (nonEmptyIntersection == false)\n {\n //no other rule with different consequent covering at least one shared transaction was found\n //this rule can be removed\n LOGGER.fine(\"Removing rule:\" + PRCandidate.toString());\n it.remove();\n } \n }\n \n }\n LOGGER.info(\"Rules on finish:\" + rules.size());\n LOGGER.info(\"FINISHED removeRedundantExtendedRules - transaction based\");\n return rules;\n }", "private void resolveConflicts( Grammar grammar, State state, List<Action> tshifts, List<Action> ntshifts)\n {\n List<State> splits = new ArrayList<State>();\n\n Collections.sort( tshifts);\n Collections.sort( ntshifts);\n \n State currSplit = null;\n State prevSplit = null;\n for( int i=1, k=1; i<tshifts.size(); i++, k++)\n {\n prevSplit = currSplit;\n currSplit = null;\n \n Action prev = tshifts.get( i-1);\n Action curr = tshifts.get( i);\n \n if ( isOverlapping( prev.symbols, curr.symbols))\n {\n boolean conflict =\n (curr.type == Action.Type.tshift && prev.type == Action.Type.reduce) || \n (curr.type == Action.Type.reduce && prev.type == Action.Type.tshift) ||\n (curr.type == Action.Type.reduce && prev.type == Action.Type.reduce) ||\n (curr.type == Action.Type.tshift && prev.type == Action.Type.tshift);\n\n if ( conflict)\n {\n long prevPriority = prev.getPriority();\n long currPriority = curr.getPriority();\n if ( prevPriority < currPriority)\n {\n log.debugf( \"\\nConflict in state %d:\\n %s\\n %s\", state.index, prev, curr);\n log.debug( \"Conflict resolved: second rule(s) have higher priority\");\n deleteStackOp( state, k-1); k--;\n }\n else if ( prevPriority > currPriority)\n {\n log.debugf( \"\\nConflict in state %d:\\n %s\\n %s\", state.index, prev, curr);\n log.debug( \"Conflict resolved: first rule(s) have higher priority\");\n deleteStackOp( state, k); k--;\n }\n else\n {\n log.warnf( \"\\nConflict in state %d:\\n %s\\n %s\", state.index, prev, curr);\n log.warn( \"Conflict resolved by splitting state\");\n splitState( state, k, prevSplit, splits);\n currSplit = splits.get( splits.size() - 1);\n conflicts++;\n }\n }\n }\n }\n \n for( int i=1; i<ntshifts.size(); i++)\n {\n prevSplit = currSplit;\n currSplit = null;\n \n Action prev = ntshifts.get( i-1);\n Action curr = ntshifts.get( i);\n \n if ( curr.symbols[ 0] <= prev.symbols[ 0])\n {\n if ( curr.type == Action.Type.ntshift && prev.type == Action.Type.ntshift && curr.itemSet.equals( prev.itemSet))\n {\n log.warnf( \"\\nConflict in state %d:\\n %s\\n %s\", state.index, prev, curr);\n conflicts++;\n }\n }\n }\n \n if ( splits.size() > 0)\n {\n for( State split: splits) \n {\n log.debugf( \"Created new state %d to resolve conflict.\", split.index);\n removeNulls( split);\n \n for( StackOp shift: split.stackOps)\n {\n if ( shift == nullShift)\n throw new IllegalStateException();\n }\n }\n\n state.splits = splits.toArray( new State[ 0]);\n state.stackOps = null;\n state.gotos = null;\n }\n }", "public void deduceRules()\n{\n List<RuleInstance> allrules = loadRules();\n\n List<UpodRule> rules = new ArrayList<UpodRule>();\n for (UpodRule ur : for_program.getRules()) {\n if (ur.isExplicit()) {\n\t rules.add(ur);\n\t RuleInstance ri = new RuleInstance(ur,from_world.getUniverse());\n\t allrules.add(ri);\n }\n }\n\n Set<Condition> allconds = getConditions(allrules);\n\n tree_root = new TreeNode(allrules,null);\n\n expandTree(tree_root,allconds);\n\n generateRules(tree_root);\n}", "public String[] getRuleSetNames()\n/* */ {\n/* 945 */ return (String[])this.publicRuleSetNames.clone();\n/* */ }", "public void printArrivalDiscrepancies() {\n// violations.stream()\n// .filter((ValidationError t) -> t.getType() == ValidationError.ViolationType.REENTRY)\n// .forEach(e -> {\n// System.out.println(e.getEmployee());\n// });\n printEmployeesForViolationType(ValidationError.ViolationType.REENTRY);\n }", "List<RuleInfo> listRulesInfo() throws IOException;", "private void fillDistinctRules(){\n\tint totRules =0;\n\tfor(int i=1;i<ConditionTree.length;i++){\n\t\tif((!ConditionTree[i][1].equals(ConditionTree[i-1][1])) && ConditionTree[i][4].equals(\"String\")){\n\t\t\ttotRules++;\n\t\t}\n\t}\n\n\tdistinctRules = new String[totRules][2];\n\n\t//filling distinct rules array first column i-e rules names only\n\tint disRulIndex = 0;\n\tfor(int i=1;i<ConditionTree.length;i++){\n\t\tif((!ConditionTree[i][1].equals(ConditionTree[i-1][1])) && ConditionTree[i][4].equals(\"String\")){\n\t\t\tdistinctRules[disRulIndex][0] = ConditionTree[i][1];\n\t\t\tdisRulIndex++;\n\t\t}\n\t}\n\t\n\t\n\t\n\tfor(int a=0;a<distinctRules.length;a++){\n\t\tdistinctRules[a][1] = \"\";\n\t\tfor(int i=0;i<ConditionTree.length;i++){\n\t\t\tif(distinctRules[a][0].equals(ConditionTree[i][1])){\n\t\t\t\tdistinctRules[a][1] += ConditionTree[i][3] + \",\";\n\t\t\t}\n\t\t}\n\t\t//removing the last comma\n\t\tdistinctRules[a][1] = distinctRules[a][1].substring(0, distinctRules[a][1].length()-1);\n//\t\tSystem.out.println(distinctRules[a][0] + \" : \" + distinctRules[a][1]);\n\t}\n}", "private static String numberOfViolatedRulesIn(GitHubProject project) {\n Optional<RatingValue> ratingValue = project.ratingValue();\n if (!ratingValue.isPresent()) {\n return \"UNKNOWN\";\n }\n\n int n = findViolatedRulesIn(ratingValue.get().scoreValue().usedValues()).size();\n\n if (n == 0) {\n return \"No violated rules\";\n }\n\n return String.format(\"%d violated rule%s\", n, n > 1 ? \"s\" : \"\");\n }", "public void pruneRules_cbaLike() {\n LOGGER.info(\"STARTED Postpruning\");\n //HashMap<ExtendRule,Integer> ruleErrors = new HashMap();\n //HashMap<ExtendRule,AttributeValue> ruleDefClass = new HashMap();\n ArrayList<ExtendRule> rulesToRemove = new ArrayList(); \n int totalErrorsWithoutDefault = 0; \n AttributeValue defClassForLowestTotalErrorsRule = getDefaultRuleClass();\n int lowestTotalErrors = getDefaultRuleError(defClassForLowestTotalErrorsRule);;\n ExtendRule lowestTotalErrorsRule = null;\n // DETERMINE TOTAL ERROR AND DEFAULT CLASS ASSOCIATED WITH EACH RULE \n // REMOVE RULES MATCHING ZERO TRANSACTIONS AND OF ZERO LENGTH\n for (Iterator<ExtendRule> it = extendedRules.iterator(); it.hasNext();) {\n\n ExtendRule rule = it.next();\n rule.updateQuality();\n rule.setQualityInRuleList(rule.getRuleQuality());\n if (LOGGER.isLoggable(Level.FINE)) {\n LOGGER.log(Level.FINE, \"Processing rule {0}\", rule.toString());\n }\n\n if (rule.getAntecedentLength() == 0) {\n LOGGER.fine(\"Rule of length 0, MARKED FOR REMOVAL\");\n rulesToRemove.add(rule); //covered transactions should not be removed\n } \n else if (rule.getRuleQuality().getA() == 0)\n {\n LOGGER.fine(\"Rule classifying 0 instances correctly, MARKED FOR REMOVAL\");\n rulesToRemove.add(rule); //covered transactions should not be removed \n }\n else\n {\n rule.removeTransactionsCoveredByAntecedent(true); \n totalErrorsWithoutDefault = totalErrorsWithoutDefault + rule.getRuleQuality().getB();\n // since transactions matching the current rule have been removed, the default class and error can change\n AttributeValue newDefClass = getDefaultRuleClass();\n int newDefError = getDefaultRuleError(newDefClass);\n int totalErrorWithDefault = newDefError + totalErrorsWithoutDefault;\n if (totalErrorWithDefault < lowestTotalErrors)\n {\n lowestTotalErrors = totalErrorWithDefault;\n lowestTotalErrorsRule = rule;\n defClassForLowestTotalErrorsRule= newDefClass;\n } \n //ruleErrors.put(rule,totalErrorWithDefault );\n //ruleDefClass.put(rule, newDefClass); \n }\n \n }\n boolean removeTail;\n // now we know the errors associated with each rule not marked for removal, we can perform pruning\n if (lowestTotalErrorsRule == null)\n {\n // no rule improves error over a classifier composed of only default rule\n // remove all rules\n removeTail = true;\n }\n else \n {\n removeTail = false;\n }\n \n data.getDataTable().unhideAllTransactions();\n for (Iterator<ExtendRule> it = extendedRules.iterator(); it.hasNext();) {\n ExtendRule rule = it.next();\n if (rulesToRemove.contains(rule) || removeTail)\n {\n it.remove();\n continue;\n }\n if (rule.equals(lowestTotalErrorsRule))\n {\n removeTail = true;\n }\n rule.updateQuality(); \n }\n \n \n if (LOGGER.isLoggable(Level.FINE)) {\n LOGGER.fine(\"Creating new default rule within narrow rule procedure\");\n }\n \n \n extendedRules.add(createNewDefaultRule(defClassForLowestTotalErrorsRule));\n \n \n LOGGER.info(\"FINISHED Postpruning\");\n }", "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 boolean isConflicting (RuleSet ruleset) {\n \n if (this.id == ruleset.id)\n return false; \n \n if (!this.getPrecursorWithID().sensorMatch(ruleset.getPrecursorWithID()))\n return false;\n \n \n for (int i = 0; i < this.getSuccessor().size(); i++) {\n \n if ((this.getSuccessor().getToken(i).isNotWildcard()) && (ruleset.getSuccessor().getToken(i).isNotWildcard())) {\n \n //if (this.getPrecursorOccurrencies() <= ruleset.getPrecursorOccurrencies())\n return true; \n }\n }\n \n \n return false;\n }", "public void setConflicts(int conflicts) {\r\n this.conflicts = conflicts;\r\n }", "private void outputDiff() {\n this.pw.println(\"Change\\t\" + \"Subset\\t\" + \"Concept\\t\"\r\n + \"Value Changed\\t\" + \"Old Value\\t\" + \"New Value\");\r\n for (final DiffElement de : this.diffSet) {\r\n this.pw.println(de.toString());\r\n }\r\n this.pw.close();\r\n\r\n }", "public String[] getRuleSetDisplayNames(ULocale loc)\n/* */ {\n/* 996 */ String[] names = getNameListForLocale(loc);\n/* 997 */ if (names != null) {\n/* 998 */ return (String[])names.clone();\n/* */ }\n/* 1000 */ names = getRuleSetNames();\n/* 1001 */ for (int i = 0; i < names.length; i++) {\n/* 1002 */ names[i] = names[i].substring(1);\n/* */ }\n/* 1004 */ return names;\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}", "Collection<RuleViolation> findViolations(\n File projectRoot,\n List<File> files,\n List<Rule> rule,\n CLIConfigForStaticAnalyzer cliOptions);", "private Collection<Rule> getRelevantRules(List<Expr> goals, Collection<Expr> edbList, Collection<Rule> idbList) {\n Set<Rule> relevant = new HashSet<Rule>();\n goals = new LinkedList<Expr>(goals);\n while (!goals.isEmpty()) {\n Expr expr = goals.remove(0);\n for (Rule rule : idbList) {\n if (rule.head.predicate.equals(expr.predicate) && !relevant.contains(rule)) {\n relevant.add(rule);\n goals.addAll(rule.body);\n }\n }\n }\n return relevant;\n }", "private Set<Norm> regulateConflicts(Map<Goal, List<Conflict>> conflicts) {\n\t\tHashSet<Norm> createdNorms = new HashSet<Norm>();\n\t\tSet<Norm> normsForConflict;\n\t\t\n\t\tfor(Goal goal : conflicts.keySet()) {\n\t\t\tfor(Conflict conflict : conflicts.get(goal)) {\n\t\t\t\tnormsForConflict = this.regulateConflict(conflict, goal);\n\t\t\t\tcreatedNorms.addAll(normsForConflict);\n\t\t\t}\n\t\t}\n\t\treturn createdNorms;\n\t}", "public void print()\n/* */ {\n/* 226 */ boolean emptyTarget = true;\n/* 227 */ Iterator it; if ((this.subjects != null) && (this.subjects.size() > 0)) {\n/* 228 */ System.out.println(\"\\nSubjects ---->\");\n/* 229 */ emptyTarget = false;\n/* 230 */ for (it = this.subjects.iterator(); it.hasNext();)\n/* 231 */ ((MatchList)it.next()).print();\n/* */ }\n/* 234 */ if ((this.resources != null) && (this.resources.size() > 0)) {\n/* 235 */ System.out.println((emptyTarget ? \"\\n\" : \"\") + \"Resources ---->\");\n/* 236 */ emptyTarget = false;\n/* 237 */ for (it = this.resources.iterator(); it.hasNext();)\n/* 238 */ ((MatchList)it.next()).print();\n/* */ }\n/* 241 */ if ((this.actions != null) && (this.actions.size() > 0)) {\n/* 242 */ System.out.println((emptyTarget ? \"\\n\" : \"\") + \"Actions ---->\");\n/* 243 */ emptyTarget = false;\n/* 244 */ for (it = this.actions.iterator(); it.hasNext();)\n/* 245 */ ((MatchList)it.next()).print();\n/* */ }\n/* 248 */ if ((this.environments != null) && (this.environments.size() > 0)) {\n/* 249 */ System.out.println((emptyTarget ? \"\\n\" : \"\") + \"Environments ---->\");\n/* 250 */ emptyTarget = false;\n/* 251 */ for (it = this.environments.iterator(); it.hasNext();) {\n/* 252 */ ((MatchList)it.next()).print();\n/* */ }\n/* */ }\n/* 255 */ if (emptyTarget) System.out.print(\"EMPTY\");\n/* */ }", "public Formula encodeConflictFree() {\n\t\tConjunction result = new Conjunction(\"conflictfree\");\n\t\tSet<Argument> args = this.instance.getAllArguments();\n\t\tfor(Argument a : args) {\n\t\t\tresult.addSubformula(this.clause(a));\n\t\t}\n\t\treturn result;\n\t}", "public void printContribuintes (){\n for(String s : contribuintes.keySet()){\n System.out.printf(\"%s\",getContribuinte(s).toString());\n }\n }", "public void printAllConstraints() {\n\t\tSystem.out.println(\"Printing all constraints\");\n\t\tfor (int row = 0; row < Sudoku.ROWS; row++ ) {\n\t\t\tfor (int col = 0; col < Sudoku.COLUMNS; col++) {\n\t\t\t\tSystem.out.printf(\"Constraints of (%d, %d): {\", row, col);\n\t\t\t\tSudoku.grid[row][col].printVariableConstraints();\n\t\t\t\tSystem.out.print(\"}\\n\");\n\t\t\t}\n\t\t}\n\t}", "public void printFaultyEmployees() {\n System.out.println(localizer.getString(Messages.INVALID_LINES, violations.size()));\n }", "@Override\n public List getRules() {\n return rules;\n }", "ImmutableList<SchemaOrgType> getAccessibilityHazardList();", "public void cleanPrintSetOutWithDontCares(int formula){\n\t\t\n\t\t\n\t\tif(formula ==1){\n\t\t\tSystem.out.println(\"TRUE\");\n\t\t\treturn;\n\t\t}\n\t\t\n\n\t\tArrayList<String> minterms = BDDWrapper.mintermsWithDontCares(bdd, formula, variables);\n\t\tif(minterms == null){\n\t\t\tSystem.out.println(\"FALSE\");\n\t\t\treturn;\n\t\t}\n\t\tfor(String minterm : minterms ){\n//\t\t\tSystem.out.println(\"mintrem is \"+minterm);\n\t\t\tint index = 0;\n\t\t\t//print density vars\n\t\t\tSystem.out.print(\"densityVars: \");\n\t\t\tfor(int i=0; i<coordinationGameStructure.densityVars.size(); i++){\n\t\t\t\tString value = minterm.substring(index, index+coordinationGameStructure.densityVars.get(i).length);\n\t\t\t\tindex+=coordinationGameStructure.densityVars.get(i).length;\n\t\t\t\tSystem.out.print(value+\" \");\n\t\t\t}\n\t\t\t//tasks\n\t\t\tSystem.out.print(\"Tasks: \");\n\t\t\tString value = minterm.substring(index, index+coordinationGameStructure.taskVars.length);\n\t\t\tindex+= coordinationGameStructure.taskVars.length;\n\t\t\tSystem.out.print(value);\n\t\t\tSystem.out.print(\" Signals: \");\n\t\t\tString successSignalsValues = minterm.substring(index, index+coordinationGameStructure.successSignals.length);\n\t\t\tindex+=coordinationGameStructure.successSignals.length;\n\t\t\tSystem.out.print(successSignalsValues);\n\t\t\tSystem.out.print(\" Counter: \");\n\t\t\tString counterValue = minterm.substring(index);\n\t\t\tSystem.out.print(counterValue);\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public void printWarning(){\n if (hasWarning()){\n System.err.println(\"Warning in line \"+filterLineNumber);\n }\n }", "public String toDisplayString() {\n return errors.stream()\n .sorted()\n .map(e -> e.toDisplayString(source))\n .collect(Collectors.joining(\"\\n\"));\n }", "@Nonnull\n public List<Conflict> getAllConflictsInvolving(State state) {\n return conflicts.stream().filter(conflict -> conflict.getSideOf(state) != null).collect(Collectors.toList());\n }", "public void printByResource() {\r\n TUseStatus useStatus;\r\n\t for (int b=0; b < m_current_users_count; b++)\r\n\t for (int a=0; a < m_current_resources_count; a++) {\r\n\t useStatus = m_associations[a][b];\r\n\t if (useStatus!=null) System.out.println(useStatus.toString()); \r\n\t } \r\n }", "public Set<OWLLogicalAxiom> canWeDoBetter(){\n\t\tSet<Set<OWLClass>> largeSCCs =\n\t\t\t\ttarj.getStronglyConnectComponents().\n\t\t\t\t\t\tstream().\n\t\t\t\t\t\tfilter(x -> x.size() > 1).\n\t\t\t\t\t\tcollect(Collectors.toSet());\n\n\t\t//Add all those axioms which use their own definition on the RHS\n\t\tSet<OWLLogicalAxiom> cycleCausing = new HashSet<>();\n\t\tcycleCausing.addAll(builder.getSelfDefinedAxioms());\n\n\t\tfor(OWLLogicalAxiom axiom : axioms){\n\t\t\tOWLClass name = (OWLClass) AxiomSplitter.getNameofAxiom(axiom);\n\t\t\t\tfor(Set<OWLClass> component : largeSCCs){\n\t\t\t\t\tif(component.contains(name)){\n\t\t\t\t\t\tOWLClassExpression def = AxiomSplitter.getDefinitionofAxiom(axiom);\n\t\t\t\t\t\tSet<OWLClass> defCls = ModuleUtils.getNamedClassesInSignature(def);\n\t\t\t\t\t\tSet<OWLClass> inter = Sets.intersection(component, defCls);\n\t\t\t\t\t\tif(!inter.isEmpty()){\n\t\t\t\t\t\t\tcycleCausing.add(axiom);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n\t\treturn cycleCausing;\n\t}", "public Map<OperationKey, List<Policy>> enforceOn(SourceBundle sourceBundle) {\n\t\tMap<OperationKey, List<Policy>> conflicts = new HashMap<OperationKey, List<Policy>>();\n\n\t\tSortedSet<Operation> operations = getAllOperations(sourceBundle, conflicts);\n\n\t\tif (operations.size() == 0) {\n\t\t\treturn conflicts;\n\t\t}\n\n\t\t// organize operations into a tree based on their nesting relationship\n\t\toperations = nestOperations(operations);\n\n\t\t// carry out the operations\n\t\texecuteOperations(sourceBundle, operations);\n\n\t\t// add the definition JS file to the beginning of web page\n\t\tsourceBundle.addTreatmentDefinitions(treatmentFactory.BASE_OBJECT_NAME + \".js\", treatmentFactory.getDefinitions());\n\n\t\treturn conflicts;\n\t}", "public String toString() {\r\n\t\treturn Consts.NAME_ACTORS_BAG_CHECK + \" \" + lineNumber;\r\n\t}", "private void deleteUnwantedFsnAcceptability(Concept c) throws TermServerScriptException {\n\t\tList<Description> fsns = c.getDescriptions(Acceptability.BOTH, DescriptionType.FSN, ActiveState.ACTIVE);\n\t\tif (fsns.size() != 1) {\n\t\t\tString msg = \"Concept has \" + fsns.size() + \" active fsns\";\n\t\t\treport(c, c.getFSNDescription(), Severity.HIGH, ReportActionType.VALIDATION_CHECK, msg);\n\t\t} else {\n\t\t\tString msg = \"[\" + fsns.get(0).getDescriptionId() + \"]: \";\n\t\t\tList<LangRefsetEntry> langRefEntries = fsns.get(0).getLangRefsetEntries(ActiveState.BOTH, US_ENG_LANG_REFSET);\n\t\t\tif (langRefEntries.size() != 1) {\n\t\t\t\tif (langRefEntries.size() == 2) {\n\t\t\t\t\tList<LangRefsetEntry> uslangRefEntries = fsns.get(0).getLangRefsetEntries(ActiveState.BOTH, refsets, SCTID_US_MODULE);\n\t\t\t\t\tList<LangRefsetEntry> corelangRefEntries = fsns.get(0).getLangRefsetEntries(ActiveState.BOTH, refsets, SCTID_CORE_MODULE);\n\t\t\t\t\tif (uslangRefEntries.size() > 1 || corelangRefEntries.size() >1) {\n\t\t\t\t\t\tmsg += \"Two acceptabilities in the same module\";\n\t\t\t\t\t\treport(c, c.getFSNDescription(), Severity.HIGH, ReportActionType.VALIDATION_CHECK, msg);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!uslangRefEntries.get(0).isActive() && corelangRefEntries.get(0).isActive() ) {\n\t\t\t\t\t\t\tlong usET = Long.parseLong(uslangRefEntries.get(0).getEffectiveTime());\n\t\t\t\t\t\t\tlong coreET = Long.parseLong(corelangRefEntries.get(0).getEffectiveTime());\n\t\t\t\t\t\t\tmsg += \"US langrefset entry inactivated \" + (usET > coreET ? \"after\":\"before\") + \" core row activated - \" + usET;\n\t\t\t\t\t\t\treport(c, c.getFSNDescription(), Severity.HIGH, ReportActionType.VALIDATION_CHECK, msg);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//If the US inactivated AFTER the core activated, then this is the case we need to fix\n\t\t\t\t\t\t\tuslangRefEntries.get(0).delete(deletionEffectiveTime);\n\t\t\t\t\t\t\tString action = \"Deleted US FSN LangRefset entry\";\n\t\t\t\t\t\t\treport(c, c.getFSNDescription(), Severity.MEDIUM, ReportActionType.DESCRIPTION_CHANGE_MADE, action);\n\t\t\t\t\t\t\tc.setModified();\n\t\t\t\t\t\t} if (uslangRefEntries.get(0).isActive() && corelangRefEntries.get(0).isActive() ) {\n\t\t\t\t\t\t\tmsg += \"Both US and Core module lang refset entries are inactive\";\n\t\t\t\t\t\t\treport(c, c.getFSNDescription(), Severity.LOW, ReportActionType.VALIDATION_CHECK, msg);\n\t\t\t\t\t\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmsg += \"Unexpected configuration of us and core lang refset entries\";\n\t\t\t\t\t\t\treport(c, c.getFSNDescription(), Severity.HIGH, ReportActionType.VALIDATION_CHECK, msg);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tmsg += \"FSN has \" + langRefEntries.size() + \" US acceptability values.\";\n\t\t\t\t\treport(c, c.getFSNDescription(), Severity.HIGH, ReportActionType.VALIDATION_CHECK, msg);\n\t\t\t\t}\n\t\t\t} else if (!langRefEntries.get(0).getAcceptabilityId().equals(SCTID_PREFERRED_TERM)) {\n\t\t\t\tmsg += \"FSN has an acceptability that is not Preferred.\";\n\t\t\t\treport(c, c.getFSNDescription(), Severity.HIGH, ReportActionType.VALIDATION_CHECK, msg);\n\t\t\t} else if (!langRefEntries.get(0).isActive()) {\n\t\t\t\tmsg += \"FSN's US acceptability is inactive.\";\n\t\t\t\treport(c, c.getFSNDescription(), Severity.HIGH, ReportActionType.VALIDATION_CHECK, msg);\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void report() {\n\t\tfor (String s : wordC.keySet()) {\n\t\t\tSystem.out.println(s + \": \" + wordC.get(s));\n\t\t}\n\t\t\n\t}", "public FileTrackerConflictLog() {\n\t\taddedItems = new ArrayList<>();\n\t\tremovedItems = new ArrayList<>();\n\t\tsummary = new StringBuilder();\n\t}", "List<? extends Rule> getRules();", "public java.lang.String GetRules() throws IOException {\r\n java.lang.String RulesString = new java.lang.String();\r\n Scanner scanner = new Scanner(new FileInputStream(RulesFile), \"UTF-8\");\r\n while (scanner.hasNextLine()) {\r\n RulesString = RulesString + scanner.nextLine() + \"\\n\";\r\n }\r\n return RulesString;\r\n }", "public void addAllOnVisibleLinks() {\n // Check for a valid render context and create the new set\n RTGraphComponent.RenderContext myrc = (RTGraphComponent.RenderContext) getRTComponent().rc; if (myrc == null) return;\n Set<Bundle> set = new HashSet<Bundle>();\n // Go through visible links and find the related bundles\n Iterator<String> it = myrc.graphedgeref_to_link.keySet().iterator();\n while (it.hasNext()) {\n String graphedgeref = it.next();\n Iterator<Bundle> itb = digraph.linkRefIterator(graphedgeref);\n while (itb.hasNext()) set.add(itb.next());\n }\n // Add the no mapping set and push it to the RTParent\n set.addAll(getRTComponent().getNoMappingSet()); getRTParent().push(getRTParent().getRootBundles().subset(set));\n }", "public HashSet<OWLClass> getCycleCausingNames(){\n\t\tHashSet<OWLClass> cycleCausing = new HashSet<>();\n\t\t//Belongs to SCC > 1 in size...\n\t\ttarj.getStronglyConnectComponents()\n\t\t\t\t.stream()\n\t\t\t\t.filter(components -> components.size() > 1)\n\t\t\t\t.forEach(cycleCausing::addAll);\n\n\t\t//...or defined in terms of self\n\t\tfor(GraphBuilder.Vertex v : g.values()){\n\t\t\tif(v.joinedToSelf){\n\t\t\t\tcycleCausing.add(v.value);\n\t\t\t}\n\t\t}\n\t\treturn cycleCausing;\n\t}", "private void colorizeCore() {\n\n\t\tfor (Class c : this.core) {\n\n\t\t\tint color = 0;\n\t\t\tboolean colored = false;\n\n\t\t\t// Get conflict graph\n\t\t\tHashSet<Class> relatedTo = c.getRelatedTo();\n\t\t\tif (this.conflictGraph.containsKey(c)) {\n\t\t\t\tfor (Class rel : this.conflictGraph.get(c)) {\n\t\t\t\t\trelatedTo.add(rel);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Lookup for a free color\n\t\t\twhile (!colored) {\n\n\t\t\t\tboolean colorBusy = false;\n\t\t\t\tfor (Class rel : relatedTo) {\n\t\t\t\t\tif (rel.getColor() != null && rel.getColor() == color)\n\t\t\t\t\t\tcolorBusy = true;\n\t\t\t\t}\n\n\t\t\t\tif (!colorBusy) {\n\t\t\t\t\tc.setColor(color);\n\t\t\t\t\tcolored = true;\n\t\t\t\t} else {\n\t\t\t\t\tcolor++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcomputeAdaptations(c);\n\t\t}\n\t}", "public String getRulePlacersMsg(final Rule rule) {\r\n\t\tStringBuilder msg = new StringBuilder();\r\n\t\tmsg.append(\"Rule \").append(rule.num).append(\" updated\");\r\n\t\tString sep = \"\";\r\n\t\tString dir = \" to \";\r\n\t\tfor (Noun noun : rulePlacers) {\r\n\t\t\tmsg.append(sep).append(\" \").append(noun.oldName).append(dir).append(noun.name);\r\n\t\t\tsep = \",\";\r\n\t\t}\r\n\t\tmsg.append(\".\");\r\n\t\treturn msg.toString();\r\n\t}", "public void includeCommitmentsFromRule(Rule aRule)\n {\n int j;\n int x;\n int y;\n String commitmentType;\n String direccion;\n StringTokenizer tokenizer;\n Commitment aCommitment;\n int prioridad;\n //-------------\n\n j = 0;\n while(j < aRule.commitments.size())\n {\n tokenizer = new StringTokenizer(aRule.commitments.get(j).predicate,\"(), \");\n commitmentType = tokenizer.nextToken();\n if((commitmentType.equals(\"secuencia\")) && (!commitmentsWithPriority()))\n {\n prioridad = 1;\n while( tokenizer.hasMoreElements())\n {\n x = Integer.valueOf(tokenizer.nextToken());\n y = Integer.valueOf(tokenizer.nextToken());\n direccion = tokenizer.nextToken();\n aCommitment = new Commitment(\"mover(\"+ x + \",\"+ y+\",\"+direccion+\")\");\n\n aCommitment.setPriority(prioridad);\n commitments.add(aCommitment);\n prioridad = prioridad + 1;\n }//end while\n\n\n }//end if\n else\n {\n commitments.add(aRule.commitments.get(j));\n }//end else\n j = j + 1;\n }//end while\n\n }", "public void printWarnings() {\n final int size = _warnings.size();\n if (size > 0) {\n System.err.println(new ErrorMsg(ErrorMsg.COMPILER_WARNING_KEY));\n for (int i = 0; i < size; i++) {\n System.err.println(\" \" + _warnings.get(i));\n }\n }\n }", "private String applyAllEffects() {\n StringBuilder applySummary = new StringBuilder();\n for (BattleEffect btlEff : effectsToApply) {\n applySummary.append(btlEff.apply());\n }\n return applySummary.toString();\n }", "public Collection<Resolver> getCauses() {\r\n return Collections.unmodifiableCollection(causes);\r\n }", "private void displayConditions(){\n\n\t\tString[] possibleConditions = new String[countPossibleRoutes()];\n\t\tQuestionlistModel = new DefaultListModel();\n\t\t\n\t\tString currentRule = \"\";\n\t\tint currentRuleIndex;\n\t\tint possCondInd = 0;\n\t\t\n\t\tfor(int i=0;i<ConditionTree.length;i++){\n\t\t\tcurrentRule = ConditionTree[i][0];\n\t\t\tcurrentRuleIndex = i;\n\t\t\t \n\t\t\t// if current Rule is final rule\n\t\t\tif(ConditionTree[i][5].equals(\"Y\")){\n\t\t\t\t\n\t\t\t\tpossibleConditions[possCondInd] = String.valueOf(currentRuleIndex) + \",\";\n\t\t\t\t//loop until not founds the top rule\n\t\t\t\t//System.out.println(\"value of i: \" + possCondInd + \" \" + currentRule + \" index is:\" + currentRuleIndex);\n\t\t\t\twhile(!ConditionTree[currentRuleIndex][1].equals(\"-\")){\n\t\t\t\t\t//setting current rule to current parent rule\n\t\t\t\t\tcurrentRuleIndex = getRuleIndex(ConditionTree[currentRuleIndex][1]);\n\t\t\t\t\tcurrentRule = ConditionTree[currentRuleIndex][0];\n\t\t\t\t\tpossibleConditions[possCondInd] += String.valueOf(currentRuleIndex) + \",\";\n\t\t\t\t\t//System.out.println(\"value of i: \" + possCondInd + \" \" + currentRule + \" index is:\" + currentRuleIndex);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tpossibleConditions[possCondInd] = possibleConditions[possCondInd].substring(0, possibleConditions[possCondInd].length()-1);\n\t\t\t\t//System.out.println(possibleConditions[possCondInd]);\n\t\t\t\tpossCondInd++;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t//Displaying in human language\n\t\tfor(int k=0;k<possibleConditions.length;k++){\n\t\t\tString currRoute[] = possibleConditions[k].split(\",\");\n\n\t\t\tint curRutInd;\n\t\t\tint nxtRutInd;\n\t\t\tString str = \"if \";\n\t\t\tfor(int i=currRoute.length-1;i>0;i--){\n\t\t\t\tcurRutInd = Integer.parseInt(currRoute[i-1]);\n\t\t\t\tnxtRutInd = Integer.parseInt(currRoute[i]);\n\t\t\t\t\n\t\t\t\tfor(int a=0;a<ConditionTree.length;a++){\n\n\t\t\t\t\tif(ConditionTree[a][0].equals(ConditionTree[curRutInd][1]) && \n\t\t\t\t\t\t\tConditionTree[a][1].equals(ConditionTree[nxtRutInd][1])){\n\t\t\t\t\t\t//System.out.println(ConditionTree[curRutInd][1] + \" is \" + ConditionTree[curRutInd][2] + \" \" + ConditionTree[curRutInd][3]);\n\t\t\t\t\t\tQuestionlistModel.addElement(ConditionTree[curRutInd][1] + \" is \" + ConditionTree[curRutInd][2] + \" \" + ConditionTree[curRutInd][3]);\n\t\t\t\t\t\tif(ConditionTree[curRutInd][5].equals(\"Y\")){\n\t\t\t\t\t\t\t//System.out.println(ConditionTree[curRutInd][0]);\n\t\t\t\t\t\t\tQuestionlistModel.addElement(ConditionTree[curRutInd][0]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tQuestionlistModel.addElement(\"\\n\");\n\t\t}\n\t\tQuestionList.setModel(QuestionlistModel);\n\t}", "Set<ConstraintViolation<T>> getViolations();", "public void advanceInconsistencyList() {\n\t\tinconsistenciesFound.remove(0);\r\n\t\tpossessiveTurn = false;\r\n\r\n\t\tcheckingEngine.replaceTextwithList();\r\n\t\ttypeHere.setText(checkingEngine.getText());\r\n\t\tgoThroughInconsistencies();\r\n\t}", "public Collection fullValidationCheck ()\n\t{\n\t\tArrayList list = new ArrayList();\n\t\tIterator iterator = getFullValidationList().iterator();\n\n\t\twhile (iterator.hasNext())\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t((ValidationComponent)iterator.next()).validate();\n\t\t\t}\n\t\t\tcatch (ModelValidationException e)\n\t\t\t{\n\t\t\t\tlist.add(e);\n\t\t\t}\n\t\t}\n\n\t\treturn Collections.unmodifiableCollection(list);\n\t}", "protected void staffIsLegend(){\r\n System.out.println(\"you must show some respect to staff \");\r\n }", "private void resolveSudokuByRules() {\n for (int i = 0; i < 9; i++) {\n updateBoardForSingleCandidate();\n }\n updateCandidateMapForPairByCol();\n updateCandidateMapForPairByRow();\n\n for (int i = 0; i < 5; i++) {\n updateBoardForSingleCandidate();\n }\n\n updateBoardForSinglePossibilityByBlock();\n updateBoardForSinglePossibilityByRow();\n updateBoardForSinglePossibilityByCol();\n refreshCandidateMap();\n\n for (int i = 0; i < 5; i++) {\n updateBoardForSingleCandidate();\n }\n\n printBoardAndCandidatesHtmlFile();\n }", "public void addConclusions() {\n\t\tif(conclusionNumbers1.size()==0) {\n\t\t\tconclusion1=\"\";\n\t\t}\n\t\telse if(conclusionNumbers1.size()==1) {\n\t\t\tconclusion1 = \"Bacteroides was detected from sample \"+conclusionNumbers1.get(0)+\".\";\n\t\t}\n\t\telse if(conclusionNumbers1.size()==2) {\n\t\t\tconclusion1 = \"Bacteroides was detected from samples \"+conclusionNumbers1.get(0) + \" and \"+ conclusionNumbers1.get(1) + \".\";\n\t\t}\n\t\telse {\n\t\t\tconclusion1 = \"Bacteroides was detected from samples \";\n\t\t\tfor(int i=0;i<conclusionNumbers1.size()-2;i++) {\n\t\t\t\tconclusion1+=conclusionNumbers1.get(i) + \", \";\n\t\t\t}\n\t\t\tconclusion1+= conclusionNumbers1.get(conclusionNumbers1.size()-2) + \" and \"+ conclusionNumbers1.get(conclusionNumbers1.size()-1) + \".\";\n\t\t}\n\t\t\n\t\tif(conclusionNumbers2.size()==0) {\n\t\t\tconclusion2=\"\";\n\t\t}\n\t\telse if(conclusionNumbers2.size()==1) {\n\t\t\tconclusion2 = \"no Bacteroides was detected from sample \"+conclusionNumbers2.get(0)+\".\";\n\t\t}\n\t\telse if(conclusionNumbers2.size()==2) {\n\t\t\tconclusion2 = \"no Bacteroides was detected from samples \"+conclusionNumbers2.get(0) + \" and \"+ conclusionNumbers2.get(1) + \".\";\n\t\t}\n\t\telse {\n\t\t\tconclusion2 = \"no Bacteroides was detected from samples \";\n\t\t\tfor(int i=0;i<conclusionNumbers2.size()-2;i++) {\n\t\t\t\tconclusion2+=conclusionNumbers2.get(i) + \", \";\n\t\t\t}\n\t\t\tconclusion2+= conclusionNumbers2.get(conclusionNumbers2.size()-2) + \" and \"+ conclusionNumbers2.get(conclusionNumbers2.size()-1) + \".\";\n\t\t}\n\t\t\n\t}", "public void makePreferredOTTOLRelationshipsConflicts(){\n \t\tTransaction tx;\n \t\tString name = \"life\";\n \t\tIndexHits<Node> foundNodes = findTaxNodeByName(name);\n Node firstNode = null;\n if (foundNodes.size() < 1){\n System.out.println(\"name '\" + name + \"' not found. quitting.\");\n return;\n } else if (foundNodes.size() > 1) {\n System.out.println(\"more than one node found for name '\" + name + \"'not sure how to deal with this. quitting\");\n } else {\n for (Node n : foundNodes)\n firstNode = n;\n }\n \t\tTraversalDescription CHILDOF_TRAVERSAL = Traversal.description()\n \t\t\t\t.relationships( RelTypes.TAXCHILDOF,Direction.INCOMING );\n \t\tSystem.out.println(firstNode.getProperty(\"name\"));\n \t\tint count = 0;\n \t\ttx = graphDb.beginTx();\n \t\ttry{\n \t\t\tfor(Node friendnode : CHILDOF_TRAVERSAL.traverse(firstNode).nodes()){\n \t\t\t\tboolean conflict = false;\n \t\t\t\tString endNode = \"\";\n \t\t\t\tRelationship ncbirel = null;\n \t\t\t\tRelationship ottolrel = null;\n \t\t\t\tfor(Relationship rel : friendnode.getRelationships(Direction.OUTGOING)){\n \t\t\t\t\tif (rel.getEndNode() == rel.getStartNode()){\n \t\t\t\t\t\tcontinue;\n \t\t\t\t\t}else{\n \t\t\t\t\t\tif (endNode == \"\")\n \t\t\t\t\t\t\tendNode = (String) rel.getEndNode().getProperty(\"name\");\n \t\t\t\t\t\tif ((String)rel.getEndNode().getProperty(\"name\") != endNode){\n \t\t\t\t\t\t\tconflict = true;\n \t\t\t\t\t\t}\n \t\t\t\t\t\tif(((String)rel.getProperty(\"source\")).compareTo(\"ncbi\")==0)\n \t\t\t\t\t\t\tncbirel = rel;\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\tif (conflict && ncbirel != null){\n \t\t\t\t\tcount += 1;\n //\t\t\t\t\tSystem.out.println(\"would make one from \"+ncbirel.getStartNode().getProperty(\"name\")+\" \"+ncbirel.getEndNode().getProperty(\"name\"));\n \t\t\t\t\tif(ncbirel.getStartNode()!=ncbirel.getEndNode()){\n \t\t\t\t\t\tncbirel.getStartNode().createRelationshipTo(ncbirel.getEndNode(), RelTypes.PREFTAXCHILDOF);\n \t\t\t\t\t\tRelationship newrel2 = ncbirel.getStartNode().createRelationshipTo(ncbirel.getEndNode(), RelTypes.TAXCHILDOF);\n \t\t\t\t\t\tnewrel2.setProperty(\"source\", \"ottol\");\n \t\t\t\t\t}else{\n \t\t\t\t\t\tSystem.out.println(\"would make cycle from \"+ncbirel.getEndNode().getProperty(\"name\"));\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t}\n \t\t\t\tif(count % transaction_iter == 0)\n \t\t\t\t\tSystem.out.println(count);\n \t\t\t}\n \t\t\ttx.success();\n \t\t}finally{\n \t\t\ttx.finish();\n \t\t}\n \t}", "public Conjunction encodeControlConflictFree() {\n\t\tConjunction result = new Conjunction(\"controlConflictfree\");\n\t\tSet<CArgument> controlArgs = CAF.getArgumentsByType(CArgument.Type.CONTROL);\n\t\tif(controlArgs.isEmpty()) {\n\t\t\treturn null;\n\t\t}\n\t\tint i = 0;\n\t\tfor(CArgument a : controlArgs) {\n\t\t\tSet<Argument> attackers = this.CAF.getControlAttackers(a, this.instance);\n\t\t\tFormula controlNotAccepted = this.controlNotAccepted(a, attackers);\n\t\t\tif(controlNotAccepted != null) {\n\t\t\t\tresult.addSubformula(controlNotAccepted);\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t\t// need to test if the conjunction is empty \n\t\t// in case all control arguments are not attacked we set no constraint\n\t\tif(i == 0) { return null;}\n\t\treturn result;\t\n\t}", "List<IRewriteRule> overapproxRewrite(int bound, Set<Integer> emergingSymbols);", "public void printBranchSubstitutions() {\n\t\tArrayList<TreeBranch> allBranches = phylogeny.getBranches();\n\t\tIterator<TreeBranch> i = allBranches.iterator();\n\t\twhile(i.hasNext()){\n\t\t\tTreeBranch someBranch = i.next();\n\t\t\tSystem.out.println(someBranch);\n\t\t\tStateComparison.printStateComparisonBetweenTwoNodes(someBranch.getParentNode().states, someBranch.getDaughterNode().states, someBranch.getParentNode().getContent(), someBranch.getDaughterNode().getContent());\n\t\t\tSystem.out.println();\n\t\t}\n\t\t\n\t}", "private static void getRulesFromFile() {\n File ruleFolder = new File(\"rules\");\n List<String> packageManagersWithRules = Stream.of(ruleFolder.list())\n .filter(f -> f.endsWith(\".rules\"))\n .map(f -> f.substring(0,f.lastIndexOf('.')))\n .sorted()\n .collect(Collectors.toList());\n\n RULES_BY_PACKAGE = new HashMap<>();\n for (String packagemanager : packageManagersWithRules) {\n RULES_BY_PACKAGE.put(packagemanager, parseRules(ruleFolder, packagemanager));\n }\n\n }", "public Set<Cause> getAllRelatedCauses() {\n\t\tSet<Cause> allCauses = this.getCauses();\n\t\tCause[] parents = this.getParents();\n\t\tif(parents != null) {\n\t\t\tfor (int i = 0; i < parents.length; i++) {\n\t\t\t\tallCauses.add(parents[i]);\n\t\t\t}\n\t\t}\n\t\tallCauses.add(this.rcaCase.problem);\n\n\t\treturn allCauses;\n\t}", "public int parseRulesFile() {\n\t BufferedReader reader = null;\n\t List<String> allLines = new ArrayList<String>();\n\t List<String> allLinesWithLintChecks = new ArrayList<String>();\n\t listOfRules = new ArrayList<String>();\n\t boolean eof = false;\n\t try {\n\t reader = new BufferedReader(new FileReader(pathTextFile));\n\t while (!eof) {\n\t String line = reader.readLine();\n\n\t if (line != null) {\n\t allLines.add(line);\n\t } else {\n\t eof = true;\n\t }\n\t }\n\n\t for (String line : allLines) {\n\t if (line.contains(\":\") && line.contains(\"\\\"\")) {\n\t allLinesWithLintChecks.add(line);\n\t }\n\t }\n\n\t for (String rule : allLinesWithLintChecks) {\n\t int position = rule.indexOf(\":\");\n\t listOfRules.add(rule.substring(1, position - 1));\n\t }\n\t } catch (FileNotFoundException ex) {\n\t System.err.println(\"File not found!\");\n\t ex.printStackTrace();\n\t } catch (IOException ex) {\n\t System.err.println(\"Error!!\");\n\t ex.printStackTrace();\n\t } finally {\n\t try {\n\t reader.close();\n\t } catch (IOException ex1) {\n\t System.out.println(\"Error when closing file !!\");\n\t }\n\t }\n\t return listOfRules.size();\n\t }", "java.lang.String getRule();", "private String getCategoriesForDebugging() {\n StringBuilder sb = new StringBuilder();\n String sep = \"\";\n for (SuggestionsSection section : mSections.values()) {\n sb.append(sep);\n sb.append(section.getCategory());\n sep = \", \";\n }\n\n return sb.toString();\n }", "protected List<DumpRule> ruleList(){\n\t\tList<DumpRule> drList = new ArrayList<DumpRule>();\n\t\tString lineStrs = ruleText.getText();\n\t\ttry{\n\t\t\tString[] lines = lineStrs.split(\"\\n\");\n\t\t\tDumpRule currentDr = null;\n\t\t\tfor(int index=0,size=lines.length; index<size; index++){\n\t\t\t\tString line=lines[index];\n\t\t\t\tif(line.indexOf(TB_COL_SPlit)!=-1){\n\t\t\t\t\tcurrentDr = addTbColRule(line);\n\t\t\t\t\tdrList.add(currentDr);\n\t\t\t\t}else if(line.indexOf(RULE_COL_SPlit)!=-1){\n\t\t\t\t\tString[] kvs = line.split(RULE_COL_SPlit);\n\t\t\t\t\tif(kvs!=null && kvs.length==2){\n\t\t\t\t\t\tcurrentDr.addRule(kvs[0].trim(), kvs[1].trim());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}catch(Exception e){\n\t\t\tapp.log(\"规则输入错误..\");\n\t\t}\n\t\treturn drList;\n\t}" ]
[ "0.5947917", "0.5725765", "0.5623051", "0.546531", "0.5423805", "0.5407179", "0.5384648", "0.53486127", "0.5285151", "0.5258078", "0.52526915", "0.52275914", "0.5227355", "0.5212464", "0.52041525", "0.51997566", "0.5186901", "0.51584244", "0.5135254", "0.50725037", "0.5044325", "0.50336665", "0.50176203", "0.5016963", "0.5015363", "0.5003795", "0.5003354", "0.4961168", "0.49473485", "0.4929101", "0.49130636", "0.48894215", "0.48680332", "0.48625797", "0.48571694", "0.48506656", "0.48423967", "0.48413587", "0.48303676", "0.48216733", "0.48041764", "0.48023874", "0.479536", "0.47873116", "0.47870925", "0.4785557", "0.4784932", "0.4783652", "0.47822648", "0.4781682", "0.47696668", "0.47589356", "0.4754981", "0.47521085", "0.4748769", "0.4735212", "0.47172454", "0.4716601", "0.4706635", "0.4701546", "0.46980608", "0.46937165", "0.46936658", "0.46903476", "0.46886435", "0.46837455", "0.46783102", "0.46678293", "0.46642792", "0.46433392", "0.46331865", "0.46304092", "0.4618235", "0.4610421", "0.46093073", "0.46029612", "0.45987898", "0.4589411", "0.4586755", "0.45865858", "0.45862168", "0.4571256", "0.4568623", "0.45640573", "0.45492363", "0.45412138", "0.4539849", "0.45396674", "0.4538177", "0.45379665", "0.45287836", "0.45260027", "0.44999996", "0.4496833", "0.44799763", "0.44767237", "0.44690213", "0.4465447", "0.4463633", "0.44609168" ]
0.70230144
0
//////////////////////////////////////////////////////////////reset the rule base for another round of inferencing /////////////////////////////////////////////////////////////////////////// by setting all variable values to null
public void reset() { textArea1.appendText("\n --- Setting all " + name + " variables to null"); textArea1.setForeground(Color.red); Enumeration enum2 = variableList.elements() ; while(enum2.hasMoreElements()) { RuleVariable temp = (RuleVariable)enum2.nextElement() ; temp.setValue(null) ; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void resetVariables(){\n\t\tthis.queryTriplets.clear();\n\t\tthis.variableList.clear();\n\t\tthis.prefixMap.clear();\n\t}", "@SuppressWarnings(\"NullAway\")\n\t\tpublic void reset() {\n\t\t\ttrackDoc = null;\n\t\t\tglobalDoc = null;\n\t\t\tpredicted.reset();\n\t\t\tobserved.reset();\n\t\t\tdoc_to_imagePixel.reset();\n\t\t}", "public static void variableReset() {\n\t\tLogic.pieceJumped = 0;\n\t\tLogic.bool = false;\n\t\tLogic.curComp = null;\n\t\tLogic.prevComp = null;\n\t\tLogic.jumpedComp = null;\n\t\tLogic.ydiff = 0;\n\t\tLogic.xdiff = 0;\n\t\tLogic.jumping = false;\n\t\tmultipleJump = false;\n\t\t\n\t}", "protected void reset() {\r\n super.reset();\r\n this.ring = null;\r\n }", "public void resetVariables() {\n\t\tArrays.fill(variables, 0.0);\n\t}", "void reset(){\n if (vars!=null){\n vars.clear();\n }\n if (gVars!=null){\n gVars.clear();\n }\n }", "public void reset()\n {\n reset(this.map, this.heuristic, this.neighborSelector);\n }", "public void reset() {\n\t\t\t\t\r\n\t\t\t}", "protected void reset() {\n\t\t}", "public void reset() {\n\t\tlocalName = \"\";\n\t\turi = \"\";\n\t\tdata = null;\n\t\tchars = null;\n\t\tcharCount = 0;\n\t\tline = 0;\n\t\tcolumn = 0;\n\t\tleaf = true;\n\t}", "@Override\n\t\t\tpublic void reset() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void reset() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void reset() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void reset() {\n\t\t\t\t\n\t\t\t}", "@Override\r\n public void resetEvaluation ()\r\n {\r\n evaluation = null;\r\n }", "@Override\r\n\tpublic void reset() {\n\t\tthis.dcn = null;\r\n\t\tthis.pairs.clear();\r\n\t\tthis.successfulCount = 0;\r\n\t\tthis.failedCount = 0;\r\n\t\tthis.metrics.clear();\r\n\t}", "public void reset() {\n solving = false;\n length = 0;\n checks = 0;\n }", "@Override\r\n\t\t\tpublic void reset() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\tpublic void reset() {\r\n\t\tsuper.reset();\r\n\t\tresetMomentObservation();\r\n\t\texpectations.reset();\r\n\t}", "void reset() {\n errors.clear();\n variables.clear();\n }", "public void reset() {\n\t\tvar.clear();\n\t\tname.clear();\n\t}", "public void reset() \n {\n cumulativeTrials = 0;\n\t numTwoHeads = 0;\n\t numTwoTails = 0;\n\t numHeadTails = 0;\n }", "public void reset() {\n\tthis.pinguins = new ArrayList<>();\n\tthis.pinguinCourant = null;\n\tthis.pret = false;\n\tthis.scoreGlacons = 0;\n\tthis.scorePoissons = 0;\n }", "public void reset() {\n\n\t}", "public void reset() {\n super.reset();\n }", "private void reset() {\n }", "public void reset() {\n\t}", "public void reset() {\n\t}", "public void reset() {\n\t}", "public void reset() {\n\t}", "public void reset()\r\n {\n if_list.removeAllElements();\r\n ls_db.reset();\r\n spf_root = null;\r\n vertex_list.removeAllElements();\r\n router_lsa_self = null;\r\n floodLastTime = Double.NaN;\r\n delayFlood = false;\r\n spf_calculation = 0;\r\n lsa_refresh_timer = null;\r\n }", "private void resetTemporary(){\n temporaryConstants = null;\n temporaryVariables = null;\n }", "@Override\r\n protected final void reset ()\r\n {\r\n super.reset();\r\n\r\n headLocation = null;\r\n tailLocation = null;\r\n startTime = null;\r\n }", "public void reset() {\n _valueLoaded = false;\n _value = null;\n }", "@Override\n\t\tprotected void reset()\n\t\t{\n\t\t}", "public void reset() {\n\t\tx = 0;\n\t\ty = 0;\n\t\tdir = -90;\n\t\tcoul = 0;\n\t\tcrayon = true;\n\t\tlistSegments.clear();\n \t}", "public static void reset() {\r\n\t\t// System.out.println(\"ExPar.reset()\");\r\n\t\t// new RuntimeException().printStackTrace();\r\n\t\truntimePars.clear();\r\n\t\tresetValues();\r\n\t\tGlobalAssignments.exec();\r\n\t}", "@Override\r\n\tpublic void reset()\r\n\t{\r\n\t}", "public void reset() {\n this.inhibited = false;\n this.forced = false;\n }", "protected void reset() {\n leftSkier.reset();\n rightSkier.reset();\n }", "@Override\r\n\tpublic void reset() {\n\t}", "public void reset() {\n state = SearchState.NEW;\n objectiveOptimal = false;\n solutionCount = 0;\n timeCount = 0;\n stopStopwatch();\n nodeCount = 0;\n backtrackCount = 0;\n failCount = 0;\n restartCount = 0;\n depth = 0;\n maxDepth = 0;\n }", "public void reset() {\n\t\tthis.flow = 0;\n\t}", "private void nullify() {\n\t\tpaint = null;\n\t\tup = null;\n\t\tdown = null;\n\t\tleft = null;\n\t\tright = null;\n\t\tg_up = null;\n\t\tg_down = null;\n\t\tg_left = null;\n\t\tg_right = null;\n\t\tgrass = null;\n\t\tcake = null;\n\n\t\t// Call garbage collector to clean up memory.\n\t\tSystem.gc();\n\n\t}", "public void reset() {\n counters = null;\n counterMap = null;\n counterValueMap = null;\n }", "public void reset() {\n\r\n\t}", "public void reset()\n\t{\n\t}", "public void reset()\n\t{\n\t}", "public void reset() {\n\t\tinit(0, 0, 1, false);\n\t}", "public void resetVariableTensors() {\n checkNotClosed();\n wrapper.resetVariableTensors();\n }", "public void unsetAntEfficiency() {\n this.antEfficiency = null;\n }", "@Override\n\tpublic void reset() {\n\t\tthis.currentConditionIndex = 0;\n\t\t\n\t\tfor(Cond cond:this.conditions)\n\t\t{\n\t\t\tfor(Param param:cond.params)\n\t\t\t{\n\t\t\t\tparam.reset();\n\t\t\t}\n\t\t}\n\t}", "public static void reset() {\n\t\tE_Location.THIS.reset();\n\t\tE_Resource.THIS.reset();\n\t\t\n\t\tT_Object.reset();\n\t\tT_Location.reset();\n\t\tT_Resource.reset();\n\t\t\n\t}", "protected void resetInternalState() {\n setStepStart(null);\n setStepSize(minStep.multiply(maxStep).sqrt());\n }", "@Override\n\tpublic void reset() {\n\n\t}", "@Override\n\tpublic void reset() {\n\t}", "public void reset() {\r\n reset(params);\r\n }", "public void reset () {}", "@Override\n\tpublic void reset() {\n\t\t\n\t}", "@Override\n\tpublic void reset() {\n\t\t\n\t}", "public void reset() {\n }", "public void reset() {\n }", "public void reset() {\n }", "public void reset() {\n }", "public final void reset() {\n\t\tscore = 0;\n\t\tlives = 10;\n\t\tshields = 3;\n\t}", "public void reset() {\n\t\tmDistanceMap.clear();\n\t\tmIncomingEdgeMap.clear();\n\t}", "@Override\n public void reset() \n {\n\n }", "public void resetAttributes()\r\n\t{\r\n\t\t// TODO Keep Attribute List upto date\r\n\t\tintelligence = 0;\r\n\t\tcunning = 0;\r\n\t\tstrength = 0;\r\n\t\tagility = 0;\r\n\t\tperception = 0;\r\n\t\thonor = 0;\r\n\t\tspeed = 0;\r\n\t\tloyalty = 0;\r\n\t}", "@Override\r\n\tpublic void reset() {\n\r\n\t}", "@Override\r\n\tpublic void reset() {\n\r\n\t}", "@Override\n public void resetAllValues() {\n }", "@Override\n public void reset() {\n }", "public void reset() {\n delta = 0.0;\n solucionActual = null;\n mejorSolucion = null;\n solucionVecina = null;\n iteracionesDiferenteTemperatura = 0;\n iteracionesMismaTemperatura = 0;\n esquemaReduccion = 0;\n vecindad = null;\n temperatura = 0.0;\n temperaturaInicial = 0.0;\n tipoProblema = 0;\n alfa = 0;\n beta = 0;\n }", "public void clear()\r\n {\r\n result = null;\r\n leftOperand = null;\r\n rightOperand = null;\r\n operator = null;\r\n resultDoubles = null;\r\n }", "public void resetTracking() {\n\t\tllahTrackingOps.clearDocuments();\n\t\ttrackId_to_globalId.clear();\n\t\tglobalId_to_track.clear();\n\t\transac.reset();\n\t}", "public void reset()\n\t{\n\t\tassociations = new Vector<Association>();\n\t\tif(hotspots != null)\n\t\t{\n\t\t\tfor(int i=0; i < hotspots.size(); i++)\n\t\t\t{\n\t\t\t\thotspots.elementAt(i).bound = null;\n\t\t\t\thotspots.elementAt(i).setHighlighted(false);\n\t\t\t}\n\t\t}\n\n\t\tif(movableObjects != null)\n\t\t{\n\t\t\tfor(int i=0; i < movableObjects.size(); i++)\n\t\t\t{\n\t\t\t\tmovableObjects.elementAt(i).resetPos();\n\t\t\t\tmovableObjects.elementAt(i).bound = null;\n\t\t\t}\n\t\t}\n\t\tuser_responses=0;\n\t\tmov = null;\n\t\tstart = null;\n\t\tmpos = null;\n\t\tsetFeedback();\n\t\trepaint();\n\t}", "protected abstract void reset();", "public void clearRules() {\n this.rules_ = emptyProtobufList();\n }", "public void reset(){\n\t\tfrogReposition();\n\t\tlives = 5;\n\t\tend = 0;\n\t}", "public final synchronized void reset() {\n\t\tnumTypes = numCoords = 0;\n\t}", "@Override\n public void reset() {\n super.reset();\n }", "public void reset() {\n\n operator.reset(); // reset Scan Operator\n }", "private void reset () {\n this.logic = null;\n this.lastPulse = 0;\n this.pulseDelta = 0;\n }", "public void reset () {\n\t\tclearField();\n\t\tstep_ = 0;\n\t}", "public void clearVars() {\n setLatitude (FLOATNULL);\n setLongitude (FLOATNULL);\n setDepth (FLOATNULL);\n setTemperatureMin (FLOATNULL);\n setTemperatureMax (FLOATNULL);\n setSalinityMin (FLOATNULL);\n setSalinityMax (FLOATNULL);\n setOxygenMin (FLOATNULL);\n setOxygenMax (FLOATNULL);\n setNitrateMin (FLOATNULL);\n setNitrateMax (FLOATNULL);\n setPhosphateMin (FLOATNULL);\n setPhosphateMax (FLOATNULL);\n setSilicateMin (FLOATNULL);\n setSilicateMax (FLOATNULL);\n setChlorophyllMin (FLOATNULL);\n setChlorophyllMax (FLOATNULL);\n }", "@Override\n public void reset()\n {\n super.reset();\n }", "void reset()\n {\n reset(values);\n }", "@Override\n public void reset()\n {\n this.titles = new ABR();\n this.years = new ABR();\n this.votes = new ABR();\n this.director = new ABR();\n\n for(int i = 0; i < this.movies.length; i++)\n this.movies.set(i, null);\n }", "public void reset ()\n {\n final String METHOD_NAME = \"reset()\";\n this.logDebug(METHOD_NAME + \" 1/2: Started\");\n super.reset();\n this.lid = null;\n this.refId = Id.UNDEFINED;\n this.fromDocType = DocType.UNDEFINED;\n this.logDebug(METHOD_NAME + \" 2/2: Done\");\n }", "void unsetSearchRecurrenceRule();", "public void reset() {\r\n\t\tscopedContext = new NamedScopeEvaluationContext();\r\n\t\texpressionParser = new SpelExpressionParser();\r\n\t\t\r\n\t\t// init named contexts\r\n\t\tscopedContext.addContext(\"model\", model);\r\n\t}", "public void reset() {\r\n bop.reset();\r\n gzipOp = null;\r\n }", "abstract void reset();", "public void reset() {\n this.count = 0;\n this.average = 0.0;\n }", "public synchronized void reset() {\n }", "public void reset ()\n\t{\n\t\t//The PaperAirplane and the walls (both types) use their reconstruct ()\n\t\t//method to set themselves back to their starting points.\n\t\tp.reconstruct ();\n\t\tfor (int i = 0; i < w.length; i++)\n\t\t\tw[i].reconstruct ();\n\t\t\n\t\tfor (int i = 0; i < sW.length; i++)\n\t\t\tsW[i].reconstruct ();\n\t\t\t\n\t\t//the time is reset using the resetTime () method from the Timer class.\n\t\ttime.resetTime ();\n\t\t\n\t\t//the score is reset using the reconstruct method from the Score class.\n\t\tscore.reconstruct ();\n\t\t\n\t\t//The following variables are set back to their original values set in\n\t\t//the driver class.\n\t\ttimePassed = 0;\t\n\t\tnumClicks = 0;\n\t\teventFrame = 0;\n\t\tlevel = 1;\n\t\txClouds1 = 0;\n\t\txClouds2 = -500;\n\t\tyBkg1 = 0;\n\t\tyBkg2 = 600;\t\t\n\t}", "public void reset() {\n\n\t\tazDiff = 0.0;\n\t\taltDiff = 0.0;\n\t\trotDiff = 0.0;\n\n\t\tazMax = 0.0;\n\t\taltMax = 0.0;\n\t\trotMax = 0.0;\n\n\t\tazInt = 0.0;\n\t\taltInt = 0.0;\n\t\trotInt = 0.0;\n\n\t\tazSqInt = 0.0;\n\t\taltSqInt = 0.0;\n\t\trotSqInt = 0.0;\n\n\t\tazSum = 0.0;\n\t\taltSum = 0.0;\n\t\trotSum = 0.0;\n\n\t\tcount = 0;\n\n\t\tstartTime = System.currentTimeMillis();\n\t\ttimeStamp = startTime;\n\n\t\trotTrkIsLost = false;\n\t\tsetEnableAlerts(true);\n\n\t}", "public void reset() {\n m_nestingDepth = 0;\n m_namespaceDepth = -1;\n m_namespaceStack.clear();\n m_prefixes = new String[m_uris.length];\n m_prefixes[0] = \"\";\n m_prefixes[1] = \"xml\";\n m_extensionUris = null;\n m_extensionPrefixes = null;\n m_translateTable = null;\n m_translateTableStack.clear();\n }", "protected void reset() {\n LocalDStruct ls = (LocalDStruct)input;\n ls.result = null;\n }", "protected void reset()\n {\n this.shapeDataCache.removeAllEntries();\n this.sector = null;\n }" ]
[ "0.725646", "0.7134044", "0.6942077", "0.6908539", "0.6879159", "0.6829834", "0.67895836", "0.678729", "0.6787043", "0.677802", "0.67639035", "0.67639035", "0.67639035", "0.67639035", "0.6755843", "0.6738963", "0.67344344", "0.6713165", "0.67072845", "0.6702067", "0.6696301", "0.66837823", "0.6672794", "0.6663531", "0.66632915", "0.666317", "0.6654939", "0.6654939", "0.6654939", "0.6654939", "0.66507685", "0.6650141", "0.66412497", "0.6635519", "0.6634745", "0.6621691", "0.661768", "0.6609678", "0.6607021", "0.6602058", "0.6593955", "0.6593462", "0.6588124", "0.65834546", "0.6560986", "0.6557111", "0.655278", "0.655278", "0.6552505", "0.65502024", "0.6546469", "0.65394616", "0.65355176", "0.6534026", "0.6531516", "0.6524789", "0.6518356", "0.65114003", "0.6508105", "0.6508105", "0.6504543", "0.6504543", "0.6504543", "0.6504543", "0.65033203", "0.65016985", "0.6495141", "0.64942044", "0.64862984", "0.64862984", "0.6482132", "0.64802575", "0.64787954", "0.64783233", "0.6470472", "0.64696443", "0.64676684", "0.6461869", "0.6461846", "0.646018", "0.6458048", "0.64501935", "0.64393806", "0.6437929", "0.64322", "0.6419614", "0.64003366", "0.63970286", "0.63903093", "0.63899314", "0.63893944", "0.6386744", "0.63852334", "0.63761026", "0.63758266", "0.6374732", "0.6372639", "0.6372463", "0.63681716", "0.6364101" ]
0.7528968
0
///////////////////////////////////////////////////////////for all consequent clauses which refer to this goalVar //////////////////////////////////////////////////////////////////try to find goalVar value via a rule being true /////////////////////////////////////////////////////////////if rule is true then pop, assign value, reeval rule //////////////////////////////////////////////////////////////////////////////if rule is false then pop, continue ////////////////////////////////////////////////////if rule is null then we couldnt find a value (same as false?)
public void backwardChain(String goalVarName) { RuleVariable goalVar = (RuleVariable)variableList.get(goalVarName); Enumeration<Clause> goalClauses = goalVar.clauseRefs.elements() ; while (goalClauses.hasMoreElements()) { Clause goalClause = (Clause)goalClauses.nextElement() ; if (goalClause.consequent.booleanValue() == false) continue ; goalClauseStack.push(goalClause) ; Rule goalRule = goalClause.getRule(); Boolean ruleTruth = goalRule.backChain() ; // find rule truth value if (ruleTruth == null) { textArea1.appendText("\nRule " + goalRule.name + " is null, can't determine truth value."); } else if (ruleTruth.booleanValue() == true) { // rule is OK, assign consequent value to variable goalVar.setValue(goalClause.rhs) ; goalVar.setRuleName(goalRule.name) ; goalClauseStack.pop() ; // clear item from subgoal stack textArea1.appendText("\nRule " + goalRule.name + " is true, setting " + goalVar.name + ": = " + goalVar.value); if (goalClauseStack.empty() == true) { textArea1.appendText("\n +++ Found Solution for goal: " + goalVar.name); break ; // for now, only find first solution, then stop } } else { goalClauseStack.pop() ; // clear item from subgoal stack textArea1.appendText("\nRule " + goalRule.name + " is false, can't set " + goalVar.name); } // displayVariables("Backward Chaining") ; // display variable bindings } // endwhile if (goalVar.value == null) { textArea1.appendText("\n +++ Could Not Find Solution for goal: " + goalVar.name); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Boolean evaluateBooleanExpression(Expression expr, InMemoryExpressionEvaluator eval)\n {\n try\n {\n Object result = expr.evaluate(eval);\n return (result instanceof InMemoryFailure) ? Boolean.FALSE : (Boolean)result;\n }\n catch (VariableNotSetException vnse)\n {\n if (NucleusLogger.QUERY.isDebugEnabled())\n {\n NucleusLogger.QUERY.debug(Localiser.msg(\"021024\", vnse.getVariableExpression().getId(), StringUtils.objectArrayToString(vnse.getValues())));\n }\n\n // TODO The iteration through possible variable values needs improving. We currently just drop out\n // to here with the possible values of a variable when first encountered (and not yet set), which\n // then starts the iteration process. This likely would fail if 2 or more variables (unchecked)\n if (vnse.getValues() == null || vnse.getValues().length == 0)\n {\n // No values available for this variable, so just put null and see the result\n eval.setVariableValue(vnse.getVariableExpression().getId(), null);\n if (NucleusLogger.QUERY.isDebugEnabled())\n {\n NucleusLogger.QUERY.debug(Localiser.msg(\"021025\", vnse.getVariableExpression().getId(), \"(null)\"));\n }\n if (Boolean.TRUE.equals(evaluateBooleanExpression(expr, eval)))\n {\n return Boolean.TRUE;\n }\n }\n else\n {\n // Set this variable and start iteration over the possible variable values\n for (int i=0;i<vnse.getValues().length;i++)\n {\n eval.setVariableValue(vnse.getVariableExpression().getId(), vnse.getValues()[i]);\n if (NucleusLogger.QUERY.isDebugEnabled())\n {\n NucleusLogger.QUERY.debug(Localiser.msg(\"021025\", vnse.getVariableExpression().getId(), vnse.getValues()[i]));\n }\n if (Boolean.TRUE.equals(evaluateBooleanExpression(expr, eval)))\n {\n return Boolean.TRUE;\n }\n }\n }\n\n // No variable value was successful so return FALSE\n if (NucleusLogger.QUERY.isDebugEnabled())\n {\n NucleusLogger.QUERY.debug(Localiser.msg(\"021026\", vnse.getVariableExpression().getId()));\n }\n eval.removeVariableValue(vnse.getVariableExpression().getId());\n return Boolean.FALSE;\n }\n }", "@Override\n public final void solve() {\n this.flag1 = this.neo.getPosition().equals(this.goal);\n \n }", "private static <V extends Variable<A>, A extends Value> boolean BACKTRACK(SharedDomainVariableSet<V, A> variableSet) {\n\t\tif (variableSet.isComplete()) {return true;}\n\t\t\n\t\t// get variable to assign\n\t\tV var = variableSet.getUnassignedVariable();\n\t\tSystem.out.println(x + \" --> \" + variableSet.getCountSet() + \": \" + var.getIndex());\n\t\tx += 1;\n\t\t//System.out.println(var);\n\t\t\n\t\t// for each possible value\n\t\tfor (A val : variableSet.getDomain(var)) {\n\n\t\t\t// add the assignment\n\t\t\tvar.assign(val);\n\t\t\t\n\t\t\t// test acceptability and infer the feasibility of the assignment && INFER(variableSet, var)\n\t\t\tif (INFER(variableSet, var)) {\n\t\t\t//if (true) {\t\n\t\t\t\ttry {\n\t\t\t\t\t\n\t\t\t\t\t// domain reduction, throws exception if invalid\n\t\t\t\t\tMap<V, DomainReduction<A>> domainReduction2 = FORWARD_CHECK2(variableSet, var);\n\t\t\t\t\t\n\t\t\t\t\t//Map<V, DomainReduction<A>> domainReduction = FORWARD_CHECK(variableSet, var);\n\t\t\t\t\t\n\t\t\t\t\t// add domain reduction to set\n\t\t\t\t\t//variableSet.addDomainReduction(domainReduction);\n\t\t\t\t\t\n\t\t\t\t\t// backtrack\n\t\t\t\t\t//boolean result = BACKTRACK(variableSet);\n\t\t\t\t\t\n\t\t\t\t\t// stop if solution found\n\t\t\t\t\tif (INFER(variableSet, var) && BACKTRACK(variableSet)) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// clear domain reduction\n\t\t\t\t\t//variableSet.clearDomainReduction(domainReduction);\n\t\t\t\t\tvariableSet.clearDomainReduction(domainReduction2);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\t\t\t// clean assignment\n\t\t\tvar.unassign();\n\t\t\t\n\t\t}\n\t\t\n\t\t// no assignment found\n\t\treturn false;\n\t\t\n\t}", "protected IDecisionVariable dereferenceIfNeeded(IDecisionVariable variable, Value value) {\n IDecisionVariable v = variable;\n if (TypeQueries.isReference(variable.getDeclaration().getType()) \n && !TypeQueries.isReference(value.getType())) {\n v = Configuration.dereference(v);\n if (null == v) { // just a fallback, shall not happen\n v = variable;\n }\n }\n return v;\n }", "public boolean runSolver()\n {\n Variable current = getUnassignedVar();\n\n if (current == null)\n {\n return true;\n }\n\n for (int i = 0; i < current.getDomain().size(); i++)\n {\n List<Integer> oldDomain = current.getDomain();\n int newval = oldDomain.get(i);\n current.setValue(newval);\n current.setDomain(i);\n\n if (constraintsSatisfied(constraintsWithAnyVals()))\n {\n if (runSolver())\n {\n return true;\n }\n }\n\n current.setDomain(oldDomain);\n current.setValue(current.getPrevious()); \n }\n return false;\n }", "private boolean for_cond(){\n int save = position;\r\n boolean for_cond = false;\r\n\r\n if (getNextLexeme() == Lexeme.LP) {\r\n if(init()){\r\n if(log_exp() && getNextLexeme() == Lexeme.END){\r\n if(getNextLexeme() == Lexeme.VAR && assign_op()) {\r\n if (getNextLexeme() == Lexeme.RP) {\r\n for_cond = true;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n position = for_cond ? position : save;\r\n return for_cond;\r\n }", "int evaluate(ISeqActivity iThisActivity) {\n\n\t\tif (_Debug) {\n\t\t\tSystem.out.println(\" :: SeqConditionSet --> BEGIN - evaluate\");\n\t\t\tSystem.out.println(\" :: --> RETRY == \" + mRetry);\n\t\t}\n\n\t\tint result = EVALUATE_UNKNOWN;\n\n\t\t// Make sure we have a valid target activity \n\t\tif (iThisActivity != null) {\n\n\t\t\tif (_Debug) {\n\t\t\t\tSystem.out.println(\" ::--> Set - \" + mCombination);\n\n\t\t\t\tif (mConditions != null) {\n\t\t\t\t\tSystem.out.println(\" ::--> [\" + mConditions.size() + \"]\");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\" ::--> NULL\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (mConditions != null) {\n\t\t\t\t// Evaluate this rule's conditions\n\t\t\t\tif (mCombination.equals(COMBINATION_ALL)) {\n\t\t\t\t\tresult = EVALUATE_TRUE;\n\n\t\t\t\t\tfor (int i = 0; i < mConditions.size(); i++) {\n\t\t\t\t\t\tint thisEval = evaluateCondition(i, (SeqActivity) iThisActivity);\n\n\t\t\t\t\t\tif (thisEval != EVALUATE_TRUE) {\n\t\t\t\t\t\t\tresult = thisEval;\n\n\t\t\t\t\t\t\t// done with this evaluation\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} else if (mCombination.equals(COMBINATION_ANY)) {\n\t\t\t\t\t// Assume we have enought information to evaluate\n\t\t\t\t\tresult = EVALUATE_FALSE;\n\n\t\t\t\t\tfor (int i = 0; i < mConditions.size(); i++) {\n\t\t\t\t\t\tint thisEval = evaluateCondition(i, (SeqActivity) iThisActivity);\n\n\t\t\t\t\t\tif (thisEval == EVALUATE_TRUE) {\n\t\t\t\t\t\t\tresult = EVALUATE_TRUE;\n\n\t\t\t\t\t\t\t// done with this evaluation\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} else if (thisEval == EVALUATE_UNKNOWN) {\n\t\t\t\t\t\t\t// Something is missing...\n\t\t\t\t\t\t\tresult = EVALUATE_UNKNOWN;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Reset the 'retry' flag\n\t\tmRetry = false;\n\n\t\tif (_Debug) {\n\t\t\tSystem.out.println(\" ::--> \" + result);\n\t\t\tSystem.out.println(\" :: SeqConditionSet --> END - evaluate\");\n\t\t}\n\n\t\treturn result;\n\n\t}", "@Override\n\tpublic Condition getGoal()\n\t{\n\t\treturn explicitGoal;\n\t}", "private void collapseAssignmentsIntoConditional(Op03SimpleStatement ifStatement) {\n\n if (!(appropriateForIfAssignmentCollapse1(ifStatement) ||\n appropriateForIfAssignmentCollapse2(ifStatement))) return;\n IfStatement innerIf = (IfStatement) ifStatement.getStatement();\n ConditionalExpression conditionalExpression = innerIf.getCondition();\n\n /*\n * The 'verify' block stops us winding up unless we'd do it into another conditional\n * or into a backjump.\n *\n * Otherwise, we end up with lots of code like\n *\n * int x\n * if ( (x=3) < y )\n *\n * rather than\n *\n * int x = 3\n * if (x < y)\n *\n * which is (a) ugly, and (b) screws with final analysis.\n */\n /*\n * HOWEVER - eclipse (of course) generates code which looks like\n *\n *\n */\n boolean eclipseHeuristic = testEclipse && ifStatement.getTargets().get(1).getIndex().isBackJumpFrom(ifStatement);\n if (!eclipseHeuristic) {\n Op03SimpleStatement statement = ifStatement;\n Set<Op03SimpleStatement> visited = SetFactory.newSet();\n verify:\n do {\n if (statement.getSources().size() > 1) {\n // Progress if we're a backjump target.\n // Otherwise, we'll cause problems with assignments inside\n // while conditionals.\n InstrIndex statementIndex = statement.getIndex();\n for (Op03SimpleStatement source : statement.getSources()) {\n if (statementIndex.isBackJumpFrom(source)) {\n break verify;\n }\n }\n }\n if (statement.getSources().isEmpty()) {\n break;\n }\n statement = statement.getSources().get(0);\n if (!visited.add(statement)) {\n return;\n }\n Statement opStatement = statement.getStatement();\n if (opStatement instanceof IfStatement) break;\n if (opStatement instanceof Nop) continue;\n if (opStatement instanceof AbstractAssignment) continue;\n return;\n } while (true);\n }\n\n /* where possible, collapse any single parent assignments into this. */\n Op03SimpleStatement previousSource = null;\n while (ifStatement.getSources().size() == 1) {\n Op03SimpleStatement source = ifStatement.getSources().get(0);\n if (source == previousSource) return;\n previousSource = source;\n if (!(source.getStatement() instanceof AbstractAssignment)) return;\n LValue lValue = source.getStatement().getCreatedLValue();\n if (lValue instanceof StackSSALabel) return;\n // We don't have to worry about RHS having undesired side effects if we roll it into the\n // conditional - that has already happened.\n LValueUsageCollectorSimple lvc = new LValueUsageCollectorSimple();\n // NB - this will collect values even if they are NOT guaranteed to be used\n // i.e. are on the RHS of a comparison, or in a ternary.\n conditionalExpression.collectUsedLValues(lvc);\n if (!lvc.isUsed(lValue)) return;\n AbstractAssignment assignment = (AbstractAssignment) (source.getStatement());\n\n AbstractAssignmentExpression assignmentExpression = assignment.getInliningExpression();\n LValueUsageCollectorSimple assignmentLVC = new LValueUsageCollectorSimple();\n assignmentExpression.collectUsedLValues(assignmentLVC);\n Set<LValue> used = SetFactory.newSet(assignmentLVC.getUsedLValues());\n used.remove(lValue);\n Set<LValue> usedComparison = SetFactory.newSet(lvc.getUsedLValues());\n\n // Avoid situation where we have\n // a = x\n // b = y.f(a)\n // if (a == b) <-- should not get rolled up.\n SSAIdentifiers<LValue> beforeSSA = source.getSSAIdentifiers();\n SSAIdentifiers<LValue> afterSSA = ifStatement.getSSAIdentifiers();\n\n Set<LValue> intersection = SetUtil.intersectionOrNull(used, usedComparison);\n if (intersection != null) {\n // If there's an intersection, we require the ssa idents for before/after to be the same.\n for (LValue intersect : intersection) {\n if (!afterSSA.isValidReplacement(intersect, beforeSSA)) {\n return;\n }\n }\n }\n\n if (!afterSSA.isValidReplacement(lValue, beforeSSA)) return;\n LValueAssignmentExpressionRewriter rewriter = new LValueAssignmentExpressionRewriter(lValue, assignmentExpression, source);\n ConditionalExpression replacement = rewriter.rewriteExpression(conditionalExpression, ifStatement.getSSAIdentifiers(), ifStatement, ExpressionRewriterFlags.LVALUE);\n if (replacement == null) return;\n innerIf.setCondition(replacement);\n }\n\n }", "private void setCurrentRule(){\n\tfor(int i=0; i<ConditionTree.length;i++){\n\t\tif(ConditionTree[i][1].equals(\"-\")){\n\t\t\tcurrentRule = ConditionTree[i][0];\n\t\t\tcurrentRuleIndex = i;\n\t\t}\n\t}\n}", "private Term parseAssign(final boolean required) throws ParseException {\n Term t1 = parseConditional(required);\n while (t1 != null) {\n int tt = _tokenizer.next();\n if (tt == '=') {\n Term t2 = parseAssign(true);\n if (t1 instanceof Term.Ref && ((Term.Ref) t1).getVariable() != null) {\n t1 = new Term.Assign(t1, t2);\n } else {\n reportError(\"Variable expected on the left side of assignment '='.\");\n }\n } else {\n _tokenizer.pushBack();\n break;\n }\n }\n return t1;\n }", "@Override\n\tpublic Solution<TTPVariable> run(SingleObjectiveThiefProblem thief, IEvaluator evaluator, MyRandom rand) {\n\t\tTTPVariable var = TTPVariable.create(new TourOptimalFactory(thief).next(rand), Pack.empty());\n\t\tSolution<TTPVariable> currentBest = thief.evaluate(var);\n\t\t\n\n\t\twhile (evaluator.hasNext()) {\n\n\t\t\t// now take the tour and optimize packing plan\n\t\t\tSolution<Pack> nextPack = optPack(thief, evaluator, rand, currentBest.getVariable().getTour(), currentBest.getVariable().getPack());\n\t\t\t\n\t\t\tSolution<Tour> nextTour = optTour(thief, evaluator, rand, currentBest.getVariable().getTour(), nextPack.getVariable());\n\t\t\t\n\t\t\tTTPVariable next = TTPVariable.create(nextTour.getVariable(), nextPack.getVariable());\n\t\t\tSolution<TTPVariable> s = thief.evaluate(next);\n\t\t\t\n\t\t\t//System.out.println(nextPack);\n\t\t\t//System.out.println(currentBest);\n\t\t\t//System.out.println(\"----------------\");\n\t\t\t\n\t\t\t// update the best found solution\n\t\t\tif (SolutionDominator.isDominating(s, currentBest)) {\n\t\t\t\tcurrentBest = s;\n\t\t\t\t//System.out.println(\"YES\");\n\t\t\t}\n\t\t\tevaluator.notify(currentBest);\n\n\t\t}\n\n\t\treturn currentBest;\n\t}", "public String newRuleFirstCondition(Situation threeSituationsAgo)\n {\n String firstPredicate;\n //---------------\n firstPredicate = \"ninguno\";\n\n if(\n (threeSituationsAgo.puzzle[0][0] == 1) &&\n (threeSituationsAgo.puzzle[0][1] == 2) &&\n (threeSituationsAgo.puzzle[0][2] == 3) &&\n (threeSituationsAgo.puzzle[0][3] == 4) &&\n (threeSituationsAgo.puzzle[1][0] == 5) &&\n (threeSituationsAgo.puzzle[1][1] == 6) &&\n (threeSituationsAgo.puzzle[1][2] == 7) &&\n (threeSituationsAgo.puzzle[1][3] == 8) &&\n (threeSituationsAgo.puzzle[2][0] == 9) &&\n (threeSituationsAgo.puzzle[3][0] == 13)\n )\n {\n firstPredicate = \"dosLineasYColumna\";\n }//end if\n else\n {\n if(\n (threeSituationsAgo.puzzle[0][0] == 1) &&\n (threeSituationsAgo.puzzle[0][1] == 2) &&\n (threeSituationsAgo.puzzle[0][2] == 3) &&\n (threeSituationsAgo.puzzle[0][3] == 4) &&\n (threeSituationsAgo.puzzle[1][0] == 5) &&\n (threeSituationsAgo.puzzle[1][1] == 6) &&\n (threeSituationsAgo.puzzle[1][2] == 7) &&\n (threeSituationsAgo.puzzle[1][3] == 8)\n )\n {\n firstPredicate = \"dosLineasListas\";\n }//end if\n else\n {\n if(\n (threeSituationsAgo.puzzle[0][0] == 1) &&\n (threeSituationsAgo.puzzle[0][1] == 2) &&\n (threeSituationsAgo.puzzle[0][2] == 3) &&\n (threeSituationsAgo.puzzle[0][3] == 4)\n )\n {\n firstPredicate = \"primeraLineaLista\";\n }//end if\n }//end else\n }//end else\n\n return firstPredicate;\n }", "private Rule honorRules(InstanceWaypoint context){\n \t\t\n \t\tStyle style = getStyle(context);\n \t\tRule[] rules = SLD.rules(style);\n \t\t\n \t\t//do rules exist?\n \t\t\n \t\tif(rules == null || rules.length == 0){\n \t\t\treturn null;\n \t\t}\n \t\t\n \t\t\n \t\t//sort the elserules at the end\n \t\tif(rules.length > 1){\n \t\t\trules = sortRules(rules);\n \t\t}\n \t\t\n \t\t//if rule exists\n \t\tInstanceReference ir = context.getValue();\n \t\tInstanceService is = (InstanceService) PlatformUI.getWorkbench().getService(InstanceService.class);\n \t\tInstance inst = is.getInstance(ir);\n \t\t\t\n \t\tfor (int i = 0; i < rules.length; i++){\n \t\t\t\n \t\t\tif(rules[i].getFilter() != null){\t\t\t\t\t\t\n \t\t\t\t\n \t\t\t\tif(rules[i].getFilter().evaluate(inst)){\n \t\t\t\t\treturn rules[i];\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\t//if a rule exist without a filter and without being an else-filter,\n \t\t\t//the found rule applies to all types\n \t\t\telse{\n \t\t\t\tif(!rules[i].isElseFilter()){\n \t\t\t\t\treturn rules[i];\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t\n \t\t//if there is no appropriate rule, check if there is an else-rule\n \t\tfor (int i = 0; i < rules.length; i++){\n \t\t\tif(rules[i].isElseFilter()){\n \t\t\t\treturn rules[i];\n \t\t\t}\n \t\t}\n \t\t\n \t \n \t\t//return null if no rule was found\n \t\treturn null;\n \t\n \t}", "@Override\n protected DagNode evaluate(DagNode parent, Bindings bindings) {\n // type acts as storage for the status\n DagEdge bound = bindings.getBinding(_varName, getType());\n if (bound == null) {\n if (getType() == Bindings.LOCAL) {\n // first occurence of this var, bind the variable name\n // to the given node. This is on the application side, where new bindings\n // are only relevant in expandVars, which is why the DagEdge is not\n // important, but the node, to establish coreferences.\n bound = new DagEdge((short) -1, parent);\n bindings.bind(_varName, bound, getType());\n } else {\n logger.warn(\"Unknown binding during application of rule: \" + this);\n return parent;\n }\n }\n // Avoid unwanted coreferences for atomic nodes\n if (bound.getValue().newEdgesAreEmpty()) {\n return bound.getValue().cloneFS();\n }\n return bound.getValue();\n }", "protected Object subEval(EvalContext ctx, boolean forValue) {\n T.fail(\"A DelayedExpr isn't eval-able\");\n return null; //make compiler happy\n }", "@Override\n public Matching solve() {\n while (!matching.freeElements().isEmpty()) {\n /* get first element from the queue */\n Element element = problem.element(matching.freeElements().poll().elemId());\n\n /* get its preference element: looping through its list => by the level value */\n while (!element.preferences().isEmpty()) {\n Element pref = problem.element(element.preferences().poll().elemId());\n\n /* check if is an acceptable partner for current preference */\n if (!pref.accepts(element)) {\n continue;\n }\n\n /* verify the availability of its current preference */\n if (problem.isAvailable(pref.elemId())) {\n problem.element(pref.elemId()).setAvailability(false);\n problem.element(element.elemId()).setAvailability(false);\n matching.addPair(new Pair(element, pref));\n break;\n }\n else {\n /* if the preference is already taken, get the best one between current element and its current match */\n String currMatchName = matching.getElementPair(pref);\n Element currentMatch = pref.getIndex(currMatchName);\n Element elem = pref.getIndex(element.elemId());\n\n /* when current element is better than the current match */\n if (currentMatch.level() > elem.level()){\n if (matching.isFree(elem))\n matching.removeFreeElement(elem);\n\n problem.element(pref.elemId()).setAvailability(false);\n problem.element(element.elemId()).setAvailability(false);\n problem.element(currentMatch.elemId()).setAvailability(true);\n\n /* add the current pair to the Matching and the old match for the woman to the free list */\n matching.addPair(new Pair(problem.element(element.elemId()), problem.element(pref.elemId())));\n\n matching.addFreeElement(problem.element(currMatchName));\n break;\n }\n else {\n matching.addPair(new Pair(currentMatch, pref));\n }\n }\n }\n /* when man was rejected by all its preferences */\n if (element.preferences().isEmpty())\n element.setAvailability(true);\n }\n problem.getSets().get(0).getElements().stream().filter(Element::isAvailable).forEach(Element::remakeList);\n problem.getSets().get(0).getElements().stream().filter(Element::isAvailable).forEach(element -> matching.addFreeElement(problem.element(element.elemId())));\n\n return matching;\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 }", "public boolean assignVariable(Scanner scan){\n\t\tif (scan.hasNext(\"\\\\=\")){\n\t\t\tif (!Parser.gobble(\"\\\\=\", scan)){ Parser.fail(\"Should have = for variables.\", scan); }\n\t\t\texpr = new Expression();\n\t\t\texpr.parse(scan);\t\t\t\t\t\t//Assignment\n\t\t\tif (!Parser.gobble(\"\\\\;\", scan)){ Parser.fail(\"Should have ; for variables.\", scan); }\n\t\t\t//Add to map\n\t\t\tParser.variables.put(name, this);\n\t\t\treturn true;\n\t\t} else if (scan.hasNext(\"\\\\;\")){\t//DECLARED NOT ASSIGNMENT\n\t\t\tif (!Parser.gobble(\"\\\\;\", scan)){ Parser.fail(\"Should have ; for variables.\", scan); }\n\t\t\t/*\t\t\tNum number = new Num();\n\t\t\tnumber.numberNodeZero();\n\t\t\texpr = number;\t\t\t\t\t//sets expr to 0. \n\t\t\t */\t\t\treturn true; \t\t\t\t\t//Shouldnt set it to 0 if there is already variable in map\n\t\t}\n\t\treturn false;\n\t}", "public MathEval setVariableRequired(boolean val) {\r\n relaxed=(!val);\r\n return this;\r\n }", "private <E> Assignment<E> backtracking(CSP<E> csp, Assignment<E> assignment, HashMap<String,Set<E>> explored) {\r\n\t\t++iterationCount;\r\n\t\tif(assignment.isComplete(csp) || iterationCount>10000){\r\n\t\t\treturn assignment;\r\n\t\t}\r\n\t\tString var=selectUnassignedVariable(csp, assignment);\r\n\t\tList<E> values= orderDomainValues(csp, var, assignment);\r\n\t\tSet<E> valuesSet = new HashSet<>();\r\n\t\tfor(int i=0;i<values.size();i++){\r\n\t\t\tboolean consistent=true;\r\n\t\t\tif(!Visited(explored,var,values.get(i))){\r\n\t\t\t\tvaluesSet.add(values.get(i));\r\n\t\t\t\tassignment.put(var,values.get(i));\r\n\t\t\t\texplored.put(var,valuesSet);\r\n\t\t\t\tif(csp.isConsistent(assignment)){\r\n\t\t\t\t\tAssignment<E> result = backtracking(csp, assignment, explored);\r\n\t\t\t\t\tif(result!=null) {\r\n\t\t\t\t\t\treturn result;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tassignment.remove(var);\r\n\t\t\t}\r\n\t\t}\r\n\t\texplored.get(var).clear();\r\n\t\treturn null;\r\n\t}", "boolean checkGoal(Node solution);", "@Override\n public Boolean visitVariableAttribution(FormScriptGrammarParser.VariableAttributionContext ctx) {\n if (!declaredVariables.containsKey(ctx.VARIABLE().getText())) {\n // this is validated in UI/controlled by flow in the UI so should never happen, but it remains here just in case\n throw new IllegalArgumentException(\"Semantic error at line: \" + ctx.getStart().getLine() + \": variable \" + ctx.VARIABLE().getText() + \" wasn't declared!\");\n// return false; //if we wanted to return the NOTOK/false result recursively, this would be here instead of the throw\n }\n DataType dataType = declaredVariables.get(ctx.VARIABLE().getText());\n boolean correctType = dataType.lexerValue().equals(ctx.value().start.getType());\n /*will verify if the attribution is actually semantically valid, e.g if\n the variable was defined as an INTEGER, it can't be assigned a DATE*/\n if (!correctType) {\n throw new IllegalArgumentException(\"Semantic error at line: \" + ctx.getStart().getLine() + \":\" + ctx.getStart().getCharPositionInLine()\n + \": Invalid attribution type!\" + \" variable \" + ctx.VARIABLE().getText() + \" can't be assigned the value \" + ctx.value().getText());\n// return false; //if we wanted to return the NOTOK/false result recursively, this would be here instead of the throw\n }\n //verify if operators are valid in the context of the datatype\n String operator = ctx.COMPARISON_OPERATORS().getText();\n if (operator.equals(\"<\") || operator.equals(\">\")) {\n if (dataType.equals(DataType.BOOLEAN) || dataType.equals(DataType.DATE) || dataType.equals(DataType.FILE)) {\n throw new IllegalArgumentException(\"Semantic error at line: \" + ctx.getStart().getLine() + \":\" + ctx.getStart().getCharPositionInLine()\n + \": Invalid comparison type!\" + \" variable \" + ctx.VARIABLE().getText() + \" can't be compared with operator '\" + operator + \"'\");\n }\n }\n return true;\n }", "private <E> Assignment<E> backtrackFC(CSP<E> csp, Assignment<E> assignment) {\r\n\t\t++iterationCount;\r\n\t\tif(assignment.isComplete(csp) || iterationCount>10000){\r\n\t\t\treturn assignment;\r\n\t\t}\r\n\t\tString var=selectUnassignedVariable(csp, assignment);\r\n\t\tList<E> values= orderDomainValues(csp, var, assignment);\r\n\t\tfor(int i=0;i<values.size();i++){\r\n\t\t\tassignment.put(var,values.get(i));\r\n\t\t\tif(csp.isConsistent(assignment)){\r\n\t\t\t\tInference<E> inference=ForwardCheckingCSPSolver.inference(csp, assignment, var, values.get(i));\r\n\t\t\t\tif(inference!=null){\r\n\t\t\t\t\tinference.reduceDomain(csp);\r\n\t\t\t\t\tAssignment<E> result = backtrackFC(csp, assignment);\r\n\t\t\t\t\tinference.restoreDomain(csp);\r\n\t\t\t\t\tif(result!=null){\r\n\t\t\t\t\t\treturn result;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tassignment.remove(var);\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "@Override\npublic boolean restrictNeighborhood(Solution solution)\n{\n\n\tSolver solver = solution.getSolver();\n\tint nbTotalVars = solver.getNbIntVars() - 1;\n\n\tint n = nbTotalVars - nbRelaxedVars;\n\tboolean b = false;\n\tIntVar var;\n\tselected.clear();\n\twhile (n > 0) {\n\t\tint index = random.nextInt(nbTotalVars);\n\t\tvar = solver.getIntVarQuick(index);\n\t\tif (var != solver.getObjective() && !selected.contains(index)) {\n\t\t\tif (solution.getIntValue(index) != Solution.NULL) {\n\t\t\t\tsolver.LOGGER.info(\"fix \" + var);\n\t\t\t\tsolver.post(solver.eq(var, solution.getIntValue(index)));\n\t\t\t\tb = true;\n\t\t\t}\n\t\t\tselected.add(index);\n\t\t\tn--;\n\t\t}\n\t}\n\treturn b;\n}", "protected IPlanningGoal selectGoal(){ \n List<IPlanningGoal> relevantGoals = representation.getRelevantGoals(body);\n \n //If we have failed to find plans for high priority goals and environment has not changed, lets try some \n //lower priority ones\n if(numFailuresSinceLastImportantEnvChange < relevantGoals.size()){\n return relevantGoals.get(numFailuresSinceLastImportantEnvChange);\n } else {\n //tried all relevant goals but all failed, lets try it once more\n representation.setMarker(body);\n numFailuresSinceLastImportantEnvChange = 0;\n return relevantGoals.get(0);\n }\n }", "public boolean execute(X86CondJmpInstruction inst, Formulas formulas, BPPath path, boolean condition,\n\t\t\tX86TransitionRule rule) {\n\t\tBPState curState = path.getCurrentState();\n\t\tEnvironment env = curState.getEnvironement();\n\n\t\tboolean reverseCond = !condition;\n\t\tString instName = inst.getName();\n\t\tboolean isFeasible = true;\n\n\t\t// structure: create new work associated with condition-false case\n\t\t// jump to condition-true case\n\t\t// add state condition into each trace\n\t\t// SymbolicCondition compareStatus = prevState.getCompareStatus();\n\t\t// we accept loop not to be constrained by compareStatus\n\t\tif (inst.getName().equals(\"loop\")) {\n\t\t\t// Dang xu li, chua hoan hao\n\t\t\t// Se check sau voi 1 so truong hop cu the\n\t\t\tProgram.getProgram().setTechnique(\"Encrypt/Decrypt-May\");\n\t\t\tProgram.getProgram().setDetailTechnique(\"Encrypt/Decrypt-May:\" + curState.getLocation() + \" \");\n\t\t\t// env.getRegister().sub(\"%ecx\", new LongValue(1));\n\t\t\tValue ecx = env.getRegister().getRegisterValue(\"%ecx\");\n\n\t\t\tif (reverseCond) {\n\t\t\t\tif (ecx instanceof LongValue) {\n\t\t\t\t\tlong e = ((LongValue) ecx).getValue();\n\n\t\t\t\t\tif (e <= 0)\n\t\t\t\t\t\t// System.out.println(\"Loop Right\")\n\t\t\t\t\t\t;\n\t\t\t\t\telse {\n\t\t\t\t\t\t// curState.setFeasiblePath(false);\n\t\t\t\t\t\tisFeasible = false;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// ecx = ecx.subFunction(new LongValue(1));\n\t\t\t\t\tformulas.add((new Formula(ecx, new LongValue(0), \"==\")).evaluate());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (ecx instanceof LongValue) {\n\t\t\t\t\tlong e = ((LongValue) ecx).getValue();\n\n\t\t\t\t\tif (e > 0) {\n\t\t\t\t\t\t// System.out.println(\"Loop Right\")\n\t\t\t\t\t\t// curState.setFeasiblePath(true);\n\t\t\t\t\t\t// return\n\t\t\t\t\t\t;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// System.out.println(\"Debug Loop\");\n\t\t\t\t\t\t// curState.setFeasiblePath(false);\n\t\t\t\t\t\tisFeasible = false;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// ecx = ecx.subFunction(new LongValue(1));\n\t\t\t\t\tValue l1 = (new HybridBooleanValue(ecx, new LongValue(0), \"==\")).evaluate();\n\t\t\t\t\tformulas.add((new Formula(l1, \"not\")).evaluate());\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (inst.getName().equals(\"loope\") || inst.getName().equals(\"loopz\")) {\n\t\t\t// Dang xu li, chua hoan hao\n\t\t\t// Se check sau voi 1 so truong hop cu the\n\t\t\tProgram.getProgram().setTechnique(\"Encrypt/Decrypt-May\");\n\t\t\tProgram.getProgram().setDetailTechnique(\"Encrypt/Decrypt-May:\" + curState.getLocation() + \" \");\n\n\t\t\tValue ecx = env.getRegister().getRegisterValue(\"%ecx\");\n\t\t\tValue zf = env.getFlag().getZFlag();\n\t\t\tif (reverseCond) {\n\t\t\t\tif (ecx instanceof LongValue && zf instanceof BooleanValue) {\n\t\t\t\t\tlong e = ((LongValue) ecx).getValue();\n\t\t\t\t\tboolean z = ((BooleanValue) zf).getValue();\n\n\t\t\t\t\tif (e == 0 || !z)\n\t\t\t\t\t\t// System.out.println(\"Loop Right\")\n\t\t\t\t\t\t;\n\t\t\t\t\telse {\n\t\t\t\t\t\tcurState.setFeasiblePath(false);\n\t\t\t\t\t\tisFeasible = false;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tValue l1 = (new HybridBooleanValue(ecx, new LongValue(0), \"==\")).evaluate();\n\t\t\t\t\tValue l2 = (new HybridBooleanValue(zf, new BooleanValue(false), \"==\")).evaluate();\n\t\t\t\t\tformulas.add((new Formula(l1, l2, \"or\")).evaluate());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (ecx instanceof LongValue && zf instanceof BooleanValue) {\n\t\t\t\t\tlong e = ((LongValue) ecx).getValue();\n\t\t\t\t\tboolean z = ((BooleanValue) zf).getValue();\n\n\t\t\t\t\tif (e != 0 && z) {\n\t\t\t\t\t\t// System.out.println(\"Loop Right\")\n\t\t\t\t\t\t// curState.setFeasiblePath(true);\n\t\t\t\t\t\t// return\n\t\t\t\t\t\t;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// System.out.println(\"Debug Loop\");\n\t\t\t\t\t\tcurState.setFeasiblePath(false);\n\t\t\t\t\t\tisFeasible = false;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tValue l1 = (new HybridBooleanValue(ecx, new LongValue(0), \"!=\")).evaluate();\n\t\t\t\t\t// Value l2 = new HybridBooleanValue(l1, \"not\", null);\n\t\t\t\t\tformulas.add((new Formula(l1, zf, \"and\")).evaluate());\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else if (inst.getName().equals(\"loopne\") || inst.getName().equals(\"loopnz\")) {\n\t\t\t// Dang xu li, chua hoan hao\n\t\t\t// Se check sau voi 1 so truong hop cu the\n\t\t\tProgram.getProgram().setTechnique(\"Encrypt/Decrypt-May\");\n\t\t\tProgram.getProgram().setDetailTechnique(\"Encrypt/Decrypt-May:\" + curState.getLocation() + \" \");\n\n\t\t\tValue ecx = env.getRegister().getRegisterValue(\"%ecx\");\n\t\t\tValue zf = env.getFlag().getZFlag();\n\t\t\tif (reverseCond) {\n\t\t\t\tif (ecx instanceof LongValue && zf instanceof BooleanValue) {\n\t\t\t\t\tlong e = ((LongValue) ecx).getValue();\n\t\t\t\t\tboolean z = ((BooleanValue) zf).getValue();\n\n\t\t\t\t\tif (e == 0 || z)\n\t\t\t\t\t\t// System.out.println(\"Loop Right\")\n\t\t\t\t\t\t;\n\t\t\t\t\telse {\n\t\t\t\t\t\tcurState.setFeasiblePath(false);\n\t\t\t\t\t\tisFeasible = false;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tValue l1 = (new HybridBooleanValue(ecx, new LongValue(0), \"==\")).evaluate();\n\n\t\t\t\t\tformulas.add((new Formula(l1, zf, \"or\")).evaluate());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (ecx instanceof LongValue && zf instanceof BooleanValue) {\n\t\t\t\t\tlong e = ((LongValue) ecx).getValue();\n\t\t\t\t\tboolean z = ((BooleanValue) zf).getValue();\n\n\t\t\t\t\tif (e != 0 && !z) {\n\t\t\t\t\t\t// System.out.println(\"Loop Right\")\n\t\t\t\t\t\t// curState.setFeasiblePath(true);\n\t\t\t\t\t\t// return\n\t\t\t\t\t\t;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// System.out.println(\"Debug Loop\");\n\t\t\t\t\t\tcurState.setFeasiblePath(false);\n\t\t\t\t\t\tisFeasible = false;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tValue l1 = (new HybridBooleanValue(ecx, new LongValue(0), \"!=\")).evaluate();\n\t\t\t\t\tValue l2 = (new HybridBooleanValue(zf, new BooleanValue(false), \"==\")).evaluate();\n\t\t\t\t\tformulas.add((new Formula(l1, l2, \"and\")).evaluate());\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else if (instName.equals(\"ja\") || instName.equals(\"jnbe\")) {\n\t\t\t// if\n\t\t\t// ((CF) = 0) or ((ZF) = 0)\n\t\t\t// Not finished\n\t\t\tValue l1 = (new HybridBooleanValue(env.getFlag().getCFlag(), \"==\", new BooleanValue(0))).evaluate();\n\t\t\tValue l2 = (new HybridBooleanValue(env.getFlag().getZFlag(), \"==\", new BooleanValue(0))).evaluate();\n\n\t\t\tif (reverseCond) {\n\t\t\t\t// Exp l3 = new OtherBooleanValue(l1, l2, \"or\");\n\t\t\t\t// formulas.add(new Formula(l3, \"not\"));\n\t\t\t\tl1 = (new HybridBooleanValue(env.getFlag().getCFlag(), \"==\", new BooleanValue(1))).evaluate();\n\t\t\t\tl2 = (new HybridBooleanValue(env.getFlag().getZFlag(), \"==\", new BooleanValue(1))).evaluate();\n\t\t\t\t// Exp l3 = new OtherBooleanValue(l1, l2, \"and\");\n\t\t\t\t// formulas.add(new Formula(l1, l2, \"or\"));\n\n\t\t\t\t// PHONG: fix here\n\t\t\t\tformulas.add((new Formula(l1, l2, \"or\")).evaluate());\n\t\t\t} else\n\t\t\t\t// formulas.add(new Formula(l1, l2, \"or\"));\n\t\t\t\tformulas.add((new Formula(l1, l2, \"and\")).evaluate());\n\t\t} else if (instName.equals(\"jae\") || instName.equals(\"jnb\")) {\n\t\t\t// if\n\t\t\t// ((CF) = 0)\n\t\t\tif (reverseCond) {\n\t\t\t\tif (env.getFlag().getCFlag() instanceof BooleanValue) {\n\t\t\t\t\tboolean z = ((BooleanValue) env.getFlag().getCFlag()).getValue();\n\t\t\t\t\t// Truong hop sai\n\t\t\t\t\t// Je khong dung, nghia la khong the thuc hien lenh nhay\n\t\t\t\t\t// duoc, do dieu kien dang bi sai\n\t\t\t\t\t// phai tiep tuc thuc hien\n\t\t\t\t\t// Can phai chinh sua them\n\t\t\t\t\tif (!z) {\n\t\t\t\t\t\t// curState.setFeasiblePath(false);\n\t\t\t\t\t\tisFeasible = false;\n\t\t\t\t\t\t// System.out.println(\"Debug\");\n\t\t\t\t\t} else\n\t\t\t\t\t\t// System.out.println(\"Right\")\n\t\t\t\t\t\t;\n\t\t\t\t\t// Truong hop dung, khong lam gi ca\n\t\t\t\t} else {\n\t\t\t\t\tValue l1 = (new HybridBooleanValue(env.getFlag().getCFlag(), new BooleanValue(0), \"==\")).evaluate();\n\t\t\t\t\tformulas.add((new Formula(l1, \"not\")).evaluate());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (env.getFlag().getCFlag() instanceof BooleanValue) {\n\t\t\t\t\tboolean z = ((BooleanValue) env.getFlag().getCFlag()).getValue();\n\t\t\t\t\t// Truong hop sai\n\t\t\t\t\t// Je khong dung, nghia la khong the thuc hien lenh nhay\n\t\t\t\t\t// duoc, do dieu kien dang bi sai\n\t\t\t\t\t// phai tiep tuc thuc hien\n\t\t\t\t\t// Can phai chinh sua them\n\t\t\t\t\tif (z) {\n\t\t\t\t\t\t// curState.setFeasiblePath(false);\n\t\t\t\t\t\tisFeasible = false;\n\t\t\t\t\t\t// System.out.println(\"Debug\");\n\t\t\t\t\t} // else\n\t\t\t\t\t\t// System.out.println(\"Right\");\n\t\t\t\t\t// Truong hop dung, khong lam gi ca\n\t\t\t\t} else {\n\t\t\t\t\tformulas.add((new Formula(env.getFlag().getCFlag(), new BooleanValue(0), \"==\")).evaluate());\n\t\t\t\t}\n\t\t\t\t// formulas.add(new Formula(env.getFlag().getzFlag(), new\n\t\t\t\t// ConstantBooleanValue(0), \"==\"));\n\t\t\t}\n\t\t} else if (instName.equals(\"jb\") || instName.equals(\"jnae\")) {\n\t\t\t// if\n\t\t\t// ((CF) = 1)\n\t\t\tif (reverseCond) {\n\t\t\t\tif (env.getFlag().getCFlag() instanceof BooleanValue) {\n\t\t\t\t\tboolean z = ((BooleanValue) env.getFlag().getCFlag()).getValue();\n\t\t\t\t\t// Truong hop sai\n\t\t\t\t\t// Je khong dung, nghia la khong the thuc hien lenh nhay\n\t\t\t\t\t// duoc, do dieu kien dang bi sai\n\t\t\t\t\t// phai tiep tuc thuc hien\n\t\t\t\t\t// Can phai chinh sua them\n\t\t\t\t\tif (z) {\n\t\t\t\t\t\tisFeasible = false;\n\t\t\t\t\t\t// System.out.println(\"Debug\");\n\t\t\t\t\t}// else System.out.println(\"Right\");\n\t\t\t\t\t\t// Truong hop dung, khong lam gi ca\n\t\t\t\t} else {\n\t\t\t\t\tValue l1 = (new HybridBooleanValue(env.getFlag().getCFlag(), new BooleanValue(1), \"==\").evaluate());\n\t\t\t\t\tformulas.add((new Formula(l1, \"not\")).evaluate());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (env.getFlag().getCFlag() instanceof BooleanValue) {\n\t\t\t\t\tboolean z = ((BooleanValue) env.getFlag().getCFlag()).getValue();\n\t\t\t\t\tif (!z) {\n\t\t\t\t\t\tisFeasible = false;\n\t\t\t\t\t\t// System.out.println(\"Debug\");\n\t\t\t\t\t}// else System.out.println(\"Right\");\n\t\t\t\t\t\t// else\n\t\t\t\t\t\t// this.curState.setFeasiblePath(false);\n\n\t\t\t\t\t// Truong hop dung, khong lam gi ca\n\t\t\t\t} else\n\t\t\t\t\tformulas.add((new Formula(env.getFlag().getCFlag(), new BooleanValue(1), \"==\")).evaluate());\n\t\t\t}\n\t\t} else if (instName.equals(\"jbe\") || instName.equals(\"jna\")) {\n\t\t\t// if\n\t\t\t// ((CF) = 1) or ((ZF) = 1)\n\t\t\t// Not finished\n\t\t\tValue l1 = (new HybridBooleanValue(env.getFlag().getCFlag(), \"==\", new BooleanValue(1)).evaluate());\n\t\t\tValue l2 = (new HybridBooleanValue(env.getFlag().getZFlag(), \"==\", new BooleanValue(1)).evaluate());\n\n\t\t\tif (reverseCond) {\n\t\t\t\tif (env.getFlag().getCFlag() instanceof BooleanValue\n\t\t\t\t\t\t&& env.getFlag().getZFlag() instanceof BooleanValue) {\n\t\t\t\t\tboolean z = ((BooleanValue) env.getFlag().getZFlag()).getValue();\n\t\t\t\t\tboolean c = ((BooleanValue) env.getFlag().getCFlag()).getValue();\n\t\t\t\t\tif (z || c) {\n\t\t\t\t\t\tisFeasible = false;\n\t\t\t\t\t\t// System.out.println(\"Debug\");\n\t\t\t\t\t} // else System.out.println(\"Right\");\n\n\t\t\t\t} else {\n\t\t\t\t\tValue l3 = (new HybridBooleanValue(l1, l2, \"or\").evaluate());\n\t\t\t\t\tformulas.add((new Formula(l3, \"not\")).evaluate());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (env.getFlag().getCFlag() instanceof BooleanValue\n\t\t\t\t\t\t&& env.getFlag().getZFlag() instanceof BooleanValue) {\n\t\t\t\t\tboolean z = ((BooleanValue) env.getFlag().getZFlag()).getValue();\n\t\t\t\t\tboolean c = ((BooleanValue) env.getFlag().getCFlag()).getValue();\n\t\t\t\t\tif (!(z || c)) {\n\t\t\t\t\t\tisFeasible = false;\n\t\t\t\t\t\t// System.out.println(\"Debug\");\n\t\t\t\t\t} // else System.out.println(\"Right\");\n\n\t\t\t\t} else {\n\t\t\t\t\tformulas.add((new Formula(l1, l2, \"or\")).evaluate());\n\t\t\t\t}\n\t\t\t}\n\t\t\t/*\n\t\t\t * formulas.add(new Formula(env.getFlag().getcFlag(), new\n\t\t\t * ConstantBooleanValue(1), \"==\"));\n\t\t\t */\n\t\t} else if (instName.equals(\"jc\")) {\n\t\t\t// if\n\t\t\t// ((CF) = 1)\n\t\t\tif (reverseCond) {\n\t\t\t\tif (env.getFlag().getCFlag() instanceof BooleanValue) {\n\t\t\t\t\tboolean z = ((BooleanValue) env.getFlag().getCFlag()).getValue();\n\t\t\t\t\tif (z) {\n\t\t\t\t\t\tisFeasible = false;\n\t\t\t\t\t\t// System.out.println(\"Debug\");\n\t\t\t\t\t} // else System.out.println(\"Right\");\n\t\t\t\t\t\t// Truong hop dung, khong lam gi ca\n\t\t\t\t} else {\n\t\t\t\t\tValue l1 = (new HybridBooleanValue(env.getFlag().getCFlag(), new BooleanValue(1), \"==\").evaluate());\n\t\t\t\t\tformulas.add((new Formula(l1, \"not\")).evaluate());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (env.getFlag().getCFlag() instanceof BooleanValue) {\n\t\t\t\t\tboolean z = ((BooleanValue) env.getFlag().getCFlag()).getValue();\n\t\t\t\t\tif (!z) {\n\t\t\t\t\t\tisFeasible = false;\n\t\t\t\t\t\t// System.out.println(\"Debug\");\n\t\t\t\t\t}// else System.out.println(\"Right\");\n\t\t\t\t\t\t// else\n\t\t\t\t\t\t// this.curState.setFeasiblePath(false);\n\n\t\t\t\t\t// Truong hop dung, khong lam gi ca\n\t\t\t\t} else\n\t\t\t\t\tformulas.add((new Formula(env.getFlag().getCFlag(), new BooleanValue(1), \"==\")).evaluate());\n\t\t\t}\n\t\t} else if (instName.equals(\"jcxz\")) {\n\t\t\t// if\n\t\t\t// ((CF) = 0)\n\t\t\tif (reverseCond) {\n\t\t\t\tif (env.getFlag().getCFlag() instanceof BooleanValue) {\n\t\t\t\t\tboolean z = ((BooleanValue) env.getFlag().getCFlag()).getValue();\n\t\t\t\t\tif (!z) {\n\t\t\t\t\t\tisFeasible = false;\n\t\t\t\t\t\t// System.out.println(\"Debug\");\n\t\t\t\t\t} // else System.out.println(\"Right\");\n\n\t\t\t\t\t// Truong hop dung, khong lam gi ca\n\t\t\t\t} else {\n\t\t\t\t\tValue l1 = (new HybridBooleanValue(env.getFlag().getCFlag(), new BooleanValue(0), \"==\").evaluate());\n\t\t\t\t\tformulas.add((new Formula(l1, \"not\")).evaluate());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (env.getFlag().getCFlag() instanceof BooleanValue) {\n\t\t\t\t\tboolean z = ((BooleanValue) env.getFlag().getCFlag()).getValue();\n\t\t\t\t\tif (z) {\n\t\t\t\t\t\tisFeasible = false;\n\t\t\t\t\t\t// System.out.println(\"Debug\");\n\t\t\t\t\t}// else System.out.println(\"Right\");\n\n\t\t\t\t\t// Truong hop dung, khong lam gi ca\n\t\t\t\t} else {\n\t\t\t\t\tformulas.add((new Formula(env.getFlag().getCFlag(), new BooleanValue(0), \"==\")).evaluate());\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (instName.equals(\"je\") || instName.equals(\"jz\")) {\n\t\t\t// if\n\t\t\t// ((ZF) = 1)\n\n\t\t\t// Truong hop dac biet, se xu li sau\n\t\t\t/*\n\t\t\t * if\n\t\t\t * (Program.getProgram().getFileName().equals(\"Virus.Win32.Aztec.01\"\n\t\t\t * ) && ( // (this.targetIndirect.toString().equals(\"0x00401135\") &&\n\t\t\t * // this.targetTemp.toString().equals(\"0x004010ce\")) // ||\n\t\t\t * (this.targetIndirect.toString().equals(\"0x004012d0\") // &&\n\t\t\t * this.targetTemp.toString().equals(\"0x0040114e\")) // ||\n\t\t\t * (this.targetIndirect.toString().equals(\"0x004012bd\") // &&\n\t\t\t * this.targetTemp.toString().equals(\"0x00401168\")) // ||\n\t\t\t * (this.targetIndirect.toString().equals(\"0x004012d6\") // &&\n\t\t\t * this.targetTemp.toString().equals(\"0x00401168\"))\n\t\t\t * \n\t\t\t * // || (this.targetIndirect.toString().equals(\"0x004010b1\") // &&\n\t\t\t * this.targetTemp.toString().equals(\"0x004010ce\"))\n\t\t\t * (this.targetIndirect.toString().equals(\"0x0040134b\") &&\n\t\t\t * this.targetTemp .toString().equals(\"0x00401198\")) ||\n\t\t\t * (this.targetIndirect.toString().equals( \"0x0040134b\") &&\n\t\t\t * this.targetTemp.toString() .equals(\"0x004011a5\")) ||\n\t\t\t * (this.targetIndirect.toString().equals( \"0x004012bd\") &&\n\t\t\t * this.targetTemp.toString() .equals(\"0x004011a5\")) ||\n\t\t\t * (this.targetIndirect.toString().equals( \"0x004012dc\") &&\n\t\t\t * this.targetTemp.toString() .equals(\"0x004011a5\")) ||\n\t\t\t * (this.targetIndirect.toString().equals( \"0x004012d0\") &&\n\t\t\t * this.targetTemp.toString() .equals(\"0x004011a5\")) ||\n\t\t\t * (this.targetIndirect.toString().equals( \"0x004012d6\") &&\n\t\t\t * this.targetTemp.toString() .equals(\"0x004011a5\")) ||\n\t\t\t * (this.targetIndirect.toString().equals( \"0x004012d6\") &&\n\t\t\t * this.targetTemp.toString() .equals(\"0x0040114e\")) ||\n\t\t\t * (this.targetIndirect .toString().equals(\"0x0040111f\") &&\n\t\t\t * this.targetTemp .toString().equals(\"0x0040114e\")))) return;\n\t\t\t */\n\n\t\t\tif (reverseCond) {\n\t\t\t\tif (env.getFlag().getZFlag() instanceof BooleanValue) {\n\t\t\t\t\tboolean z = ((BooleanValue) env.getFlag().getZFlag()).getValue();\n\t\t\t\t\t// Truong hop sai\n\t\t\t\t\t// Je khong dung, nghia la khong the thuc hien lenh nhay\n\t\t\t\t\t// duoc, do dieu kien dang bi sai\n\t\t\t\t\t// phai tiep tuc thuc hien\n\t\t\t\t\t// Can phai chinh sua them\n\t\t\t\t\tif (z) {\n\t\t\t\t\t\tisFeasible = false;\n\t\t\t\t\t\t// System.out.println(\"Debug\");\n\t\t\t\t\t} else\n\t\t\t\t\t\t// System.out.println(\"Right\")\n\t\t\t\t\t\t;\n\t\t\t\t\t// Truong hop dung, khong lam gi ca\n\t\t\t\t} else {\n\t\t\t\t\t/*\n\t\t\t\t\t * Value l1 = new\n\t\t\t\t\t * HybridBooleanValue(env.getFlag().getZFlag(), new\n\t\t\t\t\t * BooleanValue(1), \"==\"); formulas.add(new Formula(l1,\n\t\t\t\t\t * \"not\"));\n\t\t\t\t\t */\n\t\t\t\t\tformulas.add((new Formula(env.getFlag().getZFlag(), new BooleanValue(0), \"==\")).evaluate());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (env.getFlag().getZFlag() instanceof BooleanValue) {\n\t\t\t\t\tboolean z = ((BooleanValue) env.getFlag().getZFlag()).getValue();\n\t\t\t\t\t// Truong hop sai\n\t\t\t\t\t// Je khong dung, nghia la khong the thuc hien lenh nhay\n\t\t\t\t\t// duoc, do dieu kien dang bi sai\n\t\t\t\t\t// phai tiep tuc thuc hien\n\n\t\t\t\t\tif (!z) {\n\t\t\t\t\t\tisFeasible = false;\n\t\t\t\t\t\t// System.out.println(\"Debug\");\n\t\t\t\t\t} else\n\t\t\t\t\t\t// else\n\t\t\t\t\t\t// this.curState.setFeasiblePath(false);\n\t\t\t\t\t\t// System.out.println(\"Right\")\n\t\t\t\t\t\t;\n\t\t\t\t\t// Truong hop dung, khong lam gi ca\n\t\t\t\t} else\n\t\t\t\t\tformulas.add((new Formula(env.getFlag().getZFlag(), new BooleanValue(1), \"==\")).evaluate());\n\t\t\t}\n\t\t} else if (instName.equals(\"jg\") || instName.equals(\"jnle\")) {\n\t\t\t// if\n\t\t\t// ((SF) = (OF)) and ((ZF) = 0)\n\t\t\tValue l1 = (new HybridBooleanValue(env.getFlag().getZFlag(), new BooleanValue(0), \"==\").evaluate());\n\t\t\tValue l2 = (new HybridBooleanValue(env.getFlag().getSFlag(), env.getFlag().getOFlag(), \"==\").evaluate());\n\n\t\t\tif (reverseCond) {\n\t\t\t\tValue l3 = (new HybridBooleanValue(l1, l2, \"and\").evaluate());\n\t\t\t\tformulas.add((new Formula(l3, \"not\")).evaluate());\n\t\t\t} else\n\t\t\t\tformulas.add((new Formula(l1, l2, \"and\")).evaluate());\n\n\t\t\t// formulas.add(new Formula(env.getFlag().getzFlag(), new\n\t\t\t// ConstantBooleanValue(0), \"==\"));\n\t\t\t// formulas.add(new Formula(env.getFlag().getsFlag(),\n\t\t\t// env.getFlag().getoFlag(), \"==\"));\n\t\t} else if (instName.equals(\"jge\") || instName.equals(\"jnl\")) {\n\t\t\t// if\n\t\t\t// (SF) = (OF)\n\n\t\t\tif (reverseCond) {\n\t\t\t\tValue l1 = (new HybridBooleanValue(env.getFlag().getSFlag(), env.getFlag().getOFlag(), \"==\").evaluate());\n\t\t\t\tformulas.add((new Formula(l1, \"not\")).evaluate());\n\t\t\t} else\n\t\t\t\tformulas.add((new Formula(env.getFlag().getSFlag(), env.getFlag().getOFlag(), \"==\")).evaluate());\n\t\t} else if (instName.equals(\"jl\") || instName.equals(\"jnge\")) {\n\t\t\t// if\n\t\t\t// (SF) ≠ (OF)\n\t\t\t// formulas.add(new Formula(env.getFlag().getsFlag(),\n\t\t\t// env.getFlag().getoFlag(), \"!=\"));\n\t\t\tif (reverseCond) {\n\t\t\t\tValue l1 = (new HybridBooleanValue(env.getFlag().getSFlag(), env.getFlag().getOFlag(), \"!=\").evaluate());\n\t\t\t\tformulas.add((new Formula(l1, \"not\")).evaluate());\n\t\t\t} else\n\t\t\t\tformulas.add((new Formula(env.getFlag().getSFlag(), env.getFlag().getOFlag(), \"!=\")).evaluate());\n\t\t} else if (instName.equals(\"jle\") || instName.equals(\"jng\")) {\n\t\t\t// if\n\t\t\t// ((SF) ≠ (OF)) or ((ZF) = 1)\n\t\t\t// Focus on ZF = 1\n\t\t\t// not finished\n\t\t\t// Change due to Demo1\n\t\t\t// OtherExp l1 = new OtherExp(env.getFlag().getzFlag(), new\n\t\t\t// ConstantBooleanValue(1), \"=\");\n\t\t\tValue l1 = env.getFlag().getZFlag();\n\t\t\tValue l2 = (new HybridBooleanValue(env.getFlag().getSFlag(), env.getFlag().getOFlag(), \"xor\")).evaluate();\n\t\t\t// OtherExp l3 = new OtherExp(l2, new ConstantLongExp(0), \"!=\");\n\n\t\t\tif (reverseCond) {\n\t\t\t\tValue l3 = (new HybridBooleanValue(l1, l2, \"or\")).evaluate();\n\t\t\t\tformulas.add((new Formula(l3, \"not\")).evaluate());\n\t\t\t} else\n\t\t\t\tformulas.add((new Formula(l1, l2, \"or\")).evaluate());\n\n\t\t\t// formulas.add(new Formula(env.getFlag().getzFlag(), new\n\t\t\t// ConstantBooleanValue(1), \"=\"));\n\n\t\t\t/*\n\t\t\t * OtherExp l1 = new OtherExp(env.getFlag().getcFlag(), \"!=\", new\n\t\t\t * ConstantBooleanValue(0)); OtherExp l2 = new\n\t\t\t * OtherExp(env.getFlag().getzFlag(), \"!=\", new\n\t\t\t * ConstantBooleanValue(0)); formulas.add(new Formula(l1, l2,\n\t\t\t * \"and\"));\n\t\t\t */\n\t\t} else if (instName.equals(\"jnc\")) {\n\t\t\t// if\n\t\t\t// ((CF) = 0)\n\t\t\tif (reverseCond) {\n\t\t\t\tif (env.getFlag().getCFlag() instanceof BooleanValue) {\n\t\t\t\t\tboolean z = ((BooleanValue) env.getFlag().getCFlag()).getValue();\n\t\t\t\t\t// Truong hop sai\n\t\t\t\t\t// Je khong dung, nghia la khong the thuc hien lenh nhay\n\t\t\t\t\t// duoc, do dieu kien dang bi sai\n\t\t\t\t\t// phai tiep tuc thuc hien\n\t\t\t\t\t// Can phai chinh sua them\n\t\t\t\t\tif (!z) {\n\t\t\t\t\t\tisFeasible = false;\n\t\t\t\t\t\t// System.out.println(\"Debug\");\n\t\t\t\t\t} // else System.out.println(\"Right\");\n\t\t\t\t\t\t// Truong hop dung, khong lam gi ca\n\t\t\t\t} else {\n\t\t\t\t\tValue l1 = (new HybridBooleanValue(env.getFlag().getCFlag(), new BooleanValue(0), \"==\").evaluate());\n\t\t\t\t\tformulas.add((new Formula(l1, \"not\")).evaluate());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (env.getFlag().getCFlag() instanceof BooleanValue) {\n\t\t\t\t\tboolean z = ((BooleanValue) env.getFlag().getCFlag()).getValue();\n\t\t\t\t\t// Truong hop sai\n\t\t\t\t\t// Je khong dung, nghia la khong the thuc hien lenh nhay\n\t\t\t\t\t// duoc, do dieu kien dang bi sai\n\t\t\t\t\t// phai tiep tuc thuc hien\n\t\t\t\t\t// Can phai chinh sua them\n\t\t\t\t\tif (z) {\n\t\t\t\t\t\tisFeasible = false;\n\t\t\t\t\t\t// System.out.println(\"Debug\");\n\t\t\t\t\t}// else System.out.println(\"Right\");\n\t\t\t\t\t\t// Truong hop dung, khong lam gi ca\n\t\t\t\t} else {\n\t\t\t\t\tformulas.add((new Formula(env.getFlag().getCFlag(), new BooleanValue(0), \"==\")).evaluate());\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (instName.equals(\"jne\") || instName.equals(\"jnz\")) {\n\t\t\tif (reverseCond) {\n\t\t\t\tif (env.getFlag().getZFlag() instanceof BooleanValue) {\n\t\t\t\t\tboolean z = ((BooleanValue) env.getFlag().getZFlag()).getValue();\n\t\t\t\t\t// Truong hop sai\n\t\t\t\t\t// Je khong dung, nghia la khong the thuc hien lenh nhay\n\t\t\t\t\t// duoc, do dieu kien dang bi sai\n\t\t\t\t\t// phai tiep tuc thuc hien\n\t\t\t\t\t// Can phai chinh sua them\n\t\t\t\t\tif (!z) {\n\t\t\t\t\t\tisFeasible = false;\n\t\t\t\t\t\t// System.out.println(\"Debug\");\n\t\t\t\t\t} else\n\t\t\t\t\t\t// HAS SOMETHING STRANGE HERE\n\t\t\t\t\t\t// if\n\t\t\t\t\t\t// (((LongValue)(curState.getEnvironement().getRegister().getRegisterValue(\"esi\"))).getValueOperand()\n\t\t\t\t\t\t// == 0x4091b0){\n\t\t\t\t\t\t// // ADD at 4097c7 has something wrong with esi =\n\t\t\t\t\t\t// 004091ae\n\t\t\t\t\t\t// System.out.println(z);\n\t\t\t\t\t\t// }\n\t\t\t\t\t\t// System.out.println(\"Right\")\n\n\t\t\t\t\t\t;\n\t\t\t\t\t// Truong hop dung, khong lam gi ca\n\t\t\t\t} else {\n\t\t\t\t\tValue l1 = (new HybridBooleanValue(env.getFlag().getZFlag(), new BooleanValue(0), \"==\").evaluate());\n\t\t\t\t\tformulas.add((new Formula(l1, \"not\")).evaluate());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (env.getFlag().getZFlag() instanceof BooleanValue) {\n\t\t\t\t\tboolean z = ((BooleanValue) env.getFlag().getZFlag()).getValue();\n\t\t\t\t\t// Truong hop sai\n\t\t\t\t\t// Je khong dung, nghia la khong the thuc hien lenh nhay\n\t\t\t\t\t// duoc, do dieu kien dang bi sai\n\t\t\t\t\t// phai tiep tuc thuc hien\n\t\t\t\t\t// Can phai chinh sua them\n\t\t\t\t\tif (z) {\n\t\t\t\t\t\tisFeasible = false;\n\t\t\t\t\t\t// System.out.println(\"Debug\");\n\t\t\t\t\t} else\n\t\t\t\t\t\t// System.out.println(\"Right\")\n\t\t\t\t\t\t;\n\t\t\t\t\t// Truong hop dung, khong lam gi ca\n\t\t\t\t} else {\n\t\t\t\t\tformulas.add((new Formula(env.getFlag().getZFlag(), new BooleanValue(0), \"==\")).evaluate());\n\t\t\t\t}\n\t\t\t\t// formulas.add(new Formula(env.getFlag().getzFlag(), new\n\t\t\t\t// ConstantBooleanValue(0), \"==\"));\n\t\t\t}\n\t\t} else if (instName.equals(\"jno\")) {\n\t\t\t// if\n\t\t\t// ((OF) = 0)\n\t\t\tif (reverseCond) {\n\t\t\t\tif (env.getFlag().getOFlag() instanceof BooleanValue) {\n\t\t\t\t\tboolean z = ((BooleanValue) env.getFlag().getOFlag()).getValue();\n\t\t\t\t\t// Truong hop sai\n\t\t\t\t\t// Je khong dung, nghia la khong the thuc hien lenh nhay\n\t\t\t\t\t// duoc, do dieu kien dang bi sai\n\t\t\t\t\t// phai tiep tuc thuc hien\n\t\t\t\t\t// Can phai chinh sua them\n\t\t\t\t\tif (!z) {\n\t\t\t\t\t\tisFeasible = false;\n\t\t\t\t\t\t// System.out.println(\"Debug\");\n\t\t\t\t\t} // else System.out.println(\"Right\");\n\t\t\t\t\t\t// Truong hop dung, khong lam gi ca\n\t\t\t\t} else {\n\t\t\t\t\tValue l1 = (new HybridBooleanValue(env.getFlag().getOFlag(), new BooleanValue(0), \"==\").evaluate());\n\t\t\t\t\tformulas.add((new Formula(l1, \"not\")).evaluate());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (env.getFlag().getOFlag() instanceof BooleanValue) {\n\t\t\t\t\tboolean z = ((BooleanValue) env.getFlag().getOFlag()).getValue();\n\t\t\t\t\t// Truong hop sai\n\t\t\t\t\t// Je khong dung, nghia la khong the thuc hien lenh nhay\n\t\t\t\t\t// duoc, do dieu kien dang bi sai\n\t\t\t\t\t// phai tiep tuc thuc hien\n\t\t\t\t\t// Can phai chinh sua them\n\t\t\t\t\tif (z) {\n\t\t\t\t\t\tisFeasible = false;\n\t\t\t\t\t\t// System.out.println(\"Debug\");\n\t\t\t\t\t}// else System.out.println(\"Right\");\n\t\t\t\t\t\t// Truong hop dung, khong lam gi ca\n\t\t\t\t} else {\n\t\t\t\t\tformulas.add((new Formula(env.getFlag().getOFlag(), new BooleanValue(0), \"==\")).evaluate());\n\t\t\t\t}\n\t\t\t\t// formulas.add(new Formula(env.getFlag().getzFlag(), new\n\t\t\t\t// ConstantBooleanValue(0), \"==\"));\n\t\t\t}\n\t\t\t/*\n\t\t\t * if (reCond) { Exp l1 = new\n\t\t\t * AdditionBooleanValue(env.getFlag().getoFlag(), new\n\t\t\t * BooleanValue(0), \"==\"); formulas.add(new Formula(l1, \"not\")); }\n\t\t\t * else formulas.add(new Formula(env.getFlag().getoFlag(), new\n\t\t\t * BooleanValue(0), \"==\"));\n\t\t\t */\n\t\t\t// formulas.add(new Formula(env.getFlag().getoFlag(), new\n\t\t\t// ConstantBooleanValue(0), \"==\"));\n\t\t} else if (instName.equals(\"jns\")) {\n\t\t\t// if\n\t\t\t// ((SF) = 0)\n\t\t\tif (reverseCond) {\n\t\t\t\tif (env.getFlag().getSFlag() instanceof BooleanValue) {\n\t\t\t\t\tboolean z = ((BooleanValue) env.getFlag().getSFlag()).getValue();\n\t\t\t\t\t// Truong hop sai\n\t\t\t\t\t// Je khong dung, nghia la khong the thuc hien lenh nhay\n\t\t\t\t\t// duoc, do dieu kien dang bi sai\n\t\t\t\t\t// phai tiep tuc thuc hien\n\t\t\t\t\t// Can phai chinh sua them\n\t\t\t\t\tif (!z) {\n\t\t\t\t\t\tisFeasible = false;\n\t\t\t\t\t\t// System.out.println(\"Debug\");\n\t\t\t\t\t} // else System.out.println(\"Right\");\n\t\t\t\t\t\t// Truong hop dung, khong lam gi ca\n\t\t\t\t} else {\n\t\t\t\t\tValue l1 = (new HybridBooleanValue(env.getFlag().getSFlag(), new BooleanValue(0), \"==\").evaluate());\n\t\t\t\t\tformulas.add((new Formula(l1, \"not\")).evaluate());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (env.getFlag().getSFlag() instanceof BooleanValue) {\n\t\t\t\t\tboolean z = ((BooleanValue) env.getFlag().getSFlag()).getValue();\n\t\t\t\t\t// Truong hop sai\n\t\t\t\t\t// Je khong dung, nghia la khong the thuc hien lenh nhay\n\t\t\t\t\t// duoc, do dieu kien dang bi sai\n\t\t\t\t\t// phai tiep tuc thuc hien\n\t\t\t\t\t// Can phai chinh sua them\n\t\t\t\t\tif (z) {\n\t\t\t\t\t\tisFeasible = false;\n\t\t\t\t\t\t// System.out.println(\"Debug\");\n\t\t\t\t\t}// else System.out.println(\"Right\");\n\t\t\t\t\t\t// Truong hop dung, khong lam gi ca\n\t\t\t\t} else {\n\t\t\t\t\tformulas.add((new Formula(env.getFlag().getSFlag(), new BooleanValue(0), \"==\")).evaluate());\n\t\t\t\t}\n\t\t\t\t// formulas.add(new Formula(env.getFlag().getzFlag(), new\n\t\t\t\t// ConstantBooleanValue(0), \"==\"));\n\t\t\t}\n\t\t} else if (instName.equals(\"jnp\") || instName.equals(\"jpo\")) {\n\t\t\t// if\n\t\t\t// ((PF) = 0)\n\t\t\tif (reverseCond) {\n\t\t\t\tif (env.getFlag().getPFlag() instanceof BooleanValue) {\n\t\t\t\t\tboolean z = ((BooleanValue) env.getFlag().getPFlag()).getValue();\n\t\t\t\t\t// Truong hop sai\n\t\t\t\t\t// Je khong dung, nghia la khong the thuc hien lenh nhay\n\t\t\t\t\t// duoc, do dieu kien dang bi sai\n\t\t\t\t\t// phai tiep tuc thuc hien\n\t\t\t\t\t// Can phai chinh sua them\n\t\t\t\t\tif (!z) {\n\t\t\t\t\t\tisFeasible = false;\n\t\t\t\t\t\t// System.out.println(\"Debug\");\n\t\t\t\t\t} // else System.out.println(\"Right\");\n\t\t\t\t\t\t// Truong hop dung, khong lam gi ca\n\t\t\t\t} else {\n\t\t\t\t\tValue l1 = (new HybridBooleanValue(env.getFlag().getPFlag(), new BooleanValue(0), \"==\").evaluate());\n\t\t\t\t\tformulas.add((new Formula(l1, \"not\")).evaluate());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (env.getFlag().getPFlag() instanceof BooleanValue) {\n\t\t\t\t\tboolean z = ((BooleanValue) env.getFlag().getPFlag()).getValue();\n\t\t\t\t\t// Truong hop sai\n\t\t\t\t\t// Je khong dung, nghia la khong the thuc hien lenh nhay\n\t\t\t\t\t// duoc, do dieu kien dang bi sai\n\t\t\t\t\t// phai tiep tuc thuc hien\n\t\t\t\t\t// Can phai chinh sua them\n\t\t\t\t\tif (z) {\n\t\t\t\t\t\tisFeasible = false;\n\t\t\t\t\t\t// System.out.println(\"Debug\");\n\t\t\t\t\t} // else System.out.println(\"Right\");\n\t\t\t\t\t\t// Truong hop dung, khong lam gi ca\n\t\t\t\t} else {\n\t\t\t\t\tformulas.add((new Formula(env.getFlag().getPFlag(), new BooleanValue(0), \"==\")).evaluate());\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (instName.equals(\"jo\")) {\n\t\t\t// if\n\t\t\t// ((OF) = 1)\n\t\t\tif (reverseCond) {\n\t\t\t\tif (env.getFlag().getOFlag() instanceof BooleanValue) {\n\t\t\t\t\tboolean z = ((BooleanValue) env.getFlag().getOFlag()).getValue();\n\t\t\t\t\t// Truong hop sai\n\t\t\t\t\t// Je khong dung, nghia la khong the thuc hien lenh nhay\n\t\t\t\t\t// duoc, do dieu kien dang bi sai\n\t\t\t\t\t// phai tiep tuc thuc hien\n\t\t\t\t\t// Can phai chinh sua them\n\t\t\t\t\tif (z) {\n\t\t\t\t\t\tisFeasible = false;\n\t\t\t\t\t\t// System.out.println(\"Debug\");\n\t\t\t\t\t} // else System.out.println(\"Right\");\n\t\t\t\t\t\t// Truong hop dung, khong lam gi ca\n\t\t\t\t} else {\n\t\t\t\t\tValue l1 = (new HybridBooleanValue(env.getFlag().getOFlag(), new BooleanValue(1), \"==\").evaluate());\n\t\t\t\t\tformulas.add((new Formula(l1, \"not\")).evaluate());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (env.getFlag().getOFlag() instanceof BooleanValue) {\n\t\t\t\t\tboolean z = ((BooleanValue) env.getFlag().getOFlag()).getValue();\n\t\t\t\t\t// Truong hop sai\n\t\t\t\t\t// Je khong dung, nghia la khong the thuc hien lenh nhay\n\t\t\t\t\t// duoc, do dieu kien dang bi sai\n\t\t\t\t\t// phai tiep tuc thuc hien\n\t\t\t\t\tif (!z) {\n\t\t\t\t\t\tisFeasible = false;\n\t\t\t\t\t\t// System.out.println(\"Debug\");\n\t\t\t\t\t} // else System.out.println(\"Right\");\n\t\t\t\t\t\t// else\n\t\t\t\t\t\t// this.curState.setFeasiblePath(false);\n\n\t\t\t\t\t// Truong hop dung, khong lam gi ca\n\t\t\t\t} else\n\t\t\t\t\tformulas.add((new Formula(env.getFlag().getOFlag(), new BooleanValue(1), \"==\")).evaluate());\n\t\t\t}\n\t\t\t/*\n\t\t\t * if (reCond) { Exp l1 = new\n\t\t\t * AdditionBooleanValue(env.getFlag().getoFlag(), new\n\t\t\t * BooleanValue(1), \"==\"); formulas.add(new Formula(l1, \"not\")); }\n\t\t\t * else formulas.add(new Formula(env.getFlag().getoFlag(), new\n\t\t\t * BooleanValue(1), \"==\"));\n\t\t\t */\n\t\t\t// formulas.add(new Formula(env.getFlag().getoFlag(), new\n\t\t\t// ConstantBooleanValue(1), \"==\"));\n\t\t} else if (instName.equals(\"jp\") || instName.equals(\"jpe\")) {\n\t\t\t// if\n\t\t\t// ((PF) = 1)\n\t\t\tif (reverseCond) {\n\t\t\t\tif (env.getFlag().getPFlag() instanceof BooleanValue) {\n\t\t\t\t\tboolean z = ((BooleanValue) env.getFlag().getPFlag()).getValue();\n\t\t\t\t\t// Truong hop sai\n\t\t\t\t\t// Je khong dung, nghia la khong the thuc hien lenh nhay\n\t\t\t\t\t// duoc, do dieu kien dang bi sai\n\t\t\t\t\t// phai tiep tuc thuc hien\n\t\t\t\t\t// Can phai chinh sua them\n\t\t\t\t\tif (z) {\n\t\t\t\t\t\tisFeasible = false;\n\t\t\t\t\t\t// System.out.println(\"Debug\");\n\t\t\t\t\t} // else System.out.println(\"Right\");\n\t\t\t\t\t\t// Truong hop dung, khong lam gi ca\n\t\t\t\t} else {\n\t\t\t\t\tValue l1 = (new HybridBooleanValue(env.getFlag().getPFlag(), new BooleanValue(1), \"==\").evaluate());\n\t\t\t\t\tformulas.add((new Formula(l1, \"not\")).evaluate());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (env.getFlag().getPFlag() instanceof BooleanValue) {\n\t\t\t\t\tboolean z = ((BooleanValue) env.getFlag().getPFlag()).getValue();\n\t\t\t\t\t// Truong hop sai\n\t\t\t\t\t// Je khong dung, nghia la khong the thuc hien lenh nhay\n\t\t\t\t\t// duoc, do dieu kien dang bi sai\n\t\t\t\t\t// phai tiep tuc thuc hien\n\t\t\t\t\tif (!z) {\n\t\t\t\t\t\tisFeasible = false;\n\t\t\t\t\t\t// System.out.println(\"Debug\");\n\t\t\t\t\t}// else System.out.println(\"Right\");\n\t\t\t\t\t\t// else\n\t\t\t\t\t\t// this.curState.setFeasiblePath(false);\n\n\t\t\t\t\t// Truong hop dung, khong lam gi ca\n\t\t\t\t} else\n\t\t\t\t\tformulas.add((new Formula(env.getFlag().getPFlag(), new BooleanValue(1), \"==\")).evaluate());\n\t\t\t}\n\t\t\t/*\n\t\t\t * if (reCond) { Exp l1 = new\n\t\t\t * AdditionBooleanValue(env.getFlag().getpFlag(), new\n\t\t\t * BooleanValue(1), \"==\"); formulas.add(new Formula(l1, \"not\")); }\n\t\t\t * else formulas.add(new Formula(env.getFlag().getpFlag(), new\n\t\t\t * BooleanValue(1), \"==\"));\n\t\t\t */\n\t\t\t// formulas.add(new Formula(env.getFlag().getpFlag(), new\n\t\t\t// ConstantBooleanValue(0), \"==\"));\n\t\t} else if (inst.getName().equals(\"js\")) {\n\t\t\t// if\n\t\t\t// ((SF) = 1)\n\t\t\t// var.add(\"sFlag\", 0);\n\t\t\tif (reverseCond) {\n\t\t\t\tif (env.getFlag().getSFlag() instanceof BooleanValue) {\n\t\t\t\t\tboolean z = ((BooleanValue) env.getFlag().getSFlag()).getValue();\n\t\t\t\t\t// Truong hop sai\n\t\t\t\t\t// Je khong dung, nghia la khong the thuc hien lenh nhay\n\t\t\t\t\t// duoc, do dieu kien dang bi sai\n\t\t\t\t\t// phai tiep tuc thuc hien\n\t\t\t\t\t// Can phai chinh sua them\n\t\t\t\t\tif (z) {\n\t\t\t\t\t\tisFeasible = false;\n\t\t\t\t\t\t// System.out.println(\"Debug\");\n\t\t\t\t\t} // else System.out.println(\"Right\");\n\t\t\t\t\t\t// Truong hop dung, khong lam gi ca\n\t\t\t\t} else {\n\t\t\t\t\tValue l1 = (new HybridBooleanValue(env.getFlag().getSFlag(), new BooleanValue(1), \"==\").evaluate());\n\t\t\t\t\tformulas.add((new Formula(l1, \"not\")).evaluate());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (env.getFlag().getSFlag() instanceof BooleanValue) {\n\t\t\t\t\tboolean z = ((BooleanValue) env.getFlag().getSFlag()).getValue();\n\t\t\t\t\t// Truong hop sai\n\t\t\t\t\t// Je khong dung, nghia la khong the thuc hien lenh nhay\n\t\t\t\t\t// duoc, do dieu kien dang bi sai\n\t\t\t\t\t// phai tiep tuc thuc hien\n\t\t\t\t\tif (!z) {\n\t\t\t\t\t\tisFeasible = false;\n\t\t\t\t\t\t// System.out.println(\"Debug\");\n\t\t\t\t\t} // else System.out.println(\"Right\");\n\t\t\t\t\t\t// else\n\t\t\t\t\t\t// this.curState.setFeasiblePath(false);\n\t\t\t\t\t// Truong hop dung, khong lam gi ca\n\t\t\t\t} else\n\t\t\t\t\tformulas.add((new Formula(env.getFlag().getSFlag(), new BooleanValue(1), \"==\")).evaluate());\n\t\t\t}\n\t\t\t/*\n\t\t\t * if (reCond) { Exp l1 = new\n\t\t\t * AdditionBooleanValue(env.getFlag().getsFlag(), new\n\t\t\t * BooleanValue(1), \"==\"); formulas.add(new Formula(l1, \"not\")); }\n\t\t\t * else formulas.add(new Formula(env.getFlag().getsFlag(), new\n\t\t\t * BooleanValue(1), \"==\"));\n\t\t\t */\n\t\t\t// formulas.add(new Formula(env.getFlag().getsFlag(), new\n\t\t\t// ConstantBooleanValue(1), \"==\"));\n\t\t} else if (inst.getName().equals(\"jecxz\")) {\n\t\t\t// if\n\t\t\t// (ECX = 0)\n\t\t\t// var.add(\"sFlag\", 0);\n\t\t\tValue ecx = env.getRegister().getRegisterValue(\"ecx\");\n\t\t\tif (reverseCond) {\n\t\t\t\tif (ecx instanceof LongValue) {\n\t\t\t\t\tlong t = ((LongValue) ecx).getValue();\n\t\t\t\t\t// Truong hop sai\n\t\t\t\t\t// Je khong dung, nghia la khong the thuc hien lenh nhay\n\t\t\t\t\t// duoc, do dieu kien dang bi sai\n\t\t\t\t\t// phai tiep tuc thuc hien\n\t\t\t\t\t// Can phai chinh sua them\n\t\t\t\t\tif (t == 0) {\n\t\t\t\t\t\tisFeasible = false;\n\t\t\t\t\t\t// System.out.println(\"Debug\");\n\t\t\t\t\t} // else System.out.println(\"Right\");\n\t\t\t\t\t\t// Truong hop dung, khong lam gi ca\n\t\t\t\t} else {\n\t\t\t\t\tValue l1 = (new HybridBooleanValue(env.getRegister().getRegisterValue(\"ecx\"), new LongValue(0),\n\t\t\t\t\t\t\t\"==\").evaluate());\n\t\t\t\t\tformulas.add((new Formula(l1, \"not\")).evaluate());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (ecx instanceof LongValue) {\n\t\t\t\t\tlong z = ((LongValue) ecx).getValue();\n\t\t\t\t\t// Truong hop sai\n\t\t\t\t\t// Je khong dung, nghia la khong the thuc hien lenh nhay\n\t\t\t\t\t// duoc, do dieu kien dang bi sai\n\t\t\t\t\t// phai tiep tuc thuc hien\n\t\t\t\t\tif (z != 0) {\n\t\t\t\t\t\tisFeasible = false;\n\t\t\t\t\t\t// System.out.println(\"Debug\");\n\t\t\t\t\t} // else System.out.println(\"Right\");\n\t\t\t\t\t\t// Truong hop dung, khong lam gi ca\n\t\t\t\t} else\n\t\t\t\t\tformulas.add((new Formula(env.getRegister().getRegisterValue(\"ecx\"), new LongValue(0), \"==\"))\n\t\t\t\t\t\t\t.evaluate());\n\t\t\t}\n\t\t}\n\n\t\tif (isFeasible)\n\t\t\tisFeasible = rule.checkZ3(formulas);\n\t\t// rule.generateNextInstruction(inst, path, pathList, condition);\n\t\t// Remove later\n\t\t// curState.setFeasiblePath(true);\n\n\t\treturn isFeasible;\n\t}", "public void testNonPermanentVariableResolvedOkNoBinding() throws Exception\n {\n resolveAndAssertSolutions(\"[[g(x), h(x), (f :- g(X), h(Y))], (?- f), [[]]]\");\n }", "private void applyTheRule() throws Exception {\n System.out.println();\n System.out.println();\n System.out.println();\n System.out.println(\"IM APPLYING RULE \" + this.parameter.rule + \" ON MODEL: \" + this.resultingModel.path);\n System.out.println();\n if (parameter.rule.equals(\"1\")) {\n Rule1.apply(resultingModel);\n System.out.println();\n }\n\n if (parameter.rule.equals(\"2\")) {\n Rule2.apply(resultingModel);\n System.out.println();\n }\n\n if (parameter.rule.equals(\"3\")) {\n Rule3.all(resultingModel);\n System.out.println();\n }\n\n if (parameter.rule.equals(\"3a\")) {\n Rule3.a(resultingModel);\n\n }\n\n if (parameter.rule.equals(\"3b\")) {\n Rule3.b(resultingModel);\n }\n\n if (parameter.rule.equals(\"3c\")) {\n Rule3.c(resultingModel);\n }\n\n if (parameter.rule.equals(\"4\")) {\n Rule4.all(resultingModel);\n }\n\n if (parameter.rule.equals(\"4a\")) {\n Rule4.a(resultingModel);\n }\n\n if (parameter.rule.equals(\"4b\")) {\n Rule4.b(resultingModel);\n }\n\n if (parameter.rule.equals(\"4c\")) {\n Rule4.c(resultingModel);\n }\n\n if (parameter.rule.equals(\"r1\")) {\n Reverse1.apply(resultingModel, parameter.aggregateBy);\n }\n\n if (parameter.rule.equals(\"r2\")) {\n Reverse2.apply(resultingModel, parameter.aggregateBy);\n }\n\n if (parameter.rule.equals(\"r3\")) {\n Reverse3.apply(resultingModel, parameter.aggregateBy);\n }\n\n if (parameter.rule.equals(\"r3a\")) {\n Reverse3.a(resultingModel);\n }\n\n if (parameter.rule.equals(\"r3b\")) {\n Reverse3.b(resultingModel);\n }\n\n if (parameter.rule.equals(\"r3c\")) {\n Reverse3.c(resultingModel);\n }\n\n if (parameter.rule.equals(\"r4\")) {\n Reverse4.all(resultingModel);\n }\n\n if (parameter.rule.equals(\"r4a\")) {\n Reverse4.a(resultingModel);\n }\n\n if (parameter.rule.equals(\"r4b\")) {\n Reverse4.b(resultingModel);\n }\n\n if (parameter.rule.equals(\"r4c\")) {\n Reverse4.c(resultingModel);\n }\n\n if (parameter.rule.equals(\"5\")){\n Rule5.apply(resultingModel);\n }\n\n System.out.println(\"IM DONE APPLYING RULE \" + this.parameter.rule + \" ON MODEL: \" + this.resultingModel.path);\n\n this.resultingModel.addRule(parameter);\n //System.out.println(this.resultingModel.name);\n this.resultingModel.addOutputInPath();\n }", "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}", "private static List<Source> find(\n Statement stmt,\n Deque<Variable> path,\n Variable var,\n Set<Variable> visited\n )\n {\n if (visited.contains(var)) return Collections.emptyList();\n visited.add(var);\n\n // no statement means no fixed sources; use the variable's own sources\n // as base sources for the search\n List<Source> base;\n if (stmt == null)\n base = expand(var.sources);\n\n // in statement context, use the fixed source set in the statement\n else if (stmt.vars.containsKey(var))\n base = Collections.singletonList(stmt.vars.get(var));\n\n // otherwise, the variable has no sources\n else\n base = Collections.emptyList();\n\n // if sources are available; follow each source to try and\n // find value sources at the end of the path\n List<Source> found = new ArrayList<>();\n for (Source source : base) {\n // directly follow variable sources\n if (source instanceof Source.Variable)\n found.addAll(find(\n source.stmt,\n new ArrayDeque<>(path),\n ((Source.Variable)(source)).var,\n visited\n ));\n\n // and add value sources to the output list\n // (if at the end of the path)\n else if (path.isEmpty())\n found.add(source);\n }\n\n // if the current variable has the right field, try finding sources down\n // the field tree, following the path (and removing the saved key placed\n // there earlier)\n Variable field = path.isEmpty() ? null : var.get(path.peekFirst());\n if (field != null) {\n Deque<Variable> copy = new ArrayDeque<>(path);\n copy.removeFirst();\n\n found.addAll(find(stmt, copy, field, visited));\n }\n\n // if a parent is available, try finding sources up the field tree, saving\n // the field's key on the path (as moving down will be required later)\n Variable key = (var.parent == null) ? null : var.parent.getKey(var);\n if (key != null) {\n path.addFirst(key);\n\n found.addAll(find(stmt, path, var.parent, visited));\n }\n\n return found;\n }", "protected IExpressionValue possibleVal()throws TableFunctionMalformedException,\r\n\t\t\t\t\t\t\t\t\t\t\t\t SomeStateUndeclaredException {\r\n\r\n\t\tthis.getName();\r\n\t\t\r\n\t\t// Use a list to store already known states or identifiers to evaluate already known values... \r\n//\t\tIExpressionValue ret = new SimpleProbabilityValue(Float.NaN);\r\n\t\tif (this.currentHeader != null) {\r\n\t\t\t// check if this is not a user-defined variable first;\r\n\t\t\tIExpressionValue userDefinedVariableValue = this.currentHeader.getUserDefinedVariable(noCaseChangeValue);\r\n\t\t\tif (userDefinedVariableValue != null) {\r\n\t\t\t\treturn userDefinedVariableValue;\r\n\t\t\t}\r\n\t\t\t// check if this is not another state of current node\r\n\t\t\tfor (TempTableProbabilityCell cell : this.currentHeader.getCellList()) {\r\n\t\t\t\t if (cell.getPossibleValue().getName().equalsIgnoreCase(value) ) {\r\n\t\t\t\t\t // Debug.println(\"\\n => Variable value found: \" + cell.getPossibleValue().getName());\r\n\t\t\t\t\t return cell.getProbability();\r\n\t\t\t\t\t \r\n\t\t\t\t }\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// if null, it means it was called before an assignment\r\n\t\t\tthrow new SomeStateUndeclaredException(getNode().toString());\r\n\t\t}\r\n\t\t\r\n\r\n\r\n\t\t// Debug.println(\"An undeclared possible value or a \\\"varsetname\\\" was used : \" + value);\r\n//\t\treturn ret;\r\n\t\treturn null;\r\n\t}", "private static boolean appropriateForIfAssignmentCollapse1(Op03SimpleStatement statement) {\n boolean extraCondSeen = false;\n boolean preCondAssignmentSeen = false;\n while (statement.getSources().size() == 1) {\n Op03SimpleStatement source = statement.getSources().get(0);\n if (source == statement) break;\n // If there's a single parent, and it's a backjump, then I'm confused, as that means\n // we have a loop with no entry point...\n if (statement.getIndex().isBackJumpFrom(source)) break;\n Statement contained = source.getStatement();\n if (contained instanceof AbstractAssignment) {\n preCondAssignmentSeen |= (!extraCondSeen);\n } else if (contained instanceof IfStatement) {\n extraCondSeen = true;\n } else {\n break;\n }\n statement = source;\n }\n if (!preCondAssignmentSeen) return false;\n // It turns out we generate better code with this, as we want (where possible) to /avoid/ pushing these\n // assignments.\n if (extraCondSeen) return false;\n /* If this statement has any backjumping sources then we consider it */\n InstrIndex statementIndex = statement.getIndex();\n for (Op03SimpleStatement source : statement.getSources()) {\n if (statementIndex.isBackJumpFrom(source)) return true;\n }\n return false;\n }", "private <E> Assignment<E> backtrackFCMRVLRVDH(CSP<E> csp, Assignment<E> assignment) {\r\n\t\t++iterationCount;\r\n\t\tif(assignment.isComplete(csp) || iterationCount>10000){\r\n\t\t\treturn assignment;\r\n\t\t}\r\n\t\tString var=MinRemainingValue(csp, assignment);\r\n\t\tList<E> variables= LeastConstrainingValue(csp,var);\r\n\t\tfor(int i=0; i<variables.size();i++) {\r\n\t\t\tassignment.put(var,variables.get(i));\r\n\t\t\tif(csp.isConsistent(assignment)){\r\n\t\t\t\tInference<E> inference=ForwardCheckingCSPSolver.inference(csp, assignment, var, variables.get(i));\r\n\t\t\t\tif(inference!=null){\r\n\t\t\t\t\tinference.reduceDomain(csp);\r\n\t\t\t\t\tAssignment<E> result = backtrackFCMRVLRVDH(csp, assignment);\r\n\t\t\t\t\tinference.restoreDomain(csp);\r\n\t\t\t\t\tif(result!=null){\r\n\t\t\t\t\t\treturn result;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tassignment.remove(var);\r\n\t\t}\r\n\t\treturn null;\r\n\t\t\r\n\t}", "public Object visitDefinedExpression(GNode n) {\n String parameter = n.getGeneric(0).getString(0);\n \n //evaluate the defined operation, preserving configurations\n if (macroTable != null) {\n List<Entry> definitions = macroTable.get(parameter, presenceConditionManager);\n \n if (definitions != null && definitions.size() > 0) {\n boolean hasDefined, hasUndefined, hasFree;\n \n //three conditions\n //1) defined under all configurations, so output 1 (true)\n //2) undefined under all configurations, so output 0 (false)\n //3) partially defined, so output union of configurations\n \n hasDefined = false;\n hasUndefined = false;\n hasFree = false;\n for (Entry def : definitions) {\n if (def.macro.state == Macro.State.FREE) {\n hasFree = true;\n }\n else if (def.macro.state == Macro.State.DEFINED) {\n hasDefined = true;\n }\n else if (def.macro.state == Macro.State.UNDEFINED) {\n hasUndefined = true;\n }\n }\n \n if (hasDefined && ! hasUndefined && ! hasFree) {\n //fully defined in this presenceCondition\n return B.one(); //the constant true BDD\n \n } else if (hasUndefined && ! hasDefined && ! hasFree) {\n //not defined in this presenceCondition\n return B.zero(); //the constant false BDD\n \n } else {\n //partially defined in this presenceCondition\n BDD defined = B.zero();\n List<Token> tokenlist;\n int c;\n \n for (Entry def : definitions) {\n if (def.macro.state == Macro.State.FREE) {\n BDD newDefined;\n BDD varBDD;\n BDD term;\n \n varBDD = presenceConditionManager.getVariableManager()\n .getDefinedVariable(parameter);\n \n term = def.presenceCondition.getBDD().and(varBDD);\n newDefined = defined.or(term);\n term.free();\n defined.free();\n varBDD.free();\n defined = newDefined;\n \n } else if (def.macro.state == Macro.State.DEFINED) {\n BDD newDefined;\n \n newDefined = defined.or(def.presenceCondition.getBDD());\n defined.free();\n defined = newDefined;\n } else if (def.macro.state == Macro.State.UNDEFINED) {\n //do nothing\n }\n }\n \n return defined;\n } //end partially defined\n \n } else {\n // The macro was used in a conditional expression before or\n // without being defined, therefore it is a configuration\n // variable.\n if (runtime.test(\"configurationVariables\")) {\n macroTable.configurationVariables.add(parameter);\n }\n }\n } //end has macro table\n \n /*if (runtime.test(\"cppmode\")) {\n //return false in cpp mode\n return \"0\";\n }\n else*/ {\n //if there are no macro table entries, just return the operation as is\n return \"defined \" + parameter; //return a string\n }\n }", "protected Sequence actuallyEvaluate(XPathContext context, Component<GlobalVariable> target) throws XPathException {\n final Controller controller = context.getController();\n assert controller != null;\n final Bindery b = controller.getBindery(getPackageData());\n //System.err.println(\"EVAL GV \" + this + \" \" + getVariableQName().getDisplayName() + \" in slot \" + getBinderySlotNumber());\n\n try {\n // This is the first reference to a global variable; try to evaluate it now.\n // But first check for circular dependencies.\n setDependencies(this, context);\n\n // Set a flag to indicate that the variable is being evaluated. This is designed to prevent\n // (where possible) the same global variable being evaluated several times in different threads\n boolean go = b.setExecuting(this);\n if (!go) {\n // some other thread has evaluated the variable while we were waiting\n return b.getGlobalVariable(getBinderySlotNumber());\n }\n\n Sequence value = getSelectValue(context, target);\n if (indexed) {\n value = controller.getConfiguration().obtainOptimizer().makeIndexedValue(value.iterate());\n }\n return b.saveGlobalVariableValue(this, value);\n\n } catch (XPathException err) {\n b.setNotExecuting(this);\n if (err instanceof XPathException.Circularity) {\n String errorCode;\n if (getPackageData().getHostLanguage() == Configuration.XSLT) {\n errorCode = \"XTDE0640\";\n } else if (getPackageData().getXPathVersion() >= 30) {\n errorCode = \"XQDY0054\";\n } else {\n errorCode = \"XQST0054\";\n }\n err.setErrorCode(errorCode);\n err.setXPathContext(context);\n // Detect it more quickly the next time (in a pattern, the error is recoverable)\n SingletonClosure closure = new SingletonClosure(new ErrorExpression(err), context);\n b.setGlobalVariable(this, closure);\n err.setLocation(getLocation());\n throw err;\n } else {\n throw err;\n }\n }\n }", "public interface Rule {\r\n\r\n\tString getTargetedPropertyName();\r\n\tboolean hasFinished();\r\n\tObject nextValue();\r\n\tObject[] getValues();\r\n\tpublic void setValues(Object[] values);\r\n\t\r\n}", "@Override\n\tpublic Void visit(ClauseVarType clause, Void ctx) {\n\t\treturn null;\n\t}", "private MMGoal generateGoalFromProperty(ServiceProperty effectPlus) {\n\t\tMMGoal goal = new MMGoal();\n\t\tdouble goalValue = 0;\n\t\t\n\t\tif (!effectPlus.getTreatment_effect().equals(\"\")) {\n\t\t\tString name = effectPlus.getTreatment_effect().split(\"__\")[0];\n\t\t\tfor (Gauge gauge : this.agent.getGauges()) {\n\t\t\t\tif (gauge.getName().equals(name)) {\n\t\t\t\t\tgoalValue = MMReasoningModule.GAUGE_REFILL * gauge.getMaxValue();\n\t\t\t\t\t\n\t\t\t\t\tgoal = new MMGoal();\n\t\t\t\t\t\n\t\t\t\t\tgoal.getSuccessCondition().setPropertyName(\"biggerThan\");\n\t\t\t\t\tgoal.getSuccessCondition().setPropertyParameters(new ArrayList<Param>());\n\t\t\t\t\tgoal.getSuccessCondition().getPropertyParameters()\n\t\t\t\t\t\t\t.add(new Param(gauge.getName(), \"\", \"double\", \"\", \"false\"));\n\t\t\t\t\tgoal.getSuccessCondition().getPropertyParameters()\n\t\t\t\t\t\t\t.add(new Param(\"amount\", String.valueOf(goalValue), \"double\", \"\", \"false\"));\n\t\t\t\t\tgoal.getSuccessCondition().setTreatment_precond(gauge.getName() + \"__>__amount\");\n\t\t\t\t\t\n\t\t\t\t\tgoal.setPriority(effectPlus.getAttractivity());\n\t\t\t\t\t\n\t\t\t\t\treturn goal;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tArrayList<PropertyLink> linkList = Model.getInstance().getAI().getWorld().getLinkList();\n\t\t\n\t\tServiceProperty premise = null;\n\t\t\n\t\tif ((premise = effectPlus.getPremise(linkList)) != null) {\n\t\t\tfor (Param parameter : premise.getPropertyParameters()) {\n\t\t\t\tif (parameter.getFixed().equals(\"false\") && !parameter.getFindValue().equals(\"\")) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tparameter.setParamValue(String.valueOf(this.agent.getMemory().getKnowledgeAboutOwner()\n\t\t\t\t\t\t\t\t.getPropertiesContainer().getProperty(parameter.getFindValue()).getValue()));\n\t\t\t\t\t} catch (Exception e) {\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\tgoal.setSuccessCondition(premise);\n\t\t\tgoal.setPriority(effectPlus.getAttractivity());\n\t\t\t\n\t\t\treturn goal;\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "static void translate() {\n if(!token.equals(\"IF\")) {\r\n stack.add(lexeme);\r\n index++;\r\n\r\n // Add assignment operator to the intermediate stack\r\n lex();\r\n stack.add(lexeme);\r\n index++;\r\n\r\n lex();\r\n while (!token.equals(\"END\")) {\r\n\r\n if (lexeme.equals(\"(\")) {\r\n tParen();\r\n } else if (token.equals(\"PLUS\") || token.equals(\"MINUS\") || token.equals(\"STAR\") || token.equals(\"DIVOP\") || token.equals(\"MOD\")) {\r\n stack.add(index, lexeme);\r\n index++;\r\n\r\n lex();\r\n if (lexeme.equals(\"(\")) {\r\n tParen();\r\n } else {\r\n index--;\r\n stack.add(index, lexeme);\r\n index++;\r\n index++;\r\n }\r\n } else {\r\n index--;\r\n stack.add(index, lexeme);\r\n index++;\r\n }\r\n\r\n lex();\r\n\r\n if (token.equals(\"END\"))\r\n break;\r\n\r\n if (token.equals(\"IDENTIFIER\")) {\r\n index++;\r\n break;\r\n }\r\n\r\n if (token.equals(\"IF\")) {\r\n index++;\r\n break;\r\n }\r\n }\r\n\r\n // Beginning the execution and evaluation of the translated code.\r\n index = 0;\r\n\r\n while (!stack.get(index).equals(\"=\") && !stack.get(index).equals(\"+\") && !stack.get(index).equals(\"-\") &&\r\n !stack.get(index).equals(\"*\") && !stack.get(index).equals(\"/\") && !stack.get(index).equals(\"%\")) {\r\n index ++;\r\n }\r\n\r\n int value = 0;\r\n int operand1 = 0;\r\n int operand2 = 0;\r\n String operator = stack.get(index);\r\n stack.remove(index);\r\n index--;\r\n\r\n if (operator.equals(\"=\")) {\r\n\r\n try {\r\n value = Integer.parseInt(stack.get(index));\r\n }\r\n catch (NumberFormatException e) {\r\n value = Integer.parseInt(varList.get(search(stack.get(index)) + 1));\r\n }\r\n\r\n stack.remove(index);\r\n index--;\r\n\r\n String id = stack.get(index);\r\n stack.remove(index);\r\n\r\n //System.out.println(\"\\n\" + id + \" is equal to \" + value);\r\n\r\n if (search(id) == -1) {\r\n varList.add(id);\r\n varList.add(Integer.toString(value));\r\n } else {\r\n varList.set(search(id) + 1, Integer.toString(value));\r\n }\r\n }\r\n\r\n else {\r\n try {\r\n operand2 = Integer.parseInt(stack.get(index));\r\n }\r\n catch (NumberFormatException e) {\r\n operand2 = Integer.parseInt(varList.get(search(stack.get(index)) + 1));\r\n }\r\n stack.remove(index);\r\n index--;\r\n\r\n try {\r\n operand1 = Integer.parseInt(stack.get(index));\r\n }\r\n catch (NumberFormatException e) {\r\n operand1 = Integer.parseInt(varList.get(search(stack.get(index)) + 1));\r\n }\r\n stack.remove(index);\r\n\r\n execute(evaluate(operand1, operand2, operator));\r\n }\r\n\r\n if (!token.equals(\"END\")) {\r\n translate();\r\n }\r\n }\r\n\r\n // IF STATEMENTS\r\n else {\r\n if(translateIF())\r\n translate();\r\n else\r\n skipStatement();\r\n }\r\n }", "public Element getPredicateVariable();", "@Override\n public Void visit(AssignmentExpression nd, SuccessorInfo i) {\n if (\"&&=\".equals(nd.getOperator()) || \"||=\".equals(nd.getOperator()) || \"??=\".equals(nd.getOperator())) {\n if (\"&&=\".equals(nd.getOperator())) {\n // from lhs to rhs on truthy. from lhs to false-branch on falsy.\n visitWithSuccessors(nd.getLeft(), First.of(nd.getRight()), i.getSuccessors(false));\n } else if (\"||=\".equals(nd.getOperator())) {\n // from lhs to true-branch on truthy. from lhs to rhs on falsy.\n visitWithSuccessors(nd.getLeft(), i.getSuccessors(true), First.of(nd.getRight()));\n } else { // \"??=\"\n // the union of the above - truthyness is unknown.\n visitWithSuccessors(nd.getLeft(), union(First.of(nd.getRight()), i.getAllSuccessors()));\n }\n \n visitWithSuccessors(nd.getRight(), nd); // from right to assignment.\n\n writeSuccessors(nd, i.getGuardedSuccessors(nd));\n } else {\n visitAssign(nd, nd.getLeft(), nd.getRight());\n writeSuccessors(nd, i.getGuardedSuccessors(nd));\n }\n return null;\n }", "@Override\n\tprotected void resetFalseClause() {\n\t\t\n\t}", "public void typeCheck(/*@NotNull*/ ExpressionVisitor visitor) throws XPathException {\n Expression value = getSelectExpression();\n if (value != null) {\n value.checkForUpdatingSubexpressions();\n if (value.isUpdatingExpression()) {\n throw new XPathException(\n \"Initializing expression for global variable must not be an updating expression\", \"XUST0001\");\n }\n RoleDiagnostic role = new RoleDiagnostic(\n RoleDiagnostic.VARIABLE, getVariableQName().getDisplayName(), 0);\n ContextItemStaticInfo cit = new ContextItemStaticInfo(AnyItemType.getInstance(), true);\n Expression value2 = TypeChecker.strictTypeCheck(\n value.simplify().typeCheck(visitor, cit),\n getRequiredType(), role, visitor.getStaticContext());\n value2 = value2.optimize(visitor, cit);\n setSelectExpression(value2);\n // the value expression may declare local variables\n SlotManager map = getConfiguration().makeSlotManager();\n int slots = ExpressionTool.allocateSlots(value2, 0, map);\n if (slots > 0) {\n setContainsLocals(map);\n }\n\n if (getRequiredType() == SequenceType.ANY_SEQUENCE && !(this instanceof GlobalParam)) {\n // no type was declared; try to deduce a type from the value\n try {\n final ItemType itemType = value.getItemType();\n final int cardinality = value.getCardinality();\n setRequiredType(SequenceType.makeSequenceType(itemType, cardinality));\n GroundedValue constantValue = null;\n if (value2 instanceof Literal) {\n constantValue = ((Literal) value2).getValue();\n }\n for (BindingReference reference : references) {\n if (reference instanceof VariableReference) {\n ((VariableReference) reference).refineVariableType(\n itemType, cardinality, constantValue, value.getSpecialProperties());\n }\n }\n } catch (Exception err) {\n // exceptions can happen because references to variables and functions are still unbound\n }\n }\n\n\n }\n }", "public boolean checkGoal() {\r\n\t\tif (goal) {\r\n\t\t\tgoal = false;\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public final EObject ruleGoalBooleanUnit() throws RecognitionException {\r\n EObject current = null;\r\n\r\n EObject this_GoalNegation_0 = null;\r\n\r\n EObject this_GoalBooleanLiteral_1 = null;\r\n\r\n EObject this_GoalReference_2 = null;\r\n\r\n EObject this_ParenthesizedGoalExpression_3 = null;\r\n\r\n\r\n enterRule(); \r\n \r\n try {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:1712:28: ( (this_GoalNegation_0= ruleGoalNegation | this_GoalBooleanLiteral_1= ruleGoalBooleanLiteral | this_GoalReference_2= ruleGoalReference | this_ParenthesizedGoalExpression_3= ruleParenthesizedGoalExpression ) )\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:1713:1: (this_GoalNegation_0= ruleGoalNegation | this_GoalBooleanLiteral_1= ruleGoalBooleanLiteral | this_GoalReference_2= ruleGoalReference | this_ParenthesizedGoalExpression_3= ruleParenthesizedGoalExpression )\r\n {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:1713:1: (this_GoalNegation_0= ruleGoalNegation | this_GoalBooleanLiteral_1= ruleGoalBooleanLiteral | this_GoalReference_2= ruleGoalReference | this_ParenthesizedGoalExpression_3= ruleParenthesizedGoalExpression )\r\n int alt25=4;\r\n switch ( input.LA(1) ) {\r\n case 58:\r\n case 59:\r\n {\r\n alt25=1;\r\n }\r\n break;\r\n case RULE_EBOOLEAN:\r\n {\r\n alt25=2;\r\n }\r\n break;\r\n case 42:\r\n {\r\n alt25=3;\r\n }\r\n break;\r\n case 43:\r\n {\r\n alt25=4;\r\n }\r\n break;\r\n default:\r\n if (state.backtracking>0) {state.failed=true; return current;}\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 25, 0, input);\r\n\r\n throw nvae;\r\n }\r\n\r\n switch (alt25) {\r\n case 1 :\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:1714:5: this_GoalNegation_0= ruleGoalNegation\r\n {\r\n if ( state.backtracking==0 ) {\r\n \r\n newCompositeNode(grammarAccess.getGoalBooleanUnitAccess().getGoalNegationParserRuleCall_0()); \r\n \r\n }\r\n pushFollow(FOLLOW_ruleGoalNegation_in_ruleGoalBooleanUnit3542);\r\n this_GoalNegation_0=ruleGoalNegation();\r\n\r\n state._fsp--;\r\n if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n \r\n current = this_GoalNegation_0; \r\n afterParserOrEnumRuleCall();\r\n \r\n }\r\n\r\n }\r\n break;\r\n case 2 :\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:1724:5: this_GoalBooleanLiteral_1= ruleGoalBooleanLiteral\r\n {\r\n if ( state.backtracking==0 ) {\r\n \r\n newCompositeNode(grammarAccess.getGoalBooleanUnitAccess().getGoalBooleanLiteralParserRuleCall_1()); \r\n \r\n }\r\n pushFollow(FOLLOW_ruleGoalBooleanLiteral_in_ruleGoalBooleanUnit3569);\r\n this_GoalBooleanLiteral_1=ruleGoalBooleanLiteral();\r\n\r\n state._fsp--;\r\n if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n \r\n current = this_GoalBooleanLiteral_1; \r\n afterParserOrEnumRuleCall();\r\n \r\n }\r\n\r\n }\r\n break;\r\n case 3 :\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:1734:5: this_GoalReference_2= ruleGoalReference\r\n {\r\n if ( state.backtracking==0 ) {\r\n \r\n newCompositeNode(grammarAccess.getGoalBooleanUnitAccess().getGoalReferenceParserRuleCall_2()); \r\n \r\n }\r\n pushFollow(FOLLOW_ruleGoalReference_in_ruleGoalBooleanUnit3596);\r\n this_GoalReference_2=ruleGoalReference();\r\n\r\n state._fsp--;\r\n if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n \r\n current = this_GoalReference_2; \r\n afterParserOrEnumRuleCall();\r\n \r\n }\r\n\r\n }\r\n break;\r\n case 4 :\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:1744:5: this_ParenthesizedGoalExpression_3= ruleParenthesizedGoalExpression\r\n {\r\n if ( state.backtracking==0 ) {\r\n \r\n newCompositeNode(grammarAccess.getGoalBooleanUnitAccess().getParenthesizedGoalExpressionParserRuleCall_3()); \r\n \r\n }\r\n pushFollow(FOLLOW_ruleParenthesizedGoalExpression_in_ruleGoalBooleanUnit3623);\r\n this_ParenthesizedGoalExpression_3=ruleParenthesizedGoalExpression();\r\n\r\n state._fsp--;\r\n if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n \r\n current = this_ParenthesizedGoalExpression_3; \r\n afterParserOrEnumRuleCall();\r\n \r\n }\r\n\r\n }\r\n break;\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n leaveRule(); \r\n }\r\n }\r\n \r\n catch (RecognitionException re) { \r\n recover(input,re); \r\n appendSkippedTokens();\r\n } \r\n finally {\r\n }\r\n return current;\r\n }", "private static <V extends Variable<A>, A extends Value> Map<V, DomainReduction<A>> FORWARD_CHECK2(SharedDomainVariableSet<V, A> variableSet, V var) throws Exception {\n\t\tMap<V, DomainReduction<A>> domainReduction = new HashMap<>(256);\n\t\t\n\t\t// map of constraints to unset variables\n\t\tMap<Constraint<V>, Queue<V>> unsetConstraints = new HashMap<>();\n\t\tfor (Constraint<V> constraint : variableSet.getConstraintsByVariable(var)) {\n\t\t\t\n\t\t\t// get free variables in the constraint\n\t\t\tQueue<V> freeVariables = new LinkedList<>();\n\t\t\tfor (V v : constraint.getVariables()) {\n\t\t\t\tif (!v.isSet()) {\n\t\t\t\t\tfreeVariables.add(v);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// add only if number of free variables is not empty\n\t\t\tif (!freeVariables.isEmpty()) {\n\t\t\t\tunsetConstraints.put(constraint, freeVariables);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\twhile (true) {\n\t\t\t\n\t\t\t// made at least one reduction for all constraints\n\t\t\tboolean madeReductionAll = false;\n\t\t\t\n\t\t\t// for each constraint on the variable\n\t\t\tfor (Constraint<V> constraint : unsetConstraints.keySet()) {\n\t\t\t\t\n\t\t\t\tQueue<V> freeVariables = unsetConstraints.get(constraint);\n\t\t\t\t\n\t\t\t\twhile (true) {\n\t\t\t\t\tMap<V, DomainReduction<A>> reductions = new HashMap<>(256);\n\t\t\t\t\t\n\t\t\t\t\tfor (int i = 0; i < freeVariables.size(); i ++) {\n\t\t\t\t\t\tV freeVariable = freeVariables.remove();\n\t\t\t\t\t\t\n\t\t\t\t\t\treductions.put(freeVariable, new DomainReduction<>(256)); // TODO\n\t\t\t\t\t\t\n\t\t\t\t\t\tList<A> domain = variableSet.getDomain(freeVariable);\n\t\t\t\t\t\tif (domain.isEmpty()) {\n\t\t\t\t\t\t\tvariableSet.clearDomainReduction(domainReduction);\n\t\t\t\t\t\t\tthrow new Exception();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (A val : domain) {\n\t\t\t\t\t\t\tfreeVariable.assign(val);\n\t\t\t\t\t\t\tif (!FIND_COMBINATION(variableSet, freeVariables, constraint)) {\n\t\t\t\t\t\t\t\treductions.get(freeVariable).add(val);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfreeVariable.unassign();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfreeVariables.add(freeVariable);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tboolean noReduction = true;\n\t\t\t\t\t\n\t\t\t\t\tfor (V freeVariable : freeVariables) {\n\t\t\t\t\t\tDomainReduction<A> reduc = reductions.get(freeVariable);\n\t\t\t\t\t\tif (!reduc.isEmpty()) {\n\t\t\t\t\t\t\tvariableSet.addDomainReduction(freeVariable, reduc);\n\t\t\t\t\t\t\tif (!domainReduction.containsKey(freeVariable)) {\n\t\t\t\t\t\t\t\tdomainReduction.put(freeVariable, reduc);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdomainReduction.get(freeVariable).addAll(reduc);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tnoReduction = false;\n\t\t\t\t\t\t\tmadeReductionAll = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (noReduction) {\n\t\t\t\t\t\tbreak;\n\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}\n\t\t\t\n\t\t\tif (!madeReductionAll) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn domainReduction;\n\t\t\n\t}", "public T caseVariableCondition(VariableCondition object)\n {\n return null;\n }", "@Override\n public final SoyValue resolve() {\n SoyValue localResolvedValue = resolvedValue;\n if (localResolvedValue == null) {\n localResolvedValue = compute();\n for (ValueAssertion curr = valueAssertion; curr != null; curr = curr.next) {\n curr.check(localResolvedValue);\n }\n resolvedValue = localResolvedValue;\n valueAssertion = null;\n }\n return localResolvedValue;\n }", "public void processMatchVars(HashMap<String, List<String>> mapCandVarToMatchedVals,\n HashMap<String, List<String>> mapCandVarToAllAnsMaps,\n boolean flagSkipCTP, int indxCTP, int srcGraph, List<String> allCTPvals) {\n\n if (indxCTP == 18) {\n\n int araz = 0;\n }\n\n List<String> removeKeys = null;\n List<String> tmpPattern = null;\n List<String> newCandVals = new LinkedList<>();\n List<String> cleanCANDTP = myDedUtils.getCleanTP(DTPCandidates.get(indxCTP));\n\n //Confirm or reject variables based on matching threshold OR/AND best matching choice\n removeKeys = confirmMatchVars(mapCandVarToMatchedVals, mapCandVarToAllAnsMaps, indxCTP);\n\n for (int k = 0; k < removeKeys.size(); k++) {\n\n mapCandVarToMatchedVals.remove(removeKeys.get(k));\n }\n\n //Identify EG as NLEG and combine alternative variables and match variables to corresponding hash maps\n refineDTPmatchVars(mapCandVarToMatchedVals, mapCandVarToAllAnsMaps, indxCTP, srcGraph);\n\n //Match a CTP directly to a DTP, when no vars matched during inverse mapping\n if (mapCandVarToMatchedVals.isEmpty()) {\n\n //If values to match correspond to CTP part of a BoundJoin, that we\n //could not match because of a small Tjoin\n if (allCTPvals == null || (allCTPvals != null && allCTPvals.size() > 3)) {\n\n tmpPattern = myDedUtils.getCleanTP(allCTPs.get(indxCTP));\n if (mapCTPtoQuerySrc.get(tmpPattern) != null) {\n\n if (mapDTPToDeducedID.get(tmpPattern) == null) {\n\n mapDTPToDeducedID.put(tmpPattern, mapDTPToDeducedID.size() + 1);\n }\n\n // System.out.println(mapDTPToDeducedID.get(newDedTP));\n myBasUtils.insertToMap2(mapDTPtoInnerQuery, mapCTPtoQuerySrc.get(tmpPattern), mapDTPToDeducedID.get(tmpPattern));\n }\n\n //If CTP's subject and object are variables, we have already match\n //this as a DTP\n if (!flagSkipCTP) {\n\n myDedUtils.setDTPHashInfo(tmpPattern, indxCTP);\n allCTPvals = myDedUtils.getValuesFromCTP(indxCTP);\n flagSTOPNONPROJECTEDvars = myDedUtils.setDTPtoSrcAns(indxCTP, allCTPvals, tmpPattern, flagSTOPNONPROJECTEDvars);\n }\n\n } //If values to match correspond to singleTPs that surely are not part\n //of a BoundJoin, then match them directly as DTPs\n else if (allCTPvals.size() <= 3) {\n\n for (int i = 0; i < allCTPvals.size(); i++) {\n\n tmpPattern = myDedUtils.getNewRawTP(allCTPs.get(indxCTP), allCTPvals.get(i));\n\n if (mapCTPtoQuerySrc.get(tmpPattern) != null) {\n\n if (mapDTPToDeducedID.get(tmpPattern) == null) {\n\n mapDTPToDeducedID.put(tmpPattern, mapDTPToDeducedID.size() + 1);\n }\n\n // System.out.println(mapDTPToDeducedID.get(newDedTP));\n myBasUtils.insertToMap2(mapDTPtoInnerQuery, mapCTPtoQuerySrc.get(tmpPattern), mapDTPToDeducedID.get(tmpPattern));\n }\n\n if (!flagSkipCTP) {\n\n myDedUtils.setDTPHashInfo(tmpPattern, indxCTP);\n allCTPvals = myDedUtils.getValuesFromCTP(indxCTP);\n newCandVals = new LinkedList<>();\n newCandVals.add(allCTPvals.get(i));\n flagSTOPNONPROJECTEDvars = myDedUtils.setDTPtoSrcAns(indxCTP, allCTPvals, tmpPattern, flagSTOPNONPROJECTEDvars);\n }\n }\n }\n\n }\n\n //In any case, we must capture source endpoints of each source TP of a CTP\n //and if there is no matching variable, save each source TPs as a DTP\n for (int i = 0; i < allCTPvals.size(); i++) {\n\n tmpPattern = myDedUtils.getNewRawTP(allCTPs.get(indxCTP), allCTPvals.get(i));\n myBasUtils.insertToMap3(mapDTPToEndpsSrc, mapCTPToEndpsSrc.get(cleanCANDTP), tmpPattern);\n }\n\n }", "public T caseBooleanVariable(BooleanVariable object)\n {\n return null;\n }", "public MoveEvaluation alreadyDetermined(IGameState state) {\n\t\tNode<Pair> node = list.head();\n\t\t\n\t\twhile (node != null) {\n\t\t\tPair p = node.value();\n\t\t\tif (state.equivalent(p.state)) {\n\t\t\t\treturn p.move;\n\t\t\t}\n\t\t\t\n\t\t\tnode = node.next();\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "private Object eval(Fact expr) {\n if (expr.getBool() != null) {\n if (\"true\".equals(expr.getBool())) {\n return true;\n } else {\n return false;\n }\n } else if (expr.getString() != null) {\n return expr.getString();\n } else if (expr.getIdent() != null) {\n if (RESULT_TYPE_VARIABLE.equals(resultType)) {\n return expr.getIdent();\n }\n return scope.getVariable(expr.getIdent());\n } else if (expr.getExpr() != null) {\n return eval(expr.getExpr(), resultType);\n } else if (expr.getLocator() != null) {\n return evalLocator(expr.getLocator());\n } else {\n return expr.getNumber();\n }\n }", "static void unifyVariable(Solution solution, Type.Variable v, Type against) {\n\t\tif (v == against) solution.trivial();\n\t\telse if (Variable(against, a -> solution.alias(v, a))) ;\n\t\telse if (occurs(v, against)) solution.recursive(v, against);\n\t\telse solution.substitute(v, against);\n\t}", "abstract void checkWhetherVariable(SyntaxUnit use);", "private Object eval(NotFact expr) {\n if (expr.getOpt() != null) {\n Object res = eval(expr.getExpr());\n if (res instanceof Boolean) {\n return !(Boolean) res;\n } else {\n throw new RaydenScriptException(\"Expression error: NotFact result is no boolean\");\n }\n } else {\n return eval(expr.getExpr());\n }\n }", "@Override\n public CodeFragment visitAssignmentStat(AlangParser.AssignmentStatContext ctx) {\n String name = ctx.ID().getText();\n if (!variableExists(name)) {\n this.addError(ctx, name, \"Assignment to undeclared variable\");\n return new CodeFragment(\"\");\n }\n\n Variable v = this.globals.get(name);\n v.setValue(ctx.global_expression().getText());\n v.setHasValue();\n\n return new CodeFragment(\"\");\n }", "public boolean isSolvable() {\n\t\tif (goal == null)\n\t\t\treturn false;\n\t\telse\n\t\t\treturn true;\n\t}", "public T caseBooleanVariable(BooleanVariable object) {\n\t\treturn null;\n\t}", "private <E> Assignment<E> backtrackingMRVLCVDH(CSP<E> csp, Assignment<E> assignment, HashMap<String,Set<E>> explored) {\r\n\t\t++iterationCount;\r\n\t\tif(assignment.isComplete(csp) || iterationCount>10000){\r\n\t\t\treturn assignment;\r\n\t\t}\r\n\t\tString var=MinRemainingValue(csp, assignment);\r\n\t\tList<E> values= LeastConstrainingValue(csp,var);\r\n\t\tSet<E> valuesSet = new HashSet<>();\r\n\t\tfor(int i=0;i<values.size();i++){\r\n\t\t\tboolean consistent=true;\r\n\t\t\tif(!Visited(explored,var,values.get(i))){\r\n\t\t\t\tvaluesSet.add(values.get(i));\r\n\t\t\t\tassignment.put(var,values.get(i));\r\n\t\t\t\texplored.put(var,valuesSet);\r\n\t\t\t\tif(csp.isConsistent(assignment)){\r\n\t\t\t\t\tAssignment<E> result = backtracking(csp, assignment, explored);\r\n\t\t\t\t\tif(result!=null) {\r\n\t\t\t\t\t\treturn result;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tassignment.remove(var);\r\n\t\t\t}\r\n\t\t}\r\n\t\texplored.get(var).clear();\r\n\t\treturn null;\r\n\t}", "public void testVariableBindingFromFirstPathPropagatesAccrossConjunction() throws Exception\n {\n resolveAndAssertSolutions(\"[[g(x), h(x), (f(X) :- g(X), h(X))], (?- f(Y)), [[Y <-- x]]]\");\n }", "public void pruneRules_greedy() {\n LOGGER.info(\"STARTED Postpruning\");\n AttributeValue defClass = getDefaultRuleClass();\n int defError = getDefaultRuleError(defClass);\n boolean removeTail=false;\n for (Iterator<ExtendRule> it = extendedRules.iterator(); it.hasNext();) {\n\n ExtendRule rule = it.next();\n rule.updateQuality();\n if (LOGGER.isLoggable(Level.FINE)) {\n LOGGER.log(Level.FINE, \"#Rule {0}\", rule.toString());\n }\n \n if (removeTail)\n {\n it.remove();\n }\n else if (rule.getAntecedentLength() == 0) {\n it.remove();\n } \n else if (rule.getRuleQuality().getA() == 0)\n {\n it.remove();\n }\n else\n {\n int supportingTransactions = rule.removeTransactionsCoveredByAntecedent(true);\n AttributeValue newDefClass = getDefaultRuleClass();\n int newDefError = getDefaultRuleError(newDefClass);\n if (defError<=newDefError)\n {\n //adding the current rule did not decrease the errors compared to a default rule\n it.remove();\n removeTail=true;\n }\n else{\n LOGGER.log(Level.FINE, \"{0} transactions, RULE {1} KEPT\", new Object[]{supportingTransactions, rule.getRID()});\n defClass = newDefClass;\n defError = newDefError;\n } \n }\n \n \n\n\n }\n LOGGER.fine(\"Creating new Extend rule within narrow rule procedure\");\n extendedRules.add(createNewDefaultRule(defClass));\n LOGGER.info(\"FINISHED Postpruning\");\n }", "private int getGoalValue(Proposition goalProposition) {\r\n \tGdlRelation relation = (GdlRelation) goalProposition.getName();\r\n GdlConstant constant = (GdlConstant) relation.get(1);\r\n return Integer.parseInt(constant.toString());\r\n }", "Variable getTargetVariable();", "private <E> Assignment<E> backtrackAC3MRVLRVDH(CSP<E> csp, Assignment<E> assignment) {\r\n\t\t++iterationCount;\r\n\t\tif(assignment.isComplete(csp) || iterationCount>10000){\r\n\t\t\treturn assignment;\r\n\t\t}\r\n\t\tString var=MinRemainingValue(csp, assignment);\r\n\t\tList<E> variables= LeastConstrainingValue(csp,var);\r\n\t\tfor(int i=0; i<variables.size();i++) {\r\n\t\t\tassignment.put(var,variables.get(i));\r\n\t\t\tif(csp.isConsistent(assignment)){\r\n\t\t\t\tInference<E> inference=AC3.ac3(csp,var,variables,variables.get(i));\r\n\t\t\t\tif(inference!=null){\r\n\t\t\t\t\tinference.reduceDomain(csp);\r\n\t\t\t\t\tAssignment<E> result = backtrackAC3MRVLRVDH(csp, assignment);\r\n\t\t\t\t\tinference.restoreDomain(csp);\r\n\t\t\t\t\tif(result!=null){\r\n\t\t\t\t\t\treturn result;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tassignment.remove(var);\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "private Value chooseSuggestion(PermissionOutcome outcome) {\n Value suggestedValue;\n if (outcome.highestAcceptedValue != null) {\n suggestedValue = outcome.highestAcceptedValue;\n } else {\n try {\n suggestedValue = queue.peek();\n } catch (NoSuchElementException e) {\n suggestedValue = new Value();\n }\n }\n return suggestedValue;\n }", "private Data iff(Node line, Namespace namespace) {\n\n\t\tNode cond = line.next;\n\t\tNode a = cond.next;\n\t\tNode b = a.next;\n\t\t\n\t\tif (Boolean.TRUE.equals(e.eval(cond, namespace).value)) {\n\t\t\treturn e.eval(a, namespace);\n\t\t} else if (b != null) {\n\t\t\treturn e.eval(b, namespace);\n\t\t}\n\t\t\n\t\treturn NO_RESULT;\n\t}", "public boolean isSolvable() {\n return goal != null;\n }", "public Closure find_var(String name){\n Closure currentClosure = this;\n while (currentClosure != null){\n if (currentClosure.contains(name)){\n return currentClosure;\n }\n currentClosure = currentClosure.getParent();\n }\n throw new UndefinedVariable();\n }", "@Override\n\tpublic void visit(WhileStatement n) {\n\t\tcfgNode = n;\n\t}", "boolean exactMatch(FlowRule rule);", "private ConflictCause assignTruth(int atom, ThriceTruth truth, NoGood impliedBy, int decisionLevel) {\n\t\tAssignment.Entry currentAssignment = assignment.get(atom);\n\t\tif (currentAssignment != null && currentAssignment.getDecisionLevel() <= decisionLevel && (truth.equals(currentAssignment.getTruth()))) {\n\t\t\treturn null;\n\t\t}\n\t\tConflictCause cause = assignment.assign(atom, truth, impliedBy, decisionLevel);\n\t\tif (cause == null) {\n\t\t\tdidPropagate = true;\n\t\t}\n\t\treturn cause;\n\t}", "public void testVariableBindingFromQueryPropagatesAccrossConjunction() throws Exception\n {\n resolveAndAssertSolutions(\"[[g(x), h(x), (f(X) :- g(X), h(X))], (?- f(x)), [[]]]\");\n }", "protected void assignmentOrIf(INestedIfElseClauseContainer upperIf) \r\n\t\t\tthrows InvalidProbabilityRangeException, \r\n\t\t\t\t TableFunctionMalformedException,\r\n\t\t\t\t SomeStateUndeclaredException,\r\n\t\t\t\t NoDefaultDistributionDeclaredException,\t// if-clause would eventually throw this\r\n\t\t\t\t InvalidConditionantException{\t\t\t// if-clause would eventually throw this\r\n\t\t\r\n\t\ttry {\r\n\t\t\tif (this.tokenLookAhead() == this.kwcode[this.lookup(\"IF\")]) {\r\n\t\t\t\t// this is an if-clause\r\n\t\t\t\tthis.ifStatement(upperIf);\r\n\t\t\t\t// an if-clause doesnt have do return something...\r\n\t\t\t} else {\r\n\t\t\t\t// since it is an assignment, we should check probability consistency as well\r\n\t\t\t\t\r\n\t\t\t\t// Consistency check C09\r\n\t\t\t\t// Structures that allow us to Verify if all states has probability declared\r\n\t\t\t\tList<Entity> declaredStates = new ArrayList<Entity>();\r\n\t\t\t\tList<Entity> possibleStates = null;\t\t\t\r\n\t\t\t\tif (this.node != null) {\r\n\t\t\t\t\tpossibleStates = this.node.getPossibleValueListIncludingEntityInstances();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.assignment(declaredStates, possibleStates);\r\n\t\t\t\t\r\n\r\n\t\t\t\tif (this.look == this.kwcode[this.lookup(\"IF\")]) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t// this is an if-clause after user-defined variable declaration\r\n\t\t\t\t\tthis.ifStatement(upperIf);\r\n\t\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// After the assignment, if there are undeclared states, distribute the remaining probability uniformly.\r\n\t\t\t\t\t// obtain undeclared states = possibleStates - declaredStates\r\n\t\t\t\t\tCollection<Entity> undeclaredStates = new HashSet<Entity>(possibleStates);\r\n\t\t\t\t\tundeclaredStates.removeAll(declaredStates);\r\n\t\t\t\t\tif (undeclaredStates.size() > 0) {\r\n\t\t\t\t\t\t// get the current (without the undeclared states) sum of probabilities\r\n\t\t\t\t\t\tfloat sumOfDeclaredProb = currentHeader.getProbCellSum();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// distribute the remaining probability (1-sumOfDeclaredProb) uniformly across the non-declared states\r\n\t\t\t\t\t\tfloat probOfUndeclaredState = (1f-sumOfDeclaredProb)/undeclaredStates.size();\r\n\t\t\t\t\t\tif (!isToNormalize() || (sumOfDeclaredProb >= 1)) {\r\n\t\t\t\t\t\t\t// if we don't need to normalize, then simply set all undeclared states to zero\r\n\t\t\t\t\t\t\tprobOfUndeclaredState = 0f;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tfor (Entity entity : undeclaredStates) {\r\n\t\t\t\t\t\t\tif (entity != null) {\r\n\t\t\t\t\t\t\t\t// distribute the remaining probability (1-retValue) uniformly across the non-declared states, but substitute NaN with 0\r\n\t\t\t\t\t\t\t\tif (this.getSSBNNode() != null) {\r\n\t\t\t\t\t\t\t\t\t// use a special type of cell which will recalculate the probability each time getProbabiity is called, by uniformly distributing 1-(probability of declared states)\r\n\t\t\t\t\t\t\t\t\tthis.currentHeader.addCell(new TempTableProbabilityCell(entity, new UniformComplementProbabilityValue(this.currentHeader, entity)));\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tthis.currentHeader.addCell(new TempTableProbabilityCell(entity, new SimpleProbabilityValue(Float.isNaN(probOfUndeclaredState)?0f:probOfUndeclaredState )));\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t// the following may be irrelevant now, since we fill all undeclared states automatically anyway\r\n//\t\t\t\t\t\t\t\tdeclaredStates.add(entity);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// the following check may be irrelevant now, since we fill all undeclared states automatically anyway\r\n//\t\t\t\t\tif (this.node != null) {\r\n//\t\t\t\t\t\t// Consistency check C09\r\n//\t\t\t\t\t\t// Verify if all states has probability declared\r\n//\t\t\t\t\t\tif (!declaredStates.containsAll(possibleStates)) {\r\n//\t\t\t\t\t\t\tthrow new SomeStateUndeclaredException();\r\n//\t\t\t\t\t\t}\r\n//\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Consistency check C09\r\n\t\t\t\t\t// Verify if sum of all declared states' probability is 1\r\n\t\t\t\t\t\r\n\t\t\t\t\t// runtime probability bound check (on SSBN generation time)\r\n\t\t\t\t\tif (isToNormalize()\r\n\t\t\t\t\t\t\t&& this.currentHeader.getProbCellSum() < 0.99995\t// check if normalization of probabilities smaller than 1 worked\r\n\t\t\t\t\t\t\t) {\r\n\t\t\t\t\t\t// Debug.println(\"Testing cell's probability value's sum: \" + currentHeader.getProbCellSum());\r\n\t\t\t\t\t\tif (!Float.isNaN(this.currentHeader.getProbCellSum())) {\r\n\t\t\t\t\t\t\tthrow new InvalidProbabilityRangeException(getNode().toString());\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// Debug.println(\"=>NaN found!!!\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t} catch (ArrayIndexOutOfBoundsException e) {\r\n\t\t\t/* \r\n\t\t\t * catching ArrayIndexOutOfBoundsException means that the keyword \"IF\"\r\n\t\t\t * was not found the list of keywords. It is an horrible implementation error!!\r\n\t\t\t */\r\n\t\t\tthrow new RuntimeException(this.getResource().getString(\"FatalError\"),e);\r\n\t\t}\r\n\t\t\r\n\t\t// any other exception should not be treated by this scope (equivalent to \"catch(Exception e){throw e}\")\r\n\t\t\r\n\t}", "public BPState execute(X86CondJmpInstruction ins, BPPath path, List<BPPath> pathList, X86TransitionRule rule) {\n\t\treturn null;\n\t}", "public void cleanUpByVarSetName(SSBNNode baseSSBNNode) {\r\n\t\t\t\r\n\t\t\t// no cleanup is necessary when this is a default distro - no boolean evaluation is present\r\n\t\t\tif (this.isDefault()) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// extracts parents' similar sets by strong OV names\r\n\t\t\tCollection<SSBNNode> parents = null;\r\n\t\t\tif (isExactMatchStrongOV()) {\r\n\t\t\t\tparents = baseSSBNNode.getParentSetByStrongOVWithWeakOVCheck(\r\n\t\t\t\t\t\tthis.getVarsetname().split(\"\\\\\" + baseSSBNNode.getStrongOVSeparator()));\r\n\t\t\t} else { // consider all parents that has at least one of the specified OVs in its argument\r\n\t\t\t\tparents = new HashSet<SSBNNode>();\r\n\t\t\t\t// search parents for each specified OV\r\n\t\t\t\tfor (String ovName : this.getVarsetname().split(\"\\\\\" + baseSSBNNode.getStrongOVSeparator())) {\r\n\t\t\t\t\tparents.addAll(baseSSBNNode.getParentSetByStrongOV(\r\n\t\t\t\t\t\t\tfalse,\t\t\t\t\t\t// not an exact match\r\n\t\t\t\t\t\t\tovName\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\tboolean found = false;\r\n\t\t\t\r\n\t\t\t// extract condicionants declared within the expression\r\n\t\t\tfor (TempTableHeader headParent : this.getParents()) {\r\n\t\t\t\t found = false;\r\n\t\t\t\t // look for headParent inside parents (set of similar parents)\r\n\t\t\t\t for (SSBNNode node : parents) {\r\n\t\t\t\t\tif (node.getResident().equals(headParent.getParent())) {\r\n\t\t\t\t\t\t// if node names are the same, then we found it\r\n\t\t\t\t\t\tfound = true;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t }\r\n\t\t\t if (!found) {\r\n\t\t\t \t // if we did not find a condicionant (inside expression) inside the parent set\r\n\t\t\t \t headParent.setKnownValue(true);\r\n\t\t\t }\r\n\t\t\t}\r\n\t\t}", "@Override\r\n public boolean evaluate(Map<Integer, Boolean> vars) {\n for (Formula formula : getParts()){\r\n if(formula.evaluate(vars)==false){\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "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}", "@Override\n public Expression visit(LogicalOpNode node) {\n\n Label trueLabel = new Label ();\n Label falseLabel = new Label ();\n Label endLabel = new Label ();\n\n process(node, trueLabel, falseLabel);\n\n cat.footoredo.mx.entity.Variable variable = tmpVariable(node.getType());\n\n label (trueLabel);\n assign (node.getLocation(), ref(variable), new Integer(Type.INT8, 1));\n jump (endLabel);\n\n label (falseLabel);\n assign (node.getLocation(), ref(variable), new Integer(Type.INT8, 0));\n jump (endLabel);\n\n label (endLabel);\n\n return isStatement() ? null : ref (variable);\n }", "private void setValueToRule() {\n\t\t\n\t\tif(!currRule.isEmpty()) {\n\t\t\tAntiSpamFilterControl.setWeigthByRuleManual(currRule, Double.parseDouble(manualRuleValue.getText()));\n\t\t}\n\t\t\n\t\tif(manualCBRules.isValid()) {\n\t\t\tcurrRule = manualCBRules.getSelectedItem().toString();\n\t\t}\n\t\tmanualRuleValue.setText(AntiSpamFilterControl.getWeigthByRule(currRule, true) + \"\");\n\t}", "private int evaluateCondition(int iIndex, SeqActivity iTarget) {\n\n\t\tif (_Debug) {\n\t\t\tSystem.out.println(\" :: SeqConditionSet --> BEGIN - \" + \"evaluateCondition\");\n\t\t\tSystem.out.println(\" ::--> \" + iIndex);\n\t\t}\n\n\t\tint result = EVALUATE_UNKNOWN;\n\n\t\t// Make sure this condition exists\n\t\tif (iIndex < mConditions.size()) {\n\n\t\t\tSeqCondition cond = mConditions.get(iIndex);\n\n\t\t\tif (_Debug) {\n\t\t\t\tSystem.out.println(\" ::--> Evaluate :: \" + cond.mCondition);\n\t\t\t}\n\n\t\t\t// evaluate the current condtion\n\t\t\tif (cond.mCondition.equals(SeqCondition.ALWAYS)) {\n\t\t\t\tresult = EVALUATE_TRUE;\n\t\t\t} else if (cond.mCondition.equals(SeqCondition.NEVER)) {\n\t\t\t\tresult = EVALUATE_FALSE;\n\t\t\t} else if (cond.mCondition.equals(SeqCondition.SATISFIED)) {\n\t\t\t\tif (iTarget.getObjStatus(cond.mObjID, mRollup)) {\n\t\t\t\t\tresult = (iTarget.getObjSatisfied(cond.mObjID, mRollup)) ? EVALUATE_TRUE : EVALUATE_FALSE;\n\t\t\t\t} else {\n\t\t\t\t\tresult = EVALUATE_UNKNOWN;\n\t\t\t\t}\n\t\t\t} else if (cond.mCondition.equals(SeqCondition.OBJSTATUSKNOWN)) {\n\t\t\t\tresult = iTarget.getObjStatus(cond.mObjID, mRollup) ? EVALUATE_TRUE : EVALUATE_FALSE;\n\t\t\t} else if (cond.mCondition.equals(SeqCondition.OBJMEASUREKNOWN)) {\n\t\t\t\tresult = iTarget.getObjMeasureStatus(cond.mObjID, mRollup) ? EVALUATE_TRUE : EVALUATE_FALSE;\n\t\t\t} else if (cond.mCondition.equals(SeqCondition.OBJMEASUREGRTHAN)) {\n\t\t\t\tif (iTarget.getObjMeasureStatus(cond.mObjID, mRollup)) {\n\t\t\t\t\tresult = (iTarget.getObjMeasure(cond.mObjID, mRollup) > cond.mThreshold) ? EVALUATE_TRUE : EVALUATE_FALSE;\n\t\t\t\t} else {\n\t\t\t\t\tresult = EVALUATE_UNKNOWN;\n\t\t\t\t}\n\t\t\t} else if (cond.mCondition.equals(SeqCondition.OBJMEASURELSTHAN)) {\n\t\t\t\tif (iTarget.getObjMeasureStatus(cond.mObjID, mRollup)) {\n\n\t\t\t\t\tresult = (iTarget.getObjMeasure(cond.mObjID, mRollup) < cond.mThreshold) ? EVALUATE_TRUE : EVALUATE_FALSE;\n\t\t\t\t} else {\n\t\t\t\t\tresult = EVALUATE_UNKNOWN;\n\t\t\t\t}\n\t\t\t} else if (cond.mCondition.equals(SeqCondition.COMPLETED)) {\n\t\t\t\tif (iTarget.getProgressStatus(mRollup)) {\n\t\t\t\t\tresult = iTarget.getAttemptCompleted(mRollup) ? EVALUATE_TRUE : EVALUATE_FALSE;\n\t\t\t\t} else {\n\t\t\t\t\tresult = EVALUATE_UNKNOWN;\n\t\t\t\t}\n\t\t\t} else if (cond.mCondition.equals(SeqCondition.PROGRESSKNOWN)) {\n\t\t\t\tresult = iTarget.getProgressStatus(mRollup) ? EVALUATE_TRUE : EVALUATE_FALSE;\n\t\t\t} else if (cond.mCondition.equals(SeqCondition.ATTEMPTED)) {\n\t\t\t\tresult = iTarget.getActivityAttempted() ? EVALUATE_TRUE : EVALUATE_FALSE;\n\t\t\t} else if (cond.mCondition.equals(SeqCondition.ATTEMPTSEXCEEDED)) {\n\t\t\t\tif (iTarget.getAttemptLimitControl()) {\n\t\t\t\t\tlong maxAttempt = iTarget.getAttemptLimit();\n\n\t\t\t\t\t// Check if this limit condition exists\n\t\t\t\t\tif (maxAttempt >= 0) {\n\t\t\t\t\t\tresult = (iTarget.getNumAttempt() >= maxAttempt) ? EVALUATE_TRUE : EVALUATE_FALSE;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (cond.mCondition.equals(SeqCondition.TIMELIMITEXCEEDED)) {\n\t\t\t\t// add later with other time tracking implementation...\n\t\t\t\t// -+- TODO -+-\n\t\t\t} else if (cond.mCondition.equals(SeqCondition.OUTSIDETIME)) {\n\n\t\t\t\t// add later with other time tracking implementation...\n\t\t\t\t// -+- TODO -+-\n\t\t\t}\n\n\t\t\t// Account for condition operator\n\t\t\tif (cond.mNot && result != EVALUATE_UNKNOWN) {\n\t\t\t\tif (_Debug) {\n\t\t\t\t\tSystem.out.println(\" ::--> Negate Result\");\n\t\t\t\t}\n\n\t\t\t\tresult = (result == EVALUATE_FALSE) ? EVALUATE_TRUE : EVALUATE_FALSE;\n\t\t\t}\n\t\t}\n\n\t\tif (_Debug) {\n\t\t\tSystem.out.println(\" ::--> \" + ((result == 1) ? \"True\" : \"False\"));\n\t\t\tSystem.out.println(\" :: SeqConditionSet --> END - \" + \"evaluateCondition\");\n\t\t}\n\n\t\treturn result;\n\t}", "@Override\n\tpublic void visit(IfNode node) {\n\t\tif (Evaluator.checkScope(node) == false) {\n\t\t\treturn;\n\t\t}\n\t\t/**\n\t\t * Verificare pentru assert failed\n\t\t */\n\t\tif (Evaluator.checkAssert(node) == false) {\n\t\t\treturn;\n\t\t}\n\t\t/**\n\t\t * evaluam conditia si preluam rezultatul evaluarii fiului corespunzator\n\t\t * branch-ului de then sau de else\n\t\t */\n\t\tEvaluator.evaluate(node.getChild(0));\n\n\t\t/***\n\t\t * Daca conditia este adevarata, continuam cu evaluarea celui de-al\n\t\t * doiela fiu, iar daca este false evaluam al treilea fiu\n\t\t */\n\t\tif (node.getChild(0).getName().contentEquals(\"true\")) {\n\t\t\tEvaluator.evaluate(node.getChild(1));\n\t\t\tnode.getChild(2).setVisited(true);\n\n\t\t\tif (node.getChild(1) instanceof Variable) {\n\t\t\t\tnode.setName(Evaluator.variables.get(node.getChild(1).getName()));\n\t\t\t} else {\n\t\t\t\tnode.setName(node.getChild(1).getName());\n\t\t\t}\n\t\t} else {\n\t\t\tEvaluator.evaluate(node.getChild(2));\n\t\t\tnode.getChild(1).setVisited(true);\n\n\t\t\tif (node.getChild(2) instanceof Variable) {\n\t\t\t\tnode.setName(Evaluator.variables.get(node.getChild(2).getName()));\n\t\t\t} else {\n\t\t\t\tnode.setName(node.getChild(2).getName());\n\t\t\t}\n\t\t}\n\n\t}", "boolean hasVarValue();", "public int evalPref(Schedule sched) {\n\t\t\n\t\tint failCount = 0;\n\t\tint index = -1;\n\t\tCourse workingCourse;\n\t\tLab workingLab;\n\t\tint testCount = 0;\n\t\t\n\t\t\n\t\tfor(int i = 0;i<preferences.size();i++)\n\t\t{\n\t\t\tindex = preferences.get(i).getY().getIndex();\n\t\t\t\n\t\t\tif(preferences.get(i).getY().getClass() == Course.class) //is a course\n\t\t\t{\n\t\t\t\tworkingCourse = sched.getCourses().get(index);\n\t\t\t\t\n\t\t\t\tif(workingCourse.getSlot() != preferences.get(i).getX())\n\t\t\t\t{\n\t\t\t\t\tfailCount += preferences.get(i).getZ();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //is a lab\n\t\t\t{\n\t\t\t\tworkingLab = sched.getLabs().get(index);\n\t\t\t\t\n\t\t\t\tif(workingLab.getSlot() != preferences.get(i).getX())\n\t\t\t\t{\n\t\t\t\t\tfailCount += preferences.get(i).getZ();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\ttestCount += preferences.get(i).getZ();\n\t\t\t\n\t\t}\n\t\t\n\t\t//System.out.println(testCount);\n\t\treturn failCount;\n\t\t\n\t\t/*\n\t\tArrayList<Course> uniqueCourses = new ArrayList<Course>();\n\t\tArrayList<Course> uniqueLabs = new ArrayList<Course>();\n\t\t\n\t\tArrayList<Pair<Course, Integer>> cRunningTotals = new ArrayList<Pair<Course, Integer>>();\n\t\tArrayList<Pair<Course, Integer>> lRunningTotals = new ArrayList<Pair<Course, Integer>>();\n\t\t\n\t\tArrayList<Course> cHasPrefMet = new ArrayList<Course>();\t\n\t\tArrayList<Lab> lHasPrefMet = new ArrayList<Lab>();\n\t\t\n\t\tboolean continueChecking = true;\n\t\tCourse prefCourse, workingCourse;\n\t\tLab prefLab, workingLab;\n\t\tTimeSlot prefTimeSlot, workingTimeSlot;\n\t\tint prefValue;\n\t\tint totalToReturn = 0;\n\t\t\n\t\t//Traverse through preferences to find the unique courses and labs\n\t\t//because each lab and course can have more than one \n\t\tfor(int i = 0;i<preferences.size();i++)\n\t\t{\n\t\t\tif(preferences.get(i).getY().getClass() == Course.class)//working with a course\n\t\t\t{\n\t\t\t\tif(!uniqueCourses.contains(preferences.get(i).getY()))\n\t\t\t\t{\n\t\t\t\t\tuniqueCourses.add(preferences.get(i).getY());\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //working with a class\n\t\t\t{\n\t\t\t\tif(!uniqueLabs.contains((Lab) preferences.get(i).getY()))\n\t\t\t\t{\n\t\t\t\t\tuniqueLabs.add((Lab)preferences.get(i).getY());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Now have two lists that contains all the unique courses and labs\n\t\t//-----\n\t\t\n\n\t\tfor(int i = 0; i<uniqueCourses.size();i++)\n\t\t{\n\t\t\tcRunningTotals.add(new Pair<Course, Integer>(uniqueCourses.get(i), 0));\n\t\t}\n\t\t\n\n\t\tfor(int i = 0; i<uniqueLabs.size();i++)\n\t\t{\n\t\t\tlRunningTotals.add(new Pair<Course, Integer>(uniqueLabs.get(i), 0));\n\t\t}\n\t\t\n\t\t//Have a running total pair for each unique course\n\t\t//When we find one that meets a single preference\n\t\t//then set that total to zero and don't change it anymore \n\t\t\n\t\t//Go through the preferences check if they are upheld\n\t\tfor(int i = 0; i<preferences.size();i++)\n\t\t{\n\t\t\tprefTimeSlot = preferences.get(i).getX();\n\t\t\tprefValue = preferences.get(i).getZ();\n\t\t\tcontinueChecking = true;\n\t\t\t\n\t\t\t//If it's a lab, if not, must be a class\n\t\t\tif(preferences.get(i).getY().getClass() == Lab.class)\n\t\t\t{\n\t\t\t\tprefLab = (Lab) preferences.get(i).getY();\n\t\t\t\t\n\t\t\t\t//Want to check if we have met a preference for this course already\n\t\t\t\t//If we have, we don't need to do a check for this preference s\n\t\t\t\tfor(int j = 0;j<lHasPrefMet.size();j++)\n\t\t\t\t{\n\t\t\t\t\tif(prefLab.equals(lHasPrefMet.get(j)))\n\t\t\t\t\t\tcontinueChecking = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(continueChecking == true)\n\t\t\t\t{\n\t\t\t\t\t//Have to find this lab in the schedule and look to see if\n\t\t\t\t\t//it's in the correct time slot\nA:\t\t\t\t\tfor(int j = 0;j<sched.getLabs().size();j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tworkingLab = sched.getLabs().get(j);\n\t\t\t\t\t\tworkingTimeSlot = workingLab.getSlot();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(workingLab.equals(prefLab))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif((workingTimeSlot.getDay().equals(prefTimeSlot.getDay())) &&\n\t\t\t\t\t\t\t\t\t(workingTimeSlot.getStartTime() == prefTimeSlot.getStartTime()) &&\n\t\t\t\t\t\t\t\t\t(workingTimeSlot.getMaxNum() == prefTimeSlot.getMaxNum())\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\t\t//If we met the pref, we add it so this course won't be \n\t\t\t\t\t\t\t\t//checked again cause a course can have more than 1 pref. and\n\t\t\t\t\t\t\t\t//Obviously not all can be met\n\t\t\t\t\t\t\t\tlHasPrefMet.add(workingLab);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//Find this lab in lRunningTotals and set it to zero\n\t\t\t\t\t\t\t\t\nX:\t\t\t\t\t\t\t\tfor(int k = 0; k<lRunningTotals.size();k++)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tLab temp;\n\t\t\t\t\t\t\t\t\ttemp = (Lab) lRunningTotals.get(k).getKey();\n\t\t\t\t\t\t\t\t\tif(temp.equals(workingLab))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlRunningTotals.set(k, new Pair<Course, Integer>(prefLab, 0));\n\t\t\t\t\t\t\t\t\t\tbreak X;\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\tbreak A;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//The lab did not meet the preferences being tested\n\t\t\t\t\t\t\t\t//so we need to add it's prefValue to the total for \n\t\t\t\t\t\t\t\t//that unique course\nQ:\t\t\t\t\t\t\t\tfor(int k = 0; k<lRunningTotals.size();k++)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tLab temp;\n\t\t\t\t\t\t\t\t\tint tempTotal;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\ttempTotal = lRunningTotals.get(k).getValue();\n\t\t\t\t\t\t\t\t\ttemp = (Lab) lRunningTotals.get(k).getKey();\n\t\t\t\t\t\t\t\t\tif(temp.equals(workingLab))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlRunningTotals.set(k, new Pair<Course, Integer>(prefLab, tempTotal + prefValue));\n\t\t\t\t\t\t\t\t\t\tbreak Q;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak A;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//SO, they are the same class, now check time slot and break out\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //If the preference is talking about a course\n\t\t\t{\n\n\t\t\t\tprefCourse = preferences.get(i).getY();\n\t\t\t\t//Want to check if we have met a preference for this course already\n\t\t\t\tfor(int j = 0;j<cHasPrefMet.size();j++)\n\t\t\t\t{\n\t\t\t\t\tif(prefCourse.equals(cHasPrefMet.get(j)))\n\t\t\t\t\t\tcontinueChecking = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(continueChecking == true)\n\t\t\t\t{\n\t\t\t\t\t//Have to find this course in the schedule and look to see if\n\t\t\t\t\t//it's in the correct time slot\nB:\t\t\t\t\tfor(int j = 0;j<sched.getCourses().size();j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tworkingCourse = sched.getCourses().get(j);\n\t\t\t\t\t\tworkingTimeSlot = workingCourse.getSlot();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(workingCourse.equals(prefCourse))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\tSystem.out.print(workingCourse.getDepartment());\n\t\t\t\t\t\t\tSystem.out.print(\" \" + workingCourse.getNumber());\n\t\t\t\t\t\t\tSystem.out.print(\" \" + workingCourse.getSection());\n\t\t\t\t\t\t\tSystem.out.println();\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tSystem.out.print(workingTimeSlot.getDay());\n\t\t\t\t\t\t\tSystem.out.print(\" \" + workingTimeSlot.getStartTime());\n\t\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\tSystem.out.print(prefTimeSlot.getDay());\n\t\t\t\t\t\t\tSystem.out.print(\" \" + prefTimeSlot.getStartTime());\n\t\t\t\t\t\t\t\n\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif((workingTimeSlot.getDay().equals(prefTimeSlot.getDay())) &&\n\t\t\t\t\t\t\t\t\t(workingTimeSlot.getStartTime() == prefTimeSlot.getStartTime()) &&\n\t\t\t\t\t\t\t\t\t(workingTimeSlot.getMaxNum() == prefTimeSlot.getMaxNum())\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t//Same ideas as when doing labs\n\t\t\t\t\t\t\t\tcHasPrefMet.add(workingCourse);\nY:\t\t\t\t\t\t\t\tfor(int k = 0; k<cRunningTotals.size();k++)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tCourse temp;\n\t\t\t\t\t\t\t\t\ttemp = cRunningTotals.get(k).getKey();\n\t\t\t\t\t\t\t\t\tif(temp.equals(workingCourse))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcRunningTotals.set(k, new Pair<Course, Integer>(prefCourse, 0));\n\t\n\t\t\t\t\t\t\t\t\t\tbreak Y;\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\tbreak B;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\nP:\t\t\t\t\t\t\t\tfor(int k = 0; k<cRunningTotals.size();k++)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tCourse temp;\n\t\t\t\t\t\t\t\t\tint tempTotal;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\ttempTotal = cRunningTotals.get(k).getValue();\n\t\t\t\t\t\t\t\t\ttemp = cRunningTotals.get(k).getKey();\n\t\t\t\t\t\t\t\t\tif(temp.equals(workingCourse))\n\t\t\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tcRunningTotals.set(k, new Pair<Course, Integer>(prefCourse, tempTotal + prefValue));\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tbreak P;\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak B;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Add up our fail totals\n\t\tfor(int i = 0;i<cRunningTotals.size();i++)\n\t\t{\n\t\t\ttotalToReturn += cRunningTotals.get(i).getValue();\n\t\t}\n\t\t\n\t\t\n\t\tfor(int i = 0;i<lRunningTotals.size();i++)\n\t\t{\n\t\t\ttotalToReturn += lRunningTotals.get(i).getValue();\n\t\t}\n\t\t\n\t\t\n\t\treturn totalToReturn;\n\t\t\n\t\t*/\n\t}", "boolean check (Env env) {\n if (Env.find (env, nameOfVar) != null) {\n return true;\n } else {\n System.err.println (\"Semantic error: The variable \\\"\" \n + nameOfVar + \"\\\" was used but was not declared!\");\n return false;\n }\n }", "@Override\n public boolean parseOptional(PsiBuilder builder) {\n boolean parsed = rule.parseOptional(builder);\n if (!parsed) {\n return false;\n }\n\n while (rule.parseOptional(builder)) {\n }\n\n return true;\n }", "public TreeStar nextVar(int[] variables,int lfri, int bestVar, int profondeur){\n if(profondeur<=variableLength){\n int[] temporary=variables.clone();\n\n temporary[bestVar]=lfri;//change the best available var from -1 to 0 or 1\n TreeStar treeStar= new TreeStar(temporary,profondeur);\n treeStar.setScore(testAstar(temporary));\n return treeStar;\n }\n return null;\n\n }", "protected void doDeduction() {\n\n boolean narrowed= false;\n\n unit=false;\n isInconclusive=false;\n\n int newXL;\n int newYU;\n\n Variable x = null;\n Variable y = null;\n\n for(Variable var : csp.getVars()){\n if(var.getPosition() == unitSB.getX().getPosition()){\n x = var;\n } else if(var.getPosition() == unitSB.getY().getPosition()){\n y = var;\n }\n }\n\n int xU = x.getUpperDomainBound();\n int yL = y.getLowerDomainBound();\n\n newXL = yL + unitSB.getCright();\n newYU = xU - unitSB.getCright();\n\n if(newXL>x.getLowerDomainBound()){\n Variable newX = new Variable(newXL, xU);\n newX.setPosition(x.getPosition());\n changeVariable(newX);\n narrowed= true;\n }\n if (newYU< y.getUpperDomainBound()){\n Variable newY = new Variable(yL, newYU);\n newY.setPosition(y.getPosition());\n changeVariable(newY);\n narrowed =true;\n }\n\n if(narrowed){\n doAlgorithmA1();\n }else {\n doAlgorithmA3();\n }\n\n }", "protected IGrid applyRules(IRuleset ruleset, IGrid nextGeneration) {\n\t\tfor(int col = 0; col < this.gridConfiguration.getCols(); col++) {\n\t\t\tfor(int row = 0; row < this.gridConfiguration.getRows(); row++) {\n\t\t\t\tnextGeneration.setState(col, row, ruleset.getNextGenerationState(\n\t\t\t\t\t\tthis.getState(col, row),\n\t\t\t\t\t\tthis.getGridConfiguration().getNeighborhood().countNeighborsAlive(col, row, this),\n\t\t\t\t\t\tthis.getGridConfiguration().getNeighborhood().getNeighbors().size()));\n\t\t\t}\n\t\t}\n\n\t\treturn nextGeneration;\n\t}", "public ExprNode validate(ExprValidationContext validationContext) throws ExprValidationException {\n boolean hasPropertyAgnosticType = false;\n EventType[] types = validationContext.getStreamTypeService().getEventTypes();\n for (int i = 0; i < validationContext.getStreamTypeService().getEventTypes().length; i++) {\n if (types[i] instanceof EventTypeSPI) {\n hasPropertyAgnosticType |= ((EventTypeSPI) types[i]).getMetadata().isPropertyAgnostic();\n }\n }\n\n if (!hasPropertyAgnosticType) {\n // the variable name should not overlap with a property name\n try {\n validationContext.getStreamTypeService().resolveByPropertyName(variableName, false);\n throw new ExprValidationException(\"The variable by name '\" + variableName + \"' is ambigous to a property of the same name\");\n } catch (DuplicatePropertyException e) {\n throw new ExprValidationException(\"The variable by name '\" + variableName + \"' is ambigous to a property of the same name\");\n } catch (PropertyNotFoundException e) {\n // expected\n }\n }\n\n VariableMetaData variableMetadata = validationContext.getVariableService().getVariableMetaData(variableName);\n if (variableMetadata == null) {\n throw new ExprValidationException(\"Failed to find variable by name '\" + variableName + \"'\");\n }\n isPrimitive = variableMetadata.getEventType() == null;\n variableType = variableMetadata.getType();\n if (optSubPropName != null) {\n if (variableMetadata.getEventType() == null) {\n throw new ExprValidationException(\"Property '\" + optSubPropName + \"' is not valid for variable '\" + variableName + \"'\");\n }\n eventTypeGetter = ((EventTypeSPI) variableMetadata.getEventType()).getGetterSPI(optSubPropName);\n if (eventTypeGetter == null) {\n throw new ExprValidationException(\"Property '\" + optSubPropName + \"' is not valid for variable '\" + variableName + \"'\");\n }\n variableType = variableMetadata.getEventType().getPropertyType(optSubPropName);\n }\n\n readersPerCp = validationContext.getVariableService().getReadersPerCP(variableName);\n if (variableMetadata.getContextPartitionName() == null) {\n readerNonCP = readersPerCp.get(EPStatementStartMethod.DEFAULT_AGENT_INSTANCE_ID);\n }\n variableType = JavaClassHelper.getBoxedType(variableType);\n return null;\n }", "public static boolean assignment(FileInputStream f) {\n if(observer != null){\n observer.parser.setCurrentRule(\"assignment\", true);\n }\n \n CToken t = new CToken();\n t = getUsePeek(f);\n\n if (!t.token.equals(\"let\")) {\n return false;\n }\n CScanner.needToUsePeekedToken = false;\n\n if (!descriptor(f)) {\n System.err.format(\"Syntax Error: In rule Assignment unexpected token \\\"%s\\\" of type %s on line %d.\\n\", t.token, t.type, t.lineNum);\n System.exit(0); \n }\n if(observer != null){\n observer.parser.setCurrentRule(\"assignment\", true);\n }\n t = getUsePeek(f);\n\n if (!t.token.equals(\"=\")) {\n System.err.format(\"Syntax Error: In rule Assignment unexpected token \\\"%s\\\" of type %s on line %d.\\n\", t.token, t.type, t.lineNum);\n System.exit(0); \n }\n\n CScanner.needToUsePeekedToken = false;\n \n if (!expression(f)) {\n System.err.format(\"Syntax Error: In rule Assignment unexpected token \\\"%s\\\" of type %s on line %d.\\n\", t.token, t.type, t.lineNum);\n System.exit(0); \n }\n if(observer != null){\n observer.parser.setCurrentRule(\"assignment\", true);\n }\n if (CScanner.needToUsePeekedToken) {\n t = CScanner.peekedToken;\n } //we peeked before this call, so use it\n else {\n t = CScanner.getNextToken(f);\n if(observer != null){\n observer.parser.setCurrentToken(t);\n }\n } //get token\n\n if (!t.token.equals(\";\")) {\n System.err.format(\"Syntax Error: In rule Assignment unexpected token \\\"%s\\\" of type %s on line %d.\\n\", t.token, t.type, t.lineNum);\n System.exit(0); \n }\n if(observer != null){\n observer.parser.setCurrentRule(\"assignment\", false);\n }\n return true;\n }", "private void doAsTopOfStack() {\n int activePos = pos + inputUsed;\n int leftoverLength = length - inputUsed;\n\n if (rule.rhs.length == rhsUsed) { // rule exhausted\n if (leftoverLength == 0) { // input exhausted\n TD.knownRuleGoals.recordParsing(this);\n TD.dottedGoalStack.pop();\n ((RuleGoal)this).doWorkAfterDone();\n TD.dottedGoalStack.push(this);\n }\n } else {\n Symbol rhsAtDot = rule.rhs[rhsUsed];\n if (leftoverLength > 0) {\n Symbol inputAtDot = TD.input.symbolAt(activePos);\n if (rhsAtDot.equals(inputAtDot)) doWorkAfterMatch(1);\n }\n for (int len = 0; len <= leftoverLength; len++)\n (new Goal(rhsAtDot, activePos, len)).doWork();\n }\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}", "private Value findDefVariable(CallGraph cg, Value value) {\n\t\tValue defV=null;\n\t\tfor(Iterator it = cg.sourceMethods(); it.hasNext();){\n\t\t\tSootMethod method =(SootMethod)it.next();\n\t\t\tExceptionalUnitGraph ug = new ExceptionalUnitGraph(method.getActiveBody());\n\t\t\t\n\t\t\tfor(Iterator ugIt = ug.iterator(); ugIt.hasNext();){\n\n\t\t\t\tUnit u = (Unit)ugIt.next();\n\t\t\t\tList<ValueBox> defBoxes = u.getDefBoxes();\n\t\t\t\tfor(ValueBox v : defBoxes){\n\t\t\t\t\tif(!v.getValue().toString().equals(value.toString())){\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tList<ValueBox> uses = u.getUseBoxes();\n\t\t\t\t\tfor(ValueBox use: uses){\n\t\t\t\t\t\tValue newV = use.getValue();\n\t\t\t\t\t\tif(newV instanceof Local){\n\t\t\t\t\t\t\tdefV = findLocalVDef(method, newV);\n\t\t\t\t\t\t}else if(newV instanceof FieldRef){\n\t\t\t\t\t\t\tdefV = findLocalVDef(method, newV);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tdefV = newV;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\treturn defV;\n\t}", "private static String resolveVariables(String nodeValue, Collection<String> variableChain) {\n\n String resolved = nodeValue;\n Matcher varNameMatcher = varNamePattern.matcher(nodeValue);\n\n Collection<String> variablesToResolve = new HashSet<String> ();\n\n while (varNameMatcher.find()) {\n String varName = varNameMatcher.group(1);\n if (variableChain != null && variableChain.contains(varName)) {\n // Found recursive reference when resolving variables. Log message and return null.\n log.debug(\"Found a recursive variable reference when resolving ${\" + varName + \"}\");\n return null;\n } else {\n variablesToResolve.add(varName);\n }\n }\n\n for (String nextVariable : variablesToResolve) {\n String value = getPropertyValue(nextVariable);\n\n if (value != null && !value.isEmpty()) {\n Collection<String> thisVariableChain = new HashSet<String> ();\n thisVariableChain.add(nextVariable);\n\n if (variableChain != null && !variableChain.isEmpty()) {\n thisVariableChain.addAll(variableChain);\n }\n\n String resolvedValue = resolveVariables(value, thisVariableChain);\n\n if (resolvedValue != null) {\n resolved = resolved.replaceAll(\"\\\\$\\\\{\" + nextVariable + \"\\\\}\", resolvedValue);\n } else {\n // Variable value could not be resolved. Log message and return null.\n log.debug(\"Could not resolve the value \" + value + \" for variable ${\" + nextVariable + \"}\");\n return null;\n }\n } else {\n // Variable could not be resolved. Log message and return null.\n log.debug(\"Variable \" + nextVariable + \" cannot be resolved.\");\n return null;\n }\n }\n\n return resolved;\n }", "public void testVariableBindingFromFirstPathPropagatesAccrossConjunctionAndFailsOnNonUnification() throws Exception\n {\n resolveAndAssertFailure(new String[] { \"g(x)\", \"h(y)\", \"f(X) :- g(X), h(X)\" }, \"?- f(Y)\");\n }", "public ArrayList<Predicate> expandInConjunctiveFormula(){\n\t\tArrayList<Predicate> formula = new ArrayList<Predicate>();\n\t\t\n\t\t// (x, (0,2)) (y,1) \n\t\t//holds positions of the vars\n\t\tHashtable<String,ArrayList<String>> pos = new Hashtable<String,ArrayList<String>>();\n\t\t//(const3, \"10\")\n\t\t//holds vars that have constants assigned\n\t\tHashtable<String,String> constants = new Hashtable<String,String>();\n\t\t\n\t\tRelationPredicate p = this.clone();\n\t\t//rename each term to a unique name\n\t\tfor(int i=0; i<p.terms.size(); i++){\n\t\t\tTerm t = p.terms.get(i);\n\t\t\tt.changeVarName(i);\n\n\t\t}\n\t\tformula.add(p);\n\n\t\tArrayList<String> attrsOld = getVarsAndConst();\n\t\tArrayList<String> attrsNew = p.getVarsAndConst();\n\n\t\t\n\t\tfor(int i=0; i<attrsOld.size(); i++){\n\t\t\tTerm t = terms.get(i);\n\t\t\tif(t instanceof ConstTerm){\n\t\t\t\t//get the constant value\n\t\t\t\tconstants.put(attrsNew.get(i),t.getVal());\n\t\t\t}\n\t\t\t\n\t\t\tArrayList<String> posVals = pos.get(attrsOld.get(i));\n\t\t\tif(posVals==null){\n\t\t\t\tposVals=new ArrayList<String>();\n\t\t\t\tpos.put(attrsOld.get(i),posVals);\n\t\t\t}\n\t\t\tposVals.add(String.valueOf(i));\n\n\t\t}\n\t\t\n\t\t//System.out.println(\"Position of attrs=\" + pos + \" Constants= \" + constants);\n\t\n\t\t//deal with var equality x0=x2\n\t\tIterator<String> it = pos.keySet().iterator();\n\t\twhile(it.hasNext()){\n\t\t\tString key = (String)it.next();\n\t\t\tArrayList<String> vals = pos.get(key);\n\t\t\tif(vals.size()>1){\n\t\t\t\t//add x0=x2 & x2=x9, etc\n\t\t\t\tfor(int i=1; i<vals.size(); i++){\n\t\t\t\t\tBuiltInPredicate p1 = new BuiltInPredicate(MediatorConstants.EQUALS);\n\t\t\t\t\t//p1.addTerm(new VarTerm(key+vals.get(i)));\n\t\t\t\t\t//p1.addTerm(new VarTerm(key+vals.get(i+1)));\n\t\t\t\t\tVarTerm v1 = new VarTerm(key);\n\t\t\t\t\tv1.changeVarName(Integer.valueOf(vals.get(i-1)).intValue());\n\t\t\t\t\tp1.addTerm(v1);\n\t\t\t\t\tVarTerm v2 = new VarTerm(key);\n\t\t\t\t\tv2.changeVarName(Integer.valueOf(vals.get(i)).intValue());\n\t\t\t\t\tp1.addTerm(v2);\n\t\t\t\t\tformula.add(p1);\n\t\t\t\t\t//i=i+1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//deal with constants\n\t\tit = constants.keySet().iterator();\n\t\twhile(it.hasNext()){\n\t\t\tString key = (String)it.next();\n\t\t\tString val = constants.get(key);\n\t\t\t//it's a constant\n\t\t\t//add const3=\"10\"\n\t\t\tBuiltInPredicate p1 = new BuiltInPredicate(MediatorConstants.EQUALS);\n\t\t\tp1.addTerm(new VarTerm(key));\n\t\t\tp1.addTerm(new ConstTerm(val));\n\t\t\tformula.add(p1);\n\t\t}\n\t\treturn formula;\n\t}", "protected Move alphaBetaSearch() {\n\n\t\tdouble value = maxValue(this.parent, Double.NEGATIVE_INFINITY,\n\t\t\t\tDouble.POSITIVE_INFINITY);\n\t\tSystem.out.println(\"value-alpha-beta = \" + value);\n\t\t\n\t\tdouble maxVal = Double.NEGATIVE_INFINITY;\n\t\tMove idealMove = new Move();\n\t\tfor (Node tempNode : this.parent.children) {\n\t\t\tSystem.out.println(\"tempNode.getEvalValue() = \" \n\t\t+ tempNode.getEvalValue());\n\n\t\t\tif (tempNode.getEvalValue() >= maxVal) {\n\t\t\t\t\tidealMove = tempNode.getMove();\n\t\t\t\t\tmaxVal = tempNode.getEvalValue();\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tif(this.forcedMove != null)\n\t\t\treturn this.forcedMove;\n\t\treturn idealMove;\n\n\t}", "protected Element evalAssurance(Assurance ass){\n\t\tRecord r1 = ass.getLeftRecord();\n\t\tRecord r2 = ass.getRightRecord();\n\t\tOperator op = ass.getOperator();\n\t\tElement an = el(\"bpws:assign\");\n\t\tif (r1.getType() == RecordType.FORMULAR)\n\t\t\tan.appendChild(setExpr(r1.getFormular(), \"nswomoxsd:leftValue\"));\n\t\tif (r2.getType() == RecordType.FORMULAR)\n\t\t\tan.appendChild(setExpr(r2.getFormular(), \"nswomoxsd:rightValue\"));\n\t\tan.appendChild(\n\t\t\tsetExpr(\n\t\t\t\tgetMyVarPath(\"/nswomoxsd:leftValue\") + \n\t\t\t\top.value() +\n\t\t\t\tgetMyVarPath(\"nswomoxsd:rightValue\"),\n\t\t\t\t\"nswomoxsd:value\"\n\t\t\t)\n\t\t);\n\t\treturn an;\n\t}", "public Rule selectRule(Vector ruleSet) {\r\n Enumeration enum2 = ruleSet.elements() ;\r\n long numClauses ;\r\n Rule nextRule ;\r\n\r\n Rule bestRule = (Rule)enum2.nextElement() ;\r\n long max = bestRule.numAntecedents() ;\r\n while (enum2.hasMoreElements()) {\r\n nextRule = (Rule)enum2.nextElement() ;\r\n if ((numClauses = nextRule.numAntecedents()) > max) {\r\n max = numClauses ;\r\n bestRule = nextRule ;\r\n }\r\n }\r\n return bestRule ;\r\n }" ]
[ "0.5449585", "0.54010916", "0.5335894", "0.5304723", "0.5177614", "0.49937668", "0.49714634", "0.49044892", "0.4862494", "0.48563737", "0.48509923", "0.48439088", "0.4807297", "0.4799906", "0.47450808", "0.47407547", "0.47321948", "0.47294772", "0.47294214", "0.47285277", "0.471954", "0.47151005", "0.47049654", "0.47038132", "0.4697552", "0.46905044", "0.46792036", "0.4674598", "0.46657434", "0.46634755", "0.46529478", "0.46090457", "0.46066985", "0.4595304", "0.45941752", "0.45834273", "0.45676085", "0.4559273", "0.45564747", "0.45453417", "0.45389622", "0.4528151", "0.4515943", "0.45086864", "0.45067006", "0.45053476", "0.45004702", "0.44941604", "0.4490731", "0.44880044", "0.44845718", "0.44809794", "0.4474594", "0.4457243", "0.44496465", "0.44467828", "0.44440395", "0.44389236", "0.44335097", "0.44327888", "0.44314736", "0.4419596", "0.44164887", "0.44110435", "0.44024795", "0.43969977", "0.4384645", "0.43820947", "0.4371374", "0.43699217", "0.43637303", "0.43624347", "0.43519557", "0.43479422", "0.43455023", "0.43415847", "0.43375558", "0.43373445", "0.43316972", "0.432924", "0.43244573", "0.43221182", "0.43162388", "0.43157512", "0.43155998", "0.43006384", "0.42991433", "0.42973435", "0.42930597", "0.42927927", "0.42912114", "0.4285704", "0.428515", "0.42833635", "0.4279904", "0.42782265", "0.4272764", "0.42723346", "0.42709196", "0.42684293" ]
0.6206946
0
///////////////////////////////////////////////////////////////////////////////////used for forward chaining only //////////////////////////////////////////////////////////////////determine which rules can fire, return a Vector
public Vector match(boolean test) { Vector matchList = new Vector() ; Enumeration enum2 = ruleList.elements() ; // System.out.println(enum2.toString()); while (enum2.hasMoreElements()) { Rule testRule = (Rule)enum2.nextElement() ; if (test) testRule.check() ; // test the rule antecedents if (testRule.truth == null) continue ; // fire the rule only once for now if ((testRule.truth.booleanValue() == true) && (testRule.fired == false)) matchList.addElement(testRule) ; } displayConflictSet(matchList) ; return matchList ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Vector<Rule> StemBase(){\r\n\t\t//Vector <Rule> rule=new Vector <Rule>();\r\n\t\tConceptLattice cp=new ConceptLattice(context);\r\n\t\tApproximationSimple ap=new ApproximationSimple(cp);\r\n\r\n\t\tBasicSet A=new BasicSet();\r\n\t\tBasicSet cnt=new BasicSet();\r\n\t\tBasicSet b=new BasicSet();\r\n\t\tcnt.addAll(context.getAttributes());\r\n\t\twhile(!A.equals(cnt)){\r\n\r\n\t\t\tif(A.isEmpty()){\r\n\t\t\t\tb =ap.CalculYsecondeNull(A, context);\r\n\t\t\t}else{\r\n\t\t\t\tb=ap.CalculYseconde(A, context);\r\n\t\t\t}\r\n\t\t\tif(!A.equals(b)){\r\n\t\t\t\tBasicSet diff=b.difference(A);\r\n\t\t\t\tBasicSet ant=(BasicSet) A.clone();\r\n\t\t\t\tdouble lift = 1;\r\n\t\t\t\tdouble confidence = 1;\r\n\t\t\t\tRule r=new Rule(ant,diff,context.support(ant.clone().union(diff)), confidence, lift );\r\n\t\t\t\t//int i=0;\r\n\t\t\t\tgetImp().add( r);\t\t\t\t\r\n\t\t\t}\r\n\t\t\tA=this.NextLClosure(cnt, A);\r\n\t\t}\r\n\r\n\t\treturn getImp();\r\n\r\n\t}", "private Rule honorRules(InstanceWaypoint context){\n \t\t\n \t\tStyle style = getStyle(context);\n \t\tRule[] rules = SLD.rules(style);\n \t\t\n \t\t//do rules exist?\n \t\t\n \t\tif(rules == null || rules.length == 0){\n \t\t\treturn null;\n \t\t}\n \t\t\n \t\t\n \t\t//sort the elserules at the end\n \t\tif(rules.length > 1){\n \t\t\trules = sortRules(rules);\n \t\t}\n \t\t\n \t\t//if rule exists\n \t\tInstanceReference ir = context.getValue();\n \t\tInstanceService is = (InstanceService) PlatformUI.getWorkbench().getService(InstanceService.class);\n \t\tInstance inst = is.getInstance(ir);\n \t\t\t\n \t\tfor (int i = 0; i < rules.length; i++){\n \t\t\t\n \t\t\tif(rules[i].getFilter() != null){\t\t\t\t\t\t\n \t\t\t\t\n \t\t\t\tif(rules[i].getFilter().evaluate(inst)){\n \t\t\t\t\treturn rules[i];\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\t//if a rule exist without a filter and without being an else-filter,\n \t\t\t//the found rule applies to all types\n \t\t\telse{\n \t\t\t\tif(!rules[i].isElseFilter()){\n \t\t\t\t\treturn rules[i];\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t\n \t\t//if there is no appropriate rule, check if there is an else-rule\n \t\tfor (int i = 0; i < rules.length; i++){\n \t\t\tif(rules[i].isElseFilter()){\n \t\t\t\treturn rules[i];\n \t\t\t}\n \t\t}\n \t\t\n \t \n \t\t//return null if no rule was found\n \t\treturn null;\n \t\n \t}", "private void applyTheRule() throws Exception {\n System.out.println();\n System.out.println();\n System.out.println();\n System.out.println(\"IM APPLYING RULE \" + this.parameter.rule + \" ON MODEL: \" + this.resultingModel.path);\n System.out.println();\n if (parameter.rule.equals(\"1\")) {\n Rule1.apply(resultingModel);\n System.out.println();\n }\n\n if (parameter.rule.equals(\"2\")) {\n Rule2.apply(resultingModel);\n System.out.println();\n }\n\n if (parameter.rule.equals(\"3\")) {\n Rule3.all(resultingModel);\n System.out.println();\n }\n\n if (parameter.rule.equals(\"3a\")) {\n Rule3.a(resultingModel);\n\n }\n\n if (parameter.rule.equals(\"3b\")) {\n Rule3.b(resultingModel);\n }\n\n if (parameter.rule.equals(\"3c\")) {\n Rule3.c(resultingModel);\n }\n\n if (parameter.rule.equals(\"4\")) {\n Rule4.all(resultingModel);\n }\n\n if (parameter.rule.equals(\"4a\")) {\n Rule4.a(resultingModel);\n }\n\n if (parameter.rule.equals(\"4b\")) {\n Rule4.b(resultingModel);\n }\n\n if (parameter.rule.equals(\"4c\")) {\n Rule4.c(resultingModel);\n }\n\n if (parameter.rule.equals(\"r1\")) {\n Reverse1.apply(resultingModel, parameter.aggregateBy);\n }\n\n if (parameter.rule.equals(\"r2\")) {\n Reverse2.apply(resultingModel, parameter.aggregateBy);\n }\n\n if (parameter.rule.equals(\"r3\")) {\n Reverse3.apply(resultingModel, parameter.aggregateBy);\n }\n\n if (parameter.rule.equals(\"r3a\")) {\n Reverse3.a(resultingModel);\n }\n\n if (parameter.rule.equals(\"r3b\")) {\n Reverse3.b(resultingModel);\n }\n\n if (parameter.rule.equals(\"r3c\")) {\n Reverse3.c(resultingModel);\n }\n\n if (parameter.rule.equals(\"r4\")) {\n Reverse4.all(resultingModel);\n }\n\n if (parameter.rule.equals(\"r4a\")) {\n Reverse4.a(resultingModel);\n }\n\n if (parameter.rule.equals(\"r4b\")) {\n Reverse4.b(resultingModel);\n }\n\n if (parameter.rule.equals(\"r4c\")) {\n Reverse4.c(resultingModel);\n }\n\n if (parameter.rule.equals(\"5\")){\n Rule5.apply(resultingModel);\n }\n\n System.out.println(\"IM DONE APPLYING RULE \" + this.parameter.rule + \" ON MODEL: \" + this.resultingModel.path);\n\n this.resultingModel.addRule(parameter);\n //System.out.println(this.resultingModel.name);\n this.resultingModel.addOutputInPath();\n }", "private Set<Condition> getConditions(List<RuleInstance> rules)\n{\n Set<Condition> conds = new HashSet<Condition>();\n\n getTimeConditions(rules,conds);\n getSensorConditions(rules,conds);\n getCalendarConditions(rules,conds);\n\n return null;\n}", "@NotNull\n @Generated\n @Selector(\"needRulesVerdict\")\n public static native NEFilterNewFlowVerdict needRulesVerdict();", "public void InstantiateAllRelevantsInRule (Rule rule, boolean forIntersection, boolean online)\n\t{\n\t\t//List<Rule> instRuleVector = new CopyOnWriteArrayList<Rule>();\n\t\tSet<Rule> instRuleVector = Collections.newSetFromMap(new ConcurrentHashMap<Rule, Boolean>());\n\t\t//long startTime = System.currentTimeMillis();\n\t\tif (false == forIntersection && false == rule.isFullyInst()) \n\t\t{\n\t\t\tfor (Atom bodyAtom : rule.getBody().getAtoms()) \n\t\t\t{\n\t\t\t\tfor (Atom instAtom : this.addedInstAtomsInLastIteration) \n\t\t\t\t{\n\t\t\t\t\tif (instAtom.getName().equals(bodyAtom.getName()))\n\t\t\t\t\t{\n\t\t\t\t\t\tAtom copyOfinstAtom = new Atom (instAtom);\n\t\t\t\t\t\tRule temp = new Rule (rule);\n\t\t\t\t\t\ttemp.SwapToInstAtomAndPartiallyInst(bodyAtom, copyOfinstAtom);\n\t\t\t\t\t\tif (true == temp.getIsFullyInst())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//Provenance.getInstance().AddRuleToProv(temp, this.level);\n\t\t\t\t\t\t\t//KeyMap.getInstance().UpdateRule(temp);\n\t\t\t\t\t\t\ttemp.getBody().setRuleUsed(rule);//added for the top-k\n\t\t\t\t\t\t\ttemp.getHead().setRuleUsed(rule);\n\t\t\t\t\t\t\t//for top-1!\n\t\t\t\t\t\t\tif (false == online) \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t/*KeyMap.getInstance().UpdateFactBody(temp.getBody());\n\t\t\t\t\t\t\t\tBody pointerBody = KeyMap.getInstance().GetPointerBodyForTop1(temp.getBody());\n\t\t\t\t\t\t\t\tif (true == pointerBody.LegalDerivation())\n\t\t\t\t\t\t\t\t{*/\n\t\t\t\t\t\t\t\tKeyMap.getInstance().Update(temp.getHead());\n\t\t\t\t\t\t\t\t//}\n\t\t\t\t\t\t\t\t//AtomsDerived.getInstance().Update(temp.getHead());\n\t\t\t\t\t\t\t\tProvenance.getInstance().AddRuleToProv(temp, this.level);\n\t\t\t\t\t\t\t\t//addedFullProv.add(KeyMap.getInstance().Get(temp.getHead()));\n\t\t\t\t\t\t\t\t//System.out.println(temp);\n\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{\n\t\t\t\t\t\t\t\tHandleTop1Scenario(temp, online);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\telse //if (false == online || temp.getRestricted() == null || false == temp.getBody().Uninstantiatated())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinstRuleVector.add(temp);\n\t\t\t\t\t\t\t//DeriveRule(temp, online);\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\tif (true == this.addedInstAtomsInLastIteration.isEmpty() || false == instRuleVector.isEmpty())\n\t\t\t{\n\t\t\t\tDeriveByRuleBottomUp ruleDeriver = new DeriveByRuleBottomUp(rule, this.p, this.topk, this.treesWaiting, this.previouslyFoundRelevants);\n\t\t\t\truleDeriver.FindDerivationsForRuleBottomUp(instRuleVector, forIntersection, level);\n\t\t\t}\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\tif (false == online || true == rule.getBody().AllAtomsInDb()) \n\t\t\t{\n\t\t\t\trule.getHead().setRuleUsed(rule);\n\t\t\t\trule.getBody().setRuleUsed(rule);//added for the top-k\n\t\t\t\tProvenance.getInstance().AddRuleToProv(rule, this.level);\n\t\t\t\t//for top-1!\n\t\t\t\tif (false == online) KeyMap.getInstance().Update(rule.getHead());\n\t\t\t\telse HandleTop1Scenario(rule, online);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/*long endTime = System.currentTimeMillis();\n\t\tif ((endTime-startTime) > 200)\n\t\t{\n\t\t\tSystem.out.println(\"DeriveByProgramBottomUp::InstantiateAllRelevantsInRule:: iteration time: \" + (endTime-startTime));\n\t\t\tSystem.out.println(\"DeriveByProgramBottomUp::InstantiateAllRelevantsInRule:: rule derived: \" + rule);\n\t\t\tSystem.out.println(\"DeriveByProgramBottomUp::InstantiateAllRelevantsInRule:: num of atoms last iter: \" + this.addedInstAtomsInLastIteration.size());\n\t\t}*/\n\t}", "public Rule selectRule(Vector ruleSet) {\r\n Enumeration enum2 = ruleSet.elements() ;\r\n long numClauses ;\r\n Rule nextRule ;\r\n\r\n Rule bestRule = (Rule)enum2.nextElement() ;\r\n long max = bestRule.numAntecedents() ;\r\n while (enum2.hasMoreElements()) {\r\n nextRule = (Rule)enum2.nextElement() ;\r\n if ((numClauses = nextRule.numAntecedents()) > max) {\r\n max = numClauses ;\r\n bestRule = nextRule ;\r\n }\r\n }\r\n return bestRule ;\r\n }", "@Override\n public List getRules() {\n return rules;\n }", "public Rules getRules()\r\n {\r\n return rules;\r\n }", "List<? extends Rule> getRules();", "public interface Rule {\n \n /**\n * Determine if a rule meets all of its conditions.\n * @param OpSystem The overall system for this rule.\n * @return true if the rule meets its condition.\n */\n public boolean meetsCondition(OpSystem system);\n}", "@Override\n public ArrayList<String> checkSemantics(SymbolTable env) {\n ArrayList<String> res = new ArrayList<>();\n\n // entro in un nuovo livello di scope\n env.entryNewScope();\n\n //checkSemantic di tutti i parametri\n for (ParameterNode param : parameterNodeArrayList) {\n res.addAll(param.checkSemantics(env));\n }\n\n //checkSemantic di tutte le dichiarazioni interne alla funzione\n if (declarationsArrayList.size() > 0) {\n env.setOffset(-2);\n for (INode n : declarationsArrayList)\n res.addAll(n.checkSemantics(env));\n }\n\n //checkSemantic del corpo della funzione\n res.addAll(body.checkSemantics(env));\n\n //esco dal livello di scope\n env.exitLastScope();\n\n //ritorno eventuali errori rilevati\n return res;\n }", "public interface RuleConstruction extends SelectRule, DeleteRule, UpdateRule {\n\n /**\n * Check whether word is key-word\n *\n * @param word - word\n * @return false - word is not key-word\n * true - word is key-word\n */\n boolean isNotKeyWord(String word);\n\n /**\n * Check whether word is By-word\n *\n * @param currentIndex - word index\n * @param words - list of words\n * @return true - word is correct\n * false - word is not correct\n */\n boolean isByCorrect(int currentIndex, List<String> words);\n\n /**\n * Check whether word is And-word or Or-word\n *\n * @param currentIndex - word index\n * @param words - list of words\n * @return true - word is correct\n * false - word is not correct\n */\n boolean isAndOrCorrect(int currentIndex, List<String> words);\n\n /**\n * Check whether word is Between-word\n *\n * @param currentIndex - word index\n * @param words - list of words\n * @return true - word is correct\n * false - word is not correct\n */\n boolean isBetweenCorrect(int currentIndex, List<String> words);\n}", "public final RuleBaseFacility getRules()\n{\n\treturn _rules;\n}", "private void installRulesOnFlow()\n\t{\t\t\t\n\t\tVertex sourceVertex = m_graph.getSourceVertex();\n\t\tshort vlanNum = 1;\n\t\tfor(Edge sourceOutEdge :sourceVertex.getOutgoingEdges())\n\t\t{\n\t\t\tif(sourceOutEdge.getFlow()>0)\n\t\t\t{\n\t\t\t\tattachIpAddressToVlan(vlanNum);\n\t\t\t\tinstallRule(sourceVertex.getName(), sourceOutEdge.getSourcePort(), vlanNum,RULE_TYPE.SOURCE_ADD_VLAN);\n\t\t\t\tinstallRule(sourceOutEdge.getTo().getName(), sourceOutEdge.getDestPort(), vlanNum,RULE_TYPE.DEST_IPV4);\n\t\t\t\tinstallRule(sourceVertex.getName(), sourceOutEdge.getSourcePort(), vlanNum,RULE_TYPE.SOURCE_ARP_ADD_VLAN);\n\t\t\t\tinstallRule(sourceOutEdge.getTo().getName(), sourceOutEdge.getDestPort(), vlanNum,RULE_TYPE.DEST_ARP);\n\t\t\t\tinstallRuleToHostSrc(sourceVertex.getName(),vlanNum, sourceOutEdge.getSourcePort());\n\t\t\t\tsourceOutEdge.setIsRuleInstalled();\n\t\t\t\tinstallRulesOnFlowDFS(sourceOutEdge.getTo(),vlanNum);\n\t\t\t\tvlanNum++;\n\t\t\t}\n\t\t}\t\n\t}", "String getRules();", "private List<LACRule> doExtractRules(List<Integer> featuresCombination)\n\t{\n\t\tList<LACRule> rules = new ArrayList<LACRule>();\n\n\t\tList<Integer> instancesWithFeatures = trainingSet.getInstancesWithFeatures(featuresCombination);\n\t\tint numClasses = trainingSet.getAllClasses().size();\n\t\tint[] count = new int[numClasses];\n\n\t\tint size = instancesWithFeatures.size();\n\n\t\tif (size > 0)\n\t\t{\n\t\t\tfor (int i = 0; i < size; i++)\n\t\t\t{\n\t\t\t\tInteger instanceIndex = instancesWithFeatures.get(i);\n\t\t\t\tLACInstance instance = trainingSet.getInstance(instanceIndex);\n\t\t\t\tint predictedClass = instance.getIndexedClass();\n\t\t\t\tcount[predictedClass] = count[predictedClass] + 1;\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < numClasses; i++)\n\t\t\t{\n\t\t\t\tint classCount = count[i];\n\t\t\t\tif (classCount > 0)\n\t\t\t\t{\n\t\t\t\t\tdouble support = (double) classCount / (double) trainingSet.length();\n\t\t\t\t\tdouble confidence = (double) classCount / (double) size;\n\n\t\t\t\t\tif(support > minSupport && confidence > minConfidence)\n\t\t\t\t\t{\n\t\t\t\t\t\tLACRule rule = new LACRule(support, confidence, i);\n\t\t\t\t\t\tif(debug)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\trule.setPattern(trainingSet.indexesToLabels(featuresCombination));\n\t\t\t\t\t\t\trule.setClassLabel(trainingSet.getClassByIndex(i).getLabel());\n\t\t\t\t\t\t\tSystem.out.println(rule);\n\t\t\t\t\t\t}\n\t\t\t\t\t\trules.add(rule);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn rules;\n\t}", "Rule getRule();", "public abstract ParameterVector searchVector();", "@Override\n public void computeSatisfaction() {\n\n }", "public Set<SWRLRule> translate() throws Exception {\n NodeList nodeList = doc.getElementsByTagName(\"rule\");\n if (nodeList == null) {\n throw new Exception(\"No rule tag in xml file\");\n }\n Set<SWRLRule> ruleSwrl = new HashSet<SWRLRule>();\n for (int i = 0; i < nodeList.getLength(); i++) {\n Set<SWRLAtom> antecedent = new HashSet<SWRLAtom>();\n Set<SWRLAtom> consequent = new HashSet<SWRLAtom>();\n Node node = nodeList.item(i);\n NodeList children = node.getChildNodes();\n for (int j = 0; j < children.getLength(); j++) {\n Node child = children.item(j);\n switch (child.getNodeName()) {\n case \"if\": {\n generateAntecedent((Element) child, antecedent);\n break;\n }\n case \"then\": {\n generateConsequent((Element) child, consequent);\n break;\n }\n }\n }\n SWRLRule rules = factory.getSWRLRule(antecedent, consequent);\n ruleSwrl.add(rules);\n }\n return ruleSwrl;\n }", "public interface RulesManager extends RulesService {\n\n boolean applyPortForwardingRules(long ipAddressId, boolean continueOnError, Account caller);\n\n boolean applyStaticNatRulesForIp(long sourceIpId, boolean continueOnError, Account caller, boolean forRevoke);\n\n boolean applyPortForwardingRulesForNetwork(long networkId, boolean continueOnError, Account caller);\n\n boolean applyStaticNatRulesForNetwork(long networkId, boolean continueOnError, Account caller);\n\n void checkIpAndUserVm(IpAddress ipAddress, UserVm userVm, Account caller);\n\n void checkRuleAndUserVm(FirewallRule rule, UserVm userVm, Account caller);\n\n boolean revokeAllPFAndStaticNatRulesForIp(long ipId, long userId, Account caller) throws ResourceUnavailableException;\n\n boolean revokeAllPFStaticNatRulesForNetwork(long networkId, long userId, Account caller) throws ResourceUnavailableException;\n\n List<? extends FirewallRule> listFirewallRulesByIp(long ipAddressId);\n\n /**\n * Returns a list of port forwarding rules that are ready for application\n * to the network elements for this ip.\n * \n * @param ip\n * @return List of PortForwardingRule\n */\n List<? extends PortForwardingRule> listPortForwardingRulesForApplication(long ipId);\n\n List<? extends PortForwardingRule> gatherPortForwardingRulesForApplication(List<? extends IpAddress> addrs);\n\n boolean revokePortForwardingRulesForVm(long vmId);\n\n boolean revokeStaticNatRulesForVm(long vmId);\n\n FirewallRule[] reservePorts(IpAddress ip, String protocol, FirewallRule.Purpose purpose, boolean openFirewall, Account caller, int... ports) throws NetworkRuleConflictException;\n\n boolean releasePorts(long ipId, String protocol, FirewallRule.Purpose purpose, int... ports);\n\n List<PortForwardingRuleVO> listByNetworkId(long networkId);\n\n boolean applyStaticNatForIp(long sourceIpId, boolean continueOnError, Account caller, boolean forRevoke);\n\n boolean applyStaticNatsForNetwork(long networkId, boolean continueOnError, Account caller);\n\n void getSystemIpAndEnableStaticNatForVm(UserVm vm, boolean getNewIp) throws InsufficientAddressCapacityException;\n\n boolean disableStaticNat(long ipAddressId, Account caller, long callerUserId, boolean releaseIpIfElastic) throws ResourceUnavailableException;\n\n}", "public abstract List<NARule> getRules(Context context);", "public Vector<Point> getValidMoves(){\r\n return this.validMoves;\r\n }", "com.google.privacy.dlp.v2.CustomInfoType.DetectionRule getDetectionRules(int index);", "public void deduceRules()\n{\n List<RuleInstance> allrules = loadRules();\n\n List<UpodRule> rules = new ArrayList<UpodRule>();\n for (UpodRule ur : for_program.getRules()) {\n if (ur.isExplicit()) {\n\t rules.add(ur);\n\t RuleInstance ri = new RuleInstance(ur,from_world.getUniverse());\n\t allrules.add(ri);\n }\n }\n\n Set<Condition> allconds = getConditions(allrules);\n\n tree_root = new TreeNode(allrules,null);\n\n expandTree(tree_root,allconds);\n\n generateRules(tree_root);\n}", "public Vector<Rule> learn(Vector<Rule> knowledgebase, Commitment selectedCommitment)\n {\n Situation situation3movementsAgo;\n Commitment firstCommitment;\n Commitment secondCommitment;\n Commitment lastCommitment;\n Commitment newCommitment;\n Condition newCondition;\n String predicate;\n Vector<Condition> conditions;\n Vector<Commitment> commitments;\n StringTokenizer tokenizer;\n String predicateHead;\n int i,j;\n int x, y;\n int x1,x2,x3;\n int y1,y2, y3;\n String direction1, direction2, direction3;\n Rule newRule;\n boolean found;\n boolean ruleAlreadyExists;\n String milestoneID;\n //-------------------------------\n\n if(Blackboard.history.size()>3)\n {\n situation3movementsAgo = Blackboard.history.get(Blackboard.history.size()-4);\n milestoneID = getMilestoneId();\n if(!milestoneID.equals(\"ninguna\"))\n {\n firstCommitment = Blackboard.history.get(Blackboard.history.size()-3).cause;\n secondCommitment = Blackboard.history.get(Blackboard.history.size()-2).cause;\n lastCommitment = selectedCommitment;\n conditions = new Vector<Condition>();\n\n // checa si hay que poner un predicado primero\n // referente a una milestone\n predicate = newRuleFirstCondition(situation3movementsAgo);\n\n if(!predicate.equals(\"ninguno\"))\n {\n // condicion de una milestone\n newCondition = new Condition(predicate);\n conditions.add(newCondition);\n }//end if\n\n if(predicate.equals(\"ninguno\"))\n {\n i= 0;\n while(i < 5)\n {\n x=getXOfAToken(situation3movementsAgo, i);\n y=getYOfAToken(situation3movementsAgo, i);\n newCondition = new Condition(\"posicion(\"+ x + \",\"+ y +\",\" + i + \")\");\n conditions.add(newCondition);\n i = i + 1;\n }//end while\n }//end if\n else\n {\n if(predicate.equals(\"primeraLineaLista\"))\n {\n x=getXOfAToken(situation3movementsAgo, 0);\n y=getYOfAToken(situation3movementsAgo, 0);\n newCondition = new Condition(\"posicion(\"+ x + \",\"+ y +\",\" + 0 + \")\");\n conditions.add(newCondition);\n i= 5;\n while(i < 9)\n {\n x=getXOfAToken(situation3movementsAgo, i);\n y=getYOfAToken(situation3movementsAgo, i);\n newCondition = new Condition(\"posicion(\"+ x + \",\"+ y +\",\" + i + \")\");\n conditions.add(newCondition);\n i = i + 1;\n }//end while\n }//end if\n else\n {\n if(predicate.equals(\"dosLineasListas\"))\n {\n x=getXOfAToken(situation3movementsAgo, 0);\n y=getYOfAToken(situation3movementsAgo, 0);\n newCondition = new Condition(\"posicion(\"+ x + \",\"+ y +\",\" + 0 + \")\");\n conditions.add(newCondition);\n\n x=getXOfAToken(situation3movementsAgo, 9);\n y=getYOfAToken(situation3movementsAgo, 9);\n newCondition = new Condition(\"posicion(\"+ x + \",\"+ y +\",\" + 9 + \")\");\n conditions.add(newCondition);\n\n x=getXOfAToken(situation3movementsAgo, 13);\n y=getYOfAToken(situation3movementsAgo, 13);\n newCondition = new Condition(\"posicion(\"+ x + \",\"+ y +\",\" + 13 + \")\");\n conditions.add(newCondition);\n\n }//end if\n else\n {\n if(predicate.equals(\"dosLineasYColumna\"))\n {\n x=getXOfAToken(situation3movementsAgo, 0);\n y=getYOfAToken(situation3movementsAgo, 0);\n newCondition = new Condition(\"posicion(\"+ x + \",\"+ y +\",\" + 0 + \")\");\n conditions.add(newCondition);\n x=getXOfAToken(situation3movementsAgo, 10);\n y=getYOfAToken(situation3movementsAgo, 10);\n newCondition = new Condition(\"posicion(\"+ x + \",\"+ y +\",\" + 10 + \")\");\n conditions.add(newCondition);\n x=getXOfAToken(situation3movementsAgo, 11);\n y=getYOfAToken(situation3movementsAgo, 11);\n newCondition = new Condition(\"posicion(\"+ x + \",\"+ y +\",\" + 11 + \")\");\n conditions.add(newCondition);\n x=getXOfAToken(situation3movementsAgo, 12);\n y=getYOfAToken(situation3movementsAgo, 12);\n newCondition = new Condition(\"posicion(\"+ x + \",\"+ y +\",\" + 12 + \")\");\n conditions.add(newCondition);\n x=getXOfAToken(situation3movementsAgo, 14);\n y=getYOfAToken(situation3movementsAgo, 14);\n newCondition = new Condition(\"posicion(\"+ x + \",\"+ y +\",\" + 14 + \")\");\n conditions.add(newCondition);\n x=getXOfAToken(situation3movementsAgo, 15);\n y=getYOfAToken(situation3movementsAgo, 15);\n newCondition = new Condition(\"posicion(\"+ x + \",\"+ y +\",\" + 15 + \")\");\n conditions.add(newCondition);\n\n\n }//end if\n }//end else\n }//end else\n }//end else\n\n\n // now constructs the rule conclusion\n // as a sequence of moves\n predicate = firstCommitment.predicate;\n tokenizer = new StringTokenizer(predicate,\"(, )\");\n predicateHead = tokenizer.nextToken();\n x1 = Integer.valueOf(tokenizer.nextToken());\n y1 = Integer.valueOf(tokenizer.nextToken());\n direction1 = tokenizer.nextToken();\n\n predicate = secondCommitment.predicate;\n tokenizer = new StringTokenizer(predicate,\"(, )\");\n predicateHead = tokenizer.nextToken();\n x2 = Integer.valueOf(tokenizer.nextToken());\n y2 = Integer.valueOf(tokenizer.nextToken());\n direction2 = tokenizer.nextToken();\n\n predicate = lastCommitment.predicate;\n tokenizer = new StringTokenizer(predicate,\"(, )\");\n predicateHead = tokenizer.nextToken();\n x3 = Integer.valueOf(tokenizer.nextToken());\n y3 = Integer.valueOf(tokenizer.nextToken());\n direction3 = tokenizer.nextToken();\n\n predicate = \"secuencia(\"+\n x1 + \",\" + y1 + \",\" + direction1 + \",\"+\n x2 + \",\" + y2 + \",\" + direction2 + \",\"+\n x3 + \",\" + y3 + \",\" + direction3 + \")\";\n newCommitment = new Commitment(predicate);\n commitments = new Vector<Commitment>();\n commitments.add(newCommitment);\n\n // includes the new rule into the knowledge base\n newRule = new Rule(knowledgeBase.size(), conditions, commitments);\n ruleAlreadyExists = false;\n i = 0;\n while(i < knowledgeBase.size())\n {\n if(knowledgeBase.get(i).equals(newRule))\n {\n ruleAlreadyExists = true;\n break;\n }//end if\n i = i + 1;\n }//end while\n if(!ruleAlreadyExists)\n {\n knowledgeBase.add(newRule);\n }//end if\n }//end if\n }//end if\n return knowledgeBase;\n }", "List<IntVector3> rails();", "public Vector<Argument> getAllArguments() {\r\n \t\tVector<Argument> args = new Vector<Argument>();\r\n \t\targs.addAll(argumentsFor);\r\n \t\targs.addAll(argumentsAgainst);\r\n \t\targs.addAll(relationships);\r\n \t\treturn args;\r\n \t}", "private void getSensorConditions(List<RuleInstance> rules,Set<Condition> conds)\n{\n for (int i = 0; i < rules.size(); ++i) {\n RuleInstance ri1 = rules.get(i);\n for (int j = i+1; j < rules.size(); ++j) {\n\t RuleInstance ri2 = rules.get(j);\n\t if (ri1.getStateId() == ri2.getStateId()) continue;\n\t addSensorConditions(ri1,ri2,conds);\n }\n }\n}", "public List<RulesEngineRule> rules() {\n return this.innerProperties() == null ? null : this.innerProperties().rules();\n }", "@Override\n public List<Rule> getPriceRules() {\n return List.of(getMatchTravelCardHolderRule());\n }", "public interface SightingFilterFunction {\n\t/**\n\t * Takes in a list of sightings and returns the ones which are valid.\n\t * Can additionally be used to combine sightings using the Sighting.addSighting() method if \n\t * user-supplied logic determines that a single instance of a target has been split into two\n\t * sightings.\n\t * @param rawSightings the unfiltered list of Sightings\n\t * @return the Sightings from rawSightings that are valid according to user-defined logic.\n\t */\n\tpublic ArrayList<Sighting> filter(ArrayList<Sighting> rawSightings);\n}", "public interface Rule {\r\n\r\n\tString getTargetedPropertyName();\r\n\tboolean hasFinished();\r\n\tObject nextValue();\r\n\tObject[] getValues();\r\n\tpublic void setValues(Object[] values);\r\n\t\r\n}", "public abstract List<EventRule> getEventRulesOfSentence();", "E9Rule createE9Rule();", "public double[] setVectorAction() \n\t{\n\t ;////System.out.println(\"\");\n\t ;////System.out.println(\"setVectorAction() called...\");\n\t //String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(Calendar.getInstance().getTime());\n\t ////System.out.println(\"setAction() called at \" + timeStamp + \"...\");\n\n\t //Determine the softMax temperature on the basis of the probability of user abandonment\n\t double abandonmentProbability = getAbandonmentProbability();\n\t softMax_temperature = (1 - abandonmentProbability);\n\t ;////System.out.println(\"-probability of abandonment: \" + abandonmentProbability );\n\t ;////System.out.println(\"-calling softmax with temperature of: \" + softMax_temperature);\n\t \n\t //Select action according to softMax probabilities\n\t double[] softmaxProbs = softmax(this.vectorModel);\n\t for (int i = 0; i < softmaxProbs.length;i++)\n\t {\n\t \t String vector = Arrays.toString(valueArrayList.get(i));\n\t \t ;////System.out.println(\"-probability of vector \"+vector+\" (with average accumulated reward \" + this.vectorModel[i] + \") being selected is: \" + softmaxProbs[i]);\n \n\t }\n\t \n\t double p = Math.random();\n\t double cumulativeProbability = 0.0;\n\t double[] selectedAction = new double[valueArrayList.get(0).length];\n\t for (int i = 0; i < softmaxProbs.length; i++) {\n\t cumulativeProbability += softmaxProbs[i];\n\t if (p <= cumulativeProbability) {\n\t selectedAction = valueArrayList.get(i);\n\t break;\n\t }\n\t }\n\t //return the selected vector\n\t return selectedAction;\n\n\t}", "public int resultRules(Instance inst) {\n\n if (resultRule(inst) != -1) {\n\treturn m_classification;\n } else if (m_next != null) {\n\treturn m_next.resultRules(inst);\n } else {\n\treturn -1;\n }\n }", "public TypeCheckerProofRule getRule ( ) ;", "CollisionRule getCollisionRule();", "private Vector combinationAlgorithm(Stroke theStroke){\n\t\tCurvatureBasedDetection cbd = new CurvatureBasedDetection();\n\t\tSpeedBasedDetection sbd = new SpeedBasedDetection();\n\t\tCommonSegmentPts = new Vector();\n\t\tCurvPts = cbd.getCurvatureData();\n\t\tdouble SpeedPts[][] = sbd.getSpeedData();\n\t\tCurvPtCount = cbd.getIndex();\n\t\tint SpeedPtCount = sbd.getIndex();\n\t\tint index ;\n\t\tCurvVector = new Vector();\n\t\t//copy the speed and curvature data in two vectors\n\t\tfor (index = 0; index < CurvPtCount ; index++){\n\t\t\tDouble obj = CurvPts[index][0];\n\t\t\tCurvVector.add(new Integer(obj.intValue()));\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Curvature Indices\");\n\t\tprintValues(CurvVector);\n\t\t\n\t\tSpeedVector = new Vector();\n\t\tfor (index = 0; index < SpeedPtCount ; index++){\n\t\t\tDouble obj = SpeedPts[index][0];\n\t\t\tSpeedVector.add(new Integer(obj.intValue()));\n\t\t}\n\t\tSystem.out.println(\"Speed Indices\");\n\t\tprintValues(SpeedVector);\n\t\tSort sort = new Sort();\n\t\tint ElementIndex;\n\t\t// find common points (intersection of speed and curvature) and put it in CommonSegmentPts vector\n\t\t\n\t\tboolean flag = false;\n\t\tfor(index = 0; index < SpeedVector.size(); index++ ){\n\t\t\t\n\t\t\tElementIndex = sort.linearSearch(CurvVector, (Integer)SpeedVector.elementAt(index));\n\t\t\t\n\t\t\tif(ElementIndex != -1){\n\t\t\t\tCommonSegmentPts.add((Integer)(CurvVector.elementAt(ElementIndex)));\n\t\t\t\tCurvVector.remove(ElementIndex);\n\t\t\t\tSpeedVector.remove(index --); // point is removed from vectors\n\t\t\t\t\n\t\t\t}\t\t\n\t\t}\n\t\tSystem.out.println(\"Common Points\");\n\t\tprintValues(CommonSegmentPts);\n\t\tint ElemAtIndex;\n\t\t// Find the curvature based segment points in the Tolerance Distance of speed based segment points \n\t\tfor(index = 0; index < SpeedVector.size(); index++ ){\n\t\t\tElementIndex = FindNearbyPts(CurvVector, (Integer)SpeedVector.elementAt(index), theStroke);\n\t\t\tif(ElementIndex != -1){\n\t\t\t\tElemAtIndex = ((Integer)CurvVector.elementAt(ElementIndex) + (Integer)SpeedVector.elementAt(index))/2;\n\t\t\t\tCommonSegmentPts.add(ElemAtIndex);\n\t\t\t\tCurvVector.remove(ElementIndex);\n\t\t\t\tSpeedVector.remove(index--);\n\t\t\t}\n\t\t}\n\t\t//printValues(CommonSegmentPts);\n\t\tremoveNearbyPixels(theStroke);\n\t\t//setNewScalingFactor(theStroke);\n\t\tCollections.sort(CommonSegmentPts);\n\t\tprintValues(CommonSegmentPts);\n\t\tdouble PrevIterError;\n\t\tdouble NewIterError;\n\t\tVector IterationPts = new Vector(); \n\t\t//System.out.println(\"Error \" + (PrevIterError = calculateError(CommonSegmentPts, theStroke)));\n\t\t// create a vector that stores segment points of each iteration\n\t\tIterWiseSegPts = new Vector();\n\t\t// for hybrid\n\t\tIterationPts = copyVector(IterationPts, CommonSegmentPts);\n\t\tdouble PrevError = calculateError(IterationPts, theStroke);\n\t\tif(PrevError > 10000.0){\t// if stroke consists of curves\n\t\t\terrorTolerance = 90.0;\n\t\t}\n\t\tIterationPts.add((double ) PrevError);\n\t\tIterWiseSegPts = appendVector(IterWiseSegPts,IterationPts);\n\t\tdouble NewError = -1;\n/*\t\tint vectorIndex = 0;\n\t\t\n\t\twhile(CurvVector.size()!=0 || SpeedVector.size()!=0){\n\t*/\t\t\n\t\t\t// code for accepting seg points uptil pts reduce the error by 100\n\t\t/*\n\t\t\tif(CurvVector.size()!=0){\n\t\t\t\tint CurvIndex = (Integer)CurvVector.get(0);\n\t\t\t\tCommonSegmentPts.add(CurvIndex);\n\t\t\t\tCurvVector.remove(0);\n\t\t\t\tCollections.sort(CommonSegmentPts);\n\t\t\t\tNewIterError = calculateError(CommonSegmentPts, theStroke);\n\t\t\t\tif((PrevIterError - NewIterError) > 100.0){\n\t\t\t\t\tvectorIndex++;\n\t\t\t\t\tIterWiseSegPts.add(CurvIndex);\n\t\t\t\t\tPrevIterError = NewIterError;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\twhile(CurvVector.size()!=0){\n\t\t\t\t\t\tCurvVector.remove(0);\n\t\t\t\t\t}\t\t\t\t\t//return IterWiseSegPts;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif(SpeedVector.size()!=0){\n\t\t\t\tint SpeedIndex = (Integer)SpeedVector.get(0);\n\t\t\t\tCommonSegmentPts.add(SpeedIndex);\n\t\t\t\tSpeedVector.remove(0);\n\t\t\t\tCollections.sort(CommonSegmentPts);\n\t\t\t\tNewIterError = calculateError(CommonSegmentPts, theStroke);\n\t\t\t\tSystem.out.println(\"New Error = \" + NewIterError);\n\t\t\t//CommonSegmentPts.add((Double)NewIterError);\n\t\t\t\tif((PrevIterError - NewIterError) > 100.0 ){\n\t\t\t\t\tvectorIndex++;\n\t\t\t\t\tIterWiseSegPts.add(SpeedIndex);\n\t\t\t\t\tPrevIterError = NewIterError;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\twhile(SpeedVector.size()!=0){\n\t\t\t\t\t\tSpeedVector.remove(0);\n\t\t\t\t\t}\t\t\n\t\t\t\t\t//return IterWiseSegPts;\n\t\t\t\t}\n\t\t\t\n\t\t\t\t\n\t\t\t}*/\n\t\t\t// my approach\n\t/*\t\t\n\t\t\tif(CurvVector.size()!=0){\n\t\t\t\tint Index = findMinimumErrorIndex(CurvVector,CommonSegmentPts,theStroke);\n\t\t\t\tif(Index != -1){\n\t\t\t\tint CurvIndex = (Integer)CurvVector.get(Index);\n\t\t\t\tCommonSegmentPts.add((Integer)CurvIndex);\n\t\t\t\tCurvVector.remove(Index);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tCurvVector = clearVector(CurvVector);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(SpeedVector.size()!=0){\n\t\t\t\tint Index = findMinimumErrorIndex(SpeedVector,CommonSegmentPts,theStroke);\n\t\t\t\tif(Index != -1){\n\t\t\t\tint SpeedIndex = (Integer)SpeedVector.get(Index);\n\t\t\t\tCommonSegmentPts.add((Integer)SpeedIndex);\n\t\t\t\tSpeedVector.remove(Index);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSpeedVector = clearVector(SpeedVector);\n\t\t\t\t}\n\t\t\t}\n\t\t\tIterationPts = clearVector(IterationPts);\n\t\t\tIterationPts = copyVector(IterationPts, CommonSegmentPts);\n\t\t\tCollections.sort(IterationPts);\n\t\t\tIterError = calculateError(IterationPts, theStroke);\n\t\t\tIterationPts.add((double) IterError);\n\t\t\tIterWiseSegPts = appendVector(IterWiseSegPts,IterationPts);\n\t\t\tremoveNearbyPixels(theStroke);\n\n\t\t}\n\t\tCommonSegmentPts = clearVector(CommonSegmentPts);\n\t\tCommonSegmentPts = selectBestSegPtsSet(IterWiseSegPts);*/\n\t\t\n\t\t/*\tif(CurvVector.size()!=0){\n\t\tint Index = findMinimumErrorIndex(CurvVector,CommonSegmentPts,theStroke);\n\t\tif(Index != -1){\n\t\tint CurvIndex = (Integer)CurvVector.get(Index);\n\t\tCommonSegmentPts.add((Integer)CurvIndex);\n\t\tCurvVector.remove(Index);\n\t\t}\n\t\telse{\n\t\t\tCurvVector = clearVector(CurvVector);\n\t\t}\n\t}\n\tif(SpeedVector.size()!=0){\n\t\tint Index = findMinimumErrorIndex(SpeedVector,CommonSegmentPts,theStroke);\n\t\tif(Index != -1){\n\t\tint SpeedIndex = (Integer)SpeedVector.get(Index);\n\t\tCommonSegmentPts.add((Integer)SpeedIndex);\n\t\tSpeedVector.remove(Index);\n\t\t}\n\t\telse{\n\t\t\tSpeedVector = clearVector(SpeedVector);\n\t\t}\n\t}\n\tIterationPts = clearVector(IterationPts);\n\tIterationPts = copyVector(IterationPts, CommonSegmentPts);\n\tCollections.sort(IterationPts);\n\tIterError = calculateError(IterationPts, theStroke);\n\tIterationPts.add((double) IterError);\n\tIterWiseSegPts = appendVector(IterWiseSegPts,IterationPts);\n\tremoveNearbyPixels(theStroke);\n\n}\nCommonSegmentPts = clearVector(CommonSegmentPts);\nCommonSegmentPts = selectBestSegPtsSet(IterWiseSegPts);*/\n\t\t\n\t\t\n\t\t// hybrid fit approach\n\t\tint curvIndex = -1, speedIndex = -1;\n\t\tdouble curvError,speedError;\n\t\tVector curvPts = new Vector();\n\t\tVector speedPts = new Vector();\n\t\tVector changeInError = new Vector();\n\t\twhile((CurvVector.size() != 0) || (SpeedVector.size() != 0) ){\n\t\t\tcurvError = DEFAULT;\n\t\t\tspeedError = DEFAULT;\n\t\t\t\n\t\t\tif(CurvVector.size() != 0){\n\t\t\t\tclearVector(curvPts);\n\t\t\t\tcurvPts = copyVector(curvPts, CommonSegmentPts);\n\t\t\t\tcurvIndex = (Integer)CurvVector.get(0);\n\t\t\t\tcurvPts.add((Integer)curvIndex);\n\t\t\t\tCurvVector.remove(0);\n\t\t\t\tCollections.sort(curvPts);\n\t\t\t\tcurvError = calculateError(curvPts, theStroke);\n\t\t\t\tcurvPts.add((Double)curvError);\n\t\t\t}\n\t\t\t\n\t\t\tif(SpeedVector.size() != 0){\n\t\t\t\tclearVector(speedPts);\n\t\t\t\tspeedPts = copyVector(speedPts, CommonSegmentPts);\n\t\t\t\tspeedIndex = (Integer)SpeedVector.get(0);\n\t\t\t\tspeedPts.add((Integer)speedIndex);\n\t\t\t\tSpeedVector.remove(0);\n\t\t\t\tCollections.sort(speedPts);\n\t\t\t\tspeedError = calculateError(speedPts, theStroke);\n\t\t\t\tspeedPts.add((Double)speedError);\n\t\t\t}\n\t\t\t\n\t\t\tif((speedError <= curvError) || (curvError == DEFAULT)){\n\t\t\t\tNewError = speedError;\n\t\t\t\t//changeInError.add((Double)(NewError - PrevError));\n\t\t\t\tif((PrevError - NewError) > errorTolerance){\n\t\t\t\tIterWiseSegPts = appendVector(IterWiseSegPts, speedPts);\n\t\t\t\tCommonSegmentPts.add((Integer)speedIndex);\n\t\t\t\tchangeInError.add((Double)(PrevError - NewError));\n\t\t\t\tPrevError = NewError;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if((curvError < speedError) || (speedError == DEFAULT)){\n\t\t\t\tNewError = curvError;\n\t\t\t\tif((PrevError - NewError) > errorTolerance){\n\t\t\t\tIterWiseSegPts = appendVector(IterWiseSegPts, curvPts);\n\t\t\t\tCommonSegmentPts.add((Integer)curvIndex);\n\t\t\t\tchangeInError.add((Double)(PrevError - NewError));\n\t\t\t\tPrevError = NewError;\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\t\n\t\t}\n\t\t\t\n\t\tCommonSegmentPts = clearVector(CommonSegmentPts);\n\t\tVector TempVect = new Vector();\n\t\tCommonSegmentPts = copyVectorIndex(IterWiseSegPts, TempVect, IterWiseSegPts.size() - 1);\n\t\t//TempVect = copyVectorIndex(IterWiseSegPts, TempVect, IterWiseSegPts.size() -1);\n\t\t/*index = 0;\n\t\twhile(index < (TempVect.size()-1)){\n\t\t\tCommonSegmentPts.add((Integer)TempVect.get(index++));\n\t\t}*/\n\t\t//CommonSegmentPts = selectBestSegPtsSet(IterWiseSegPts);\n\t\t\n\t\treturn CommonSegmentPts;\n\t}", "public Set<StructuralMessage> process(IClassHierarchy cha, StructuralRule[] rules, final Predicate<IClass> classFilter) {\n Map<AccessibilityTarget, ArrayList<Accessor>> targetsToAccessors = computeAccessibility(cha, classFilter);\n if (DEBUG)\n printAccessibility(targetsToAccessors);\n Map<Integer, StructuralRule> accessibilityRulesMap = getAccessibilityRules(rules);\n return computeMemberViolations(targetsToAccessors, accessibilityRulesMap, cha);\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 }", "List<T> getRuleTargets();", "@Override\r\npublic void initRules(){\r\n\t\r\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 }", "protected Collection<FlowRule> processSpecificSwitch(ForwardingObjective fwd) {\n log.warn(\"Vlan switching not supported in ovs-corsa driver\");\n fail(fwd, ObjectiveError.UNSUPPORTED);\n return ImmutableSet.of();\n }", "public List<Vector> swerveVectorCalculator(Vector translationVector, double rotation) {\n \tdouble xPerpendicular = X_PERPENDICULAR_CONSTANT;\n \tdouble yPerpendicular = Y_PERPENDICULAR_CONSTANT;\n \tif (headingControllerEnabled) {\n \t\txPerpendicular *= this.headingControllerOutput;\n \tyPerpendicular *= this.headingControllerOutput;\t\n \t} else {\n \t\txPerpendicular *= rotation;\n \tyPerpendicular *= rotation;\t\n \t}\n \t\n \tif (isFieldCentricDriveMode()) {\n \ttranslationVector.pushAngle(-getHeading());\n \t} \t\n \t\n \tList<Vector> moduleVector = new ArrayList<Vector>(Arrays.asList(\n \t\t\tnew Vector(translationVector.getX() + xPerpendicular, translationVector.getY() - yPerpendicular),\n \t\t\tnew Vector(translationVector.getX() - xPerpendicular, translationVector.getY() - yPerpendicular),\n \t\t\tnew Vector(translationVector.getX() - xPerpendicular, translationVector.getY() + yPerpendicular),\n \t\t\tnew Vector(translationVector.getX() + xPerpendicular, translationVector.getY() + yPerpendicular)\n \t\t\t));\n \t\n \tmoduleVector.stream().forEach(v -> v.scaleMagnitude((DEFAULT_DRIVE_POWER + ((MAX_DRIVE_POWER - DEFAULT_DRIVE_POWER) * OI.getTurboPower()))));\n \t\n \tdouble maxMagnitude = 0;\n \t\n \tfor (int i = 0; i < 4; i++) maxMagnitude = (moduleVector.get(i).getMagnitude() > maxMagnitude) ? moduleVector.get(i).getMagnitude() : maxMagnitude;\n \t\n \tdouble scaleFactor = ((maxMagnitude > 1.0) ? 1.0 / maxMagnitude : 1.0);\n \t\n \tmoduleVector.stream().forEach(v -> {\n \t\tv.scaleMagnitude(scaleFactor);\n \t\tif (v.getMagnitude() > 1.0) v.setMagnitude(1.0);\n \t});\n \treturn moduleVector;\n }", "public Rules(Player player) {\n this.player = player;\n categoryCheck = new boolean[13];\n\n\n\n/* For later on\n\n // length i is starting at 0, Category 1 would be 0, and so on.\n for (int i = 0; i < categoryCheck.length;i++) {\n // Counting up to .length = [13]\n // Since i less than, will start 0-12, i is not <= so we -1 from regular categories to match them\n // When returned false and not true, then the category is available for this.player to use\n categoryCheck[i] = false;\n }\n*/\n\n\n //Creating categoryScore to 13 new int's 0-12 in index form\n // We use I as an index just to replicate a for () for temp use in this method\n categoryScore = new int[13];\n for (int i = 0; i < categoryScore.length; i++) {\n categoryScore[i] = 0;\n }\n\n }", "public CustomSolver() {\n this.possibleSol = this.generateTokenSet();\n this.curToken = 0;\n }", "Rule createRule();", "Rule createRule();", "Rule createRule();", "private static List<Filter> enumAtomicFiltersLR(List<ValNode> L, List<ValNode> R, EnumContext ec, boolean allowExists) {\n // L contains all left values, and R contains all right values in a comparator\n List<Filter> atomics = new ArrayList<>();\n for (ValNode l : L) {\n for (ValNode r : R) {\n if (l.equalsToValNode(r)) continue;\n if (l instanceof ConstantVal && r instanceof ConstantVal) continue;\n\n if (l.getType(ec).equals(r.getType(ec))) {\n if (l.getType(ec).equals(ValType.DateVal) || l.getType(ec).equals(ValType.NumberVal)) {\n for (BiFunction<Value, Value, Boolean> func : VVComparator.getAllFunctions()) {\n atomics.add(new VVComparator(Arrays.asList(l, r), func));\n }\n } else {\n atomics.add(new VVComparator(Arrays.asList(l, r), VVComparator.eq));\n atomics.add(new VVComparator(Arrays.asList(l, r), VVComparator.neq));\n\n }\n }\n }\n }\n\n // Enumerate Filter with EXISTS clause, we don't want exists to\n if (allowExists) {\n List<ValNode> allValues = new ArrayList<>();\n allValues.addAll(L);\n allValues.addAll(R);\n allValues.addAll(ec.getValNodes());\n\n List<List<ValNode>> llvns = CombinationGenerator.genCombination(\n allValues, EnumParamTN.numberOfParams);\n for (List<ValNode> vns : llvns) {\n InstantiateEnv ie = new InstantiateEnv(vns, ec);\n atomics.addAll(\n ec.getParameterizedTables().stream().map(tn -> tn.instantiate(ie))\n .filter(t -> t.getAllHoles().size() == 0)\n .map(tn -> new ExistsFilter(tn))\n .collect(Collectors.toList()));\n // Also enumerate not exists\n atomics.addAll(\n ec.getParameterizedTables().stream().map(tn -> tn.instantiate(ie))\n .filter(t -> t.getAllHoles().size() == 0)\n .map(tn -> new ExistsFilter(tn, true))\n .collect(Collectors.toList()));\n }\n }\n\n // Add IS NULL for atomic filters\n // TODO: possibly just ignore it\n Set<ValNode> allValues = new HashSet<>();\n allValues.addAll(L);\n allValues.addAll(R);\n allValues.addAll(ec.getValNodes());\n\n for (ValNode vn : allValues) {\n if (vn instanceof ValHole)\n continue;\n atomics.add(new IsNullFilter(vn, true));\n atomics.add(new IsNullFilter(vn, false));\n }\n\n atomics.add(new EmptyFilter());\n\n return atomics;\n }", "public RuleBasedValidator() {\n globalRules = new ArrayList();\n rulesByProperty = new HashMap();\n }", "private void actOnRules() {\r\n\r\n\t\tfor(String key: myRuleBook.keySet())\r\n\t\t{\r\n\r\n\t\t\tRule rule = myRuleBook.get(key);\r\n\t\t\tSpriteGroup[] obedients = myRuleMap.get(rule);\r\n\r\n\t\t\tif(rule.isSatisfied(obedients))\r\n\t\t\t{\r\n\t\t\t\trule.enforce(obedients);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void filterAllRuleSetsForConfAndLift()\n\t{\n\t\truleCollection.forEach(lastRules->{\n\t\t\t\n\t\t\tif(!ListHelper.isNullOrEmpty(lastRules))\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Current Filter Rule Size:\"+lastRules.get(0).getRuleSize());\n\t\t\t}\n\t\t\t\n\t\t\tIterator<RuleCompartment<T>> iter = lastRules.iterator();\n\t\t\t\n\t\t\twhile(iter.hasNext())\n\t\t\t{\n\t\t\t\tRuleCompartment<T> eachRule = iter.next();\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tint ruleLength = eachRule.getRuleSize();\n\t\t\t\t\t\t\t\n\t\t\t\tif(ruleLength<config.getMinRuleLength())\n\t\t\t\t{\n\t\t\t\t\titer.remove();\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tdouble conf = eachRule.calculateConfidence(storage, evaluation);\n\t\t\t\t\n\t\t\t\tif(conf < config.minConf())\n\t\t\t\t{\n\t\t\t\t\titer.remove();\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tif(config.minLift()>0)\n\t\t\t\t{\n\t\t\t\t\tdouble lift = eachRule.calculateLift(storage, evaluation);\n\t\t\t\t\t\n\t\t\t\t\tif(lift < config.minLift())\n\t\t\t\t\t{\n\t\t\t\t\t\titer.remove();\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "public static void genRule(final PLFormula psi, final RuleSet rules) {\n\t\tPLFormula[] children = ((OR) psi).getChildren();\n\t\tAND and = (AND) children[(int) (Math.random() * children.length)];\n\t\tArrayList<Integer> left = new ArrayList<>();\n\t\tleft.addAll(and.asLitSet());\n\t\tdouble changes = (left.size() / 2) - 4 + Math.random() * 3;\n\t\t\n\t\tfor(int c = 0; c < changes || left.size() > 4; c++) {\n\t\t\tif(left.size() > 1)\n\t\t\t\tleft.remove((int) (Math.random() * left.size()));\n\t\t}\n\t\t\n\t\tLitSet right = new LitSet(li);\n\t\tright.addAll(left);\n\t\tchanges = 1 + Math.random() * (left.size() * 0.9);\n\t\tInteger definitive_removal = 0;\n\t\t\n\t\tfor(int c = 0; c < changes; c++) {\n\t\t\tif(right.size() > 0) {\n\t\t\t\tdefinitive_removal = left.get((int) (Math.random() * left.size()));\n\t\t\t\tright.remove(definitive_removal);\n\t\t\t}\n\t\t}\n\t\t\n\t\tchanges = 1 + Math.random() * (right.size() / 2);\n\t\t\n\t\tfor(int c = 0; c < changes; c++) {\n\t\t\tInteger literal = (int) (Math.random() * li.getVarCount());\n\t\t\t\n\t\t\twhile(literal == definitive_removal || literal == 0 || literal == 1 || literal == -1) {\n\t\t\t\tliteral = (int) (Math.random() * li.getVarCount());\n\t\t\t}\n\t\t\t\n\t\t\tif(!right.contains(literal)) {\n\t\t\t\tright.add(literal);\n\t\t\t}\n\t\t}\n\t\t\n\t\tLitSet ls_left = new LitSet(li);\n\t\tLitSet ls_right = new LitSet(li);\n\t\tLitSet ls_context = new LitSet(li);\n\t\tls_left.addAll(left);\n\t\tls_right.addAll(right);\n\t\t\n\t\tfor(Integer l : ls_right) {\n\t\t\tif(ls_left.contains(l)) {\n\t\t\t\tls_context.add(l);\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(Integer l : ls_context) {\n\t\t\tls_left.remove(l);\n\t\t\tls_right.remove(l);\n\t\t}\n\t\t\n\t\trules.addRule(new AND(li, ls_context), new AND(li, ls_left), new AND(li, ls_right), RULE_COSTS);\n\t}", "public Set<Class<? extends Rule<?, ?>>> getTransformationRules();", "public void setRules(ArrayList<Rule> rules) {\n\t\tthis.rules = rules;\n\t}", "ArrayList<Move> legalMoves() {\n ArrayList<Move> result = new ArrayList<Move>();\n int f, b;\n Move m;\n for (int i = 1; i < 8; i++) {\n for (int j = 1; j < 8; j++) {\n if (get(i,j).side() == _turn) {\n f = forward(j, i);\n b = backward(j, i);\n c = _col[j];\n r = _row[i];\n m = Move.create(j, i, j - b, i - b);\n addMove(result, m);\n m = Move.create(j, i, j + b, i + b);\n addMove(result, m);\n m = Move.create(j, i, j + f, i - f);\n addMove(result, m);\n m = Move.create(j, i, j - f, i + f);\n addMove(result, m);\n m = Move.create(j, i, j + c, i);\n addMove(result, m);\n m = Move.create(j, i, j - c, i);\n addMove(result, m);\n m = Move.create(j, i, j, i + r);\n addMove(result, m);\n m = Move.create(j, i, j, i - r);\n addMove(result, m);\n } else {\n continue;\n }\n }\n }\n return result;\n }", "public Vector getTargets(){\n return targets;\n }", "public void setValidateVector(Vector validateVector){ \r\n this.vecValidateRules = validateVector;\r\n specialReviewForm.setValidateVector(this.vecValidateRules);\r\n }", "private void addVertexVisitConstraint(){\n\n for (int vertex=0; vertex < vertexCount; vertex++){\n Integer[] pos = new Integer[variables.length];\n for (int position =0; position < positionCount; position++){\n pos[position] = variables[position][vertex];\n }\n addExactlyOne(pos);\n }\n }", "@Override\n public List<Vertex> solution(){\n return solution;\n }", "public List<Rule> getRules() {\r\n\t\treturn rules;\r\n\t}", "List<Direction> getValidDirectionsForMovement();", "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}", "public double[] calcSolution() {\n\t\t\n\t// Call CostFunction object\n\t\tcostFunction.function(position);\n\t\t\n\t\treturn solution;\n\t\t\n\t}", "@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}", "public static int getRulesPassed(){\r\n\t\treturn rulesPassed;\r\n\t}", "public static Vector<Action> makeActionVectorElementalEpisodes1() {\r\n\t\tVector<Action> actions = new Vector<Action>();\r\n\t\tactions.add(aEE1.clone());\r\n\t\tactions.add(aEE2.clone());\r\n\t\tactions.add(aEE3.clone());\r\n\t\tactions.add(aEE1.clone());\r\n\t\t\r\n\t\treturn actions;\r\n\t}", "protected Vector<WorldObject> getCanFilter(String commandId, String targetId, int roomId)\n\t{\n\t\treturn null;\n\t}", "int getRulesCount();", "public ArrayList<String> getRules() {\n return rules;\n }", "@Override\n public List<List<ICrosser>> solveGame() {\n return null;\n }", "public VariableUnit solve() {\n LinkedList<VariableUnit> processor = new LinkedList<VariableUnit>();\n\n VariableUnit vu1 = new VariableUnit(250.0, 'x');\n VariableUnit vu2 = new VariableUnit('+');\n VariableUnit vu3 = new VariableUnit(250.0, 'x');\n VariableUnit vu4 = new VariableUnit(501.0, 'x');\n VariableUnit vu5 = new VariableUnit('y');\n VariableUnit vu6 = new VariableUnit('-');\n alpha_arr.get(('x' - 'a')).addLast(vu1);\n alpha_arr.get(('x' - 'a')).addLast(vu2);\n alpha_arr.get(('x' - 'a')).addLast(vu3);\n op_order.add(vu1); op_order.add(vu2); op_order.add(vu3); op_order.add(vu6);\n op_order.add(vu4); op_order.add(vu6); op_order.add(vu5);\n assignValue(2.0, 'x');\n \n System.out.print(vu1); System.out.print(vu2); System.out.print(vu3);\n System.out.print(vu6); System.out.print(vu4); System.out.print(vu6);\n System.out.print(vu5);\n System.out.println();\n System.out.println(\"------------------------------\");\n \n VariableUnit temp, temp1;\n for (int i = 0; i < op_order.size(); i++) {\n \ttemp = op_order.pollFirst();\n \t\n \t\tswitch (temp.getVariable()) {\n \tcase '+':\n \t\t//if processor.isEmpty(): throw an exception\n \t\ttemp1 = processor.pop().add(op_order.pollFirst());\n \t\tprocessor.push(temp1);\n \t\tbreak;\n \tcase '-':\n \t\t//if processor.isEmpty(): throw an exception\n \t\ttemp1 = processor.pop().subtract(op_order.pollFirst());\n \t\tprocessor.push(temp1);\n \t\tbreak;\n \tdefault:\n \t\tprocessor.push(temp);\n \t\t}\n }\n\n /*\n * System.out.println(\"This equation is currently unsolvable.\");\n \tSystem.out.println(\"Try assigning values to some of the variables.\");\n */\n while (!processor.isEmpty()) {\n \top_order.addFirst(processor.pop());\n }\n \n ListIterator<VariableUnit> iter = op_order.listIterator();\n \n while ( iter.hasNext() ) {\n \tVariableUnit iter_temp = iter.next();\n \t//System.out.print(iter_temp.hasValue());\n \tif (iter_temp.hasValue()) {\n \t\tSystem.out.print( Double.toString(iter_temp.subValue()) );\n \t}\n \telse {\n \t\tSystem.out.print(iter_temp);\n \t}\n };\n System.out.println();\n \n return new VariableUnit(Double.NaN, ' ');\n }", "private DirectionTestResult getDirection() throws SimplexException {\r\n switch(pointCount) {\r\n case 1:\r\n return new DirectionTestResult(a.negate(new Vector2f()));\r\n case 2:\r\n Vector2f ab = b.sub(a);\r\n Vector2f perpAB = new Vector2f(-ab.y,ab.x);\r\n \r\n // check the perpendicular points opposite to vector A\r\n // i.e. towards the origin\r\n // if not, return the negated perpendicular and swap\r\n // points A and B to maintain clockwise rotation.\r\n if (perpAB.dot(a) < 0) {\r\n return new DirectionTestResult(perpAB);\r\n } else {\r\n Vector2f t = a;\r\n a = b;\r\n b = t;\r\n return new DirectionTestResult(perpAB.negate());\r\n }\r\n case 3:\r\n // first check line AC just like case 2\r\n Vector2f ac = c.sub(a);\r\n Vector2f perpAC = new Vector2f(-ac.y,ac.x);\r\n \r\n if (perpAC.dot(a) < 0) {\r\n b = c;\r\n c = null;\r\n pointCount = 2;\r\n return new DirectionTestResult(perpAC);\r\n }\r\n \r\n // now check line CB just like case 2\r\n Vector2f cb = b.sub(c);\r\n Vector2f perpCB = new Vector2f(-cb.y, cb.x);\r\n \r\n if (perpCB.dot(c) < 0) {\r\n a = c;\r\n c = null;\r\n pointCount = 2;\r\n return new DirectionTestResult(perpCB);\r\n }\r\n \r\n // if both checks failed the origin must be inside the\r\n // simplex which means there is a collision so return\r\n // a true directionTestResult\r\n \r\n return new DirectionTestResult();\r\n default:\r\n throw new SimplexException(\"pointCount outside acceptable range\");\r\n }\r\n }", "public com.walgreens.rxit.ch.cda.StrucDocTable.Rules xgetRules()\n {\n synchronized (monitor())\n {\n check_orphaned();\n com.walgreens.rxit.ch.cda.StrucDocTable.Rules target = null;\n target = (com.walgreens.rxit.ch.cda.StrucDocTable.Rules)get_store().find_attribute_user(RULES$26);\n return target;\n }\n }", "public interface ValidatingRule extends NormalisationRule\n{\n /**\n * Performs validation for the given stage by validating the input object using the criteria\n * defined for this rule.\n * \n * @param stage\n * A URI denoting the stage to use. This stage must be a valid stage for this type of\n * rule based on the result of validForStage(stage)\n * @param input\n * The input object to be validated by this rule.\n * @return True if the validation succeeded, or false otherwise.\n * @throws InvalidStageException\n * If the given stage was not valid.\n * @throws ValidationFailedException\n * If the validation failed.\n * @throws QueryAllException\n * If the validation process did not complete.\n */\n boolean normaliseByStage(URI stage, Object input) throws InvalidStageException, ValidationFailedException,\n QueryAllException;\n \n /**\n * Validates the given input object in the stage after query creation, but before query parsing.\n * \n * @param input\n * The input object to be validated.\n * @return True if the input object was valid and false otherwise.\n * @throws ValidationFailedException\n * If the validation failed.\n */\n boolean stageAfterQueryCreation(Object input) throws ValidationFailedException;\n \n /**\n * Validates the given input object in the stage after query parsing, but before query\n * submission to the provider.\n * \n * @param input\n * The input object to be validated.\n * @return True if the input object was valid and false otherwise.\n * @throws ValidationFailedException\n * If the validation failed.\n */\n boolean stageAfterQueryParsing(Object input) throws ValidationFailedException;\n \n /**\n * Validates the given input object in the stage after the RDF results have been imported from\n * the results for a provider, but before they have been merged into a pool with results from\n * other providers.\n * \n * @param input\n * The input object to be validated.\n * @return True if the input object was valid and false otherwise.\n * @throws ValidationFailedException\n * If the validation failed.\n */\n boolean stageAfterResultsImport(Object input) throws ValidationFailedException;\n \n /**\n * Validates the given input object in the stage after the combined RDF statements in the pool\n * have been serialised to the results document.\n * \n * @param input\n * The input object to be validated.\n * @return True if the input object was valid and false otherwise.\n * @throws ValidationFailedException\n * If the validation failed.\n */\n boolean stageAfterResultsToDocument(Object input) throws ValidationFailedException;\n \n /**\n * Validates the given input object in the stage after the RDF results have been merged into a\n * pool of RDF statements, but before they have been serialised to the results document.\n * \n * @param input\n * The input object to be validated.\n * @return True if the input object was valid and false otherwise.\n * @throws ValidationFailedException\n * If the validation failed.\n */\n boolean stageAfterResultsToPool(Object input) throws ValidationFailedException;\n \n /**\n * Validates the given input object in the stage after results have been returned from a\n * provider, but before they have been parsed into RDF statements.\n * \n * @param input\n * The input object to be validated.\n * @return True if the input object was valid and false otherwise.\n * @throws ValidationFailedException\n * If the validation failed.\n */\n boolean stageBeforeResultsImport(Object input) throws ValidationFailedException;\n \n /**\n * Validates the given input object in the stage where query variables are being normalised\n * based on the context of the provider.\n * \n * @param input\n * The input object to be validated.\n * @return True if the input object was valid and false otherwise.\n * @throws ValidationFailedException\n * If the validation failed.\n */\n boolean stageQueryVariables(Object input) throws ValidationFailedException;\n}", "E3Rule createE3Rule();", "public static void main(String[] args) {\n\t\t\n//\t\t//PA4 a\n//\t\tArrayList<ArrayList<String>> rhs1 = new ArrayList<>();\n//\t\tArrayList<String> rhs11 = new ArrayList<>();\n//\t\trhs11.add(\"S\");rhs11.add(\"a\");\n//\t\tArrayList<String> rhs12 = new ArrayList<>();\n//\t\trhs12.add(\"b\");\t\t\n//\t\trhs1.add(rhs11);\n//\t\trhs1.add(rhs12);\n//\n//\t\tRule r1 = new Rule(\"S\", rhs1); // S -> Aa | b\n//\t\tArrayList<Rule> rules = new ArrayList<>();\n//\t\trules.add(r1);\n//\t\tGrammar g = new Grammar(rules);\n//\t\tg.eliminateEpsilonRule();\n//\t\tg.eliminateLR();\n//\t\tSystem.out.println(g);\n//\t\tSystem.out.println(\"----------------------\");\n\t\t\n//\t\t//PA4 b\n//\t\tArrayList<ArrayList<String>> rhs1 = new ArrayList<>();\n//\t\tArrayList<String> rhs11 = new ArrayList<>();\n//\t\trhs11.add(\"S\");rhs11.add(\"a\");rhs11.add(\"b\");\n//\t\tArrayList<String> rhs12 = new ArrayList<>();\n//\t\trhs12.add(\"c\");rhs12.add(\"d\");\t\t\n//\t\trhs1.add(rhs11);\n//\t\trhs1.add(rhs12);\n//\n//\t\tRule r1 = new Rule(\"S\", rhs1); // S -> Aa | b\n//\t\tArrayList<Rule> rules = new ArrayList<>();\n//\t\trules.add(r1);\n//\t\tGrammar g = new Grammar(rules);\n//\t\tg.eliminateEpsilonRule();\n//\t\tg.eliminateLR();\n//\t\tSystem.out.println(g);\n//\t\tSystem.out.println(\"----------------------\");\n\t\t\n//\t\t//PA4 c\n//\t\tArrayList<ArrayList<String>> rhs1 = new ArrayList<>();\n//\t\tArrayList<String> rhs11 = new ArrayList<>();\n//\t\trhs11.add(\"S\");rhs11.add(\"U\");rhs11.add(\"S\");\n//\t\tArrayList<String> rhs12 = new ArrayList<>();\n//\t\trhs12.add(\"S\");rhs12.add(\"S\");\t\t\n//\t\tArrayList<String> rhs13 = new ArrayList<>();\n//\t\trhs13.add(\"S\");rhs13.add(\"*\");\n//\t\tArrayList<String> rhs14 = new ArrayList<>();\n//\t\trhs14.add(\"(\");rhs14.add(\"S\");rhs14.add(\")\");\n//\t\tArrayList<String> rhs15 = new ArrayList<>();\n//\t\trhs15.add(\"a\");\n//\t\trhs1.add(rhs11);\n//\t\trhs1.add(rhs12);\n//\t\trhs1.add(rhs13);\n//\t\trhs1.add(rhs14);\n//\t\trhs1.add(rhs15);\n//\n//\n//\t\tRule r1 = new Rule(\"S\", rhs1); // S -> Aa | b\n//\t\tArrayList<Rule> rules = new ArrayList<>();\n//\t\trules.add(r1);\n//\t\tGrammar g = new Grammar(rules);\n//\t\tg.eliminateEpsilonRule();\n//\t\tg.eliminateLR();\n//\t\tSystem.out.println(g);\n//\t\tSystem.out.println(\"----------------------\");\n\t\t\n\t\t\n//\t\t//PA-3 d\n//\t\t\n//\t\tArrayList<ArrayList<String>> rhs1 = new ArrayList<>();\n//\t\tArrayList<String> rhs11 = new ArrayList<>();\n//\t\trhs11.add(\"rexpr\");rhs11.add(\"U\");rhs11.add(\"rterm\");\t\n//\t\tArrayList<String> rhs12 = new ArrayList<>();\n//\t\trhs12.add(\"rterm\");\n//\t\trhs1.add(rhs11);\n//\t\trhs1.add(rhs12);\n//\t\tRule r1 = new Rule(\"rexpr\", rhs1);\n//\n//\t\tArrayList<ArrayList<String>> rhs2 = new ArrayList<>();\n//\t\tArrayList<String> rhs21 = new ArrayList<>();\n//\t\trhs21.add(\"rterm\");rhs21.add(\"r factor\");\n//\t\tArrayList<String> rhs22 = new ArrayList<>();\n//\t\trhs22.add(\"r factor\");\n//\t\trhs2.add(rhs21);\n//\t\trhs2.add(rhs22);\n//\t\tRule r2 = new Rule(\"rterm\", rhs2);\n//\n//\t\tArrayList<ArrayList<String>> rhs3 = new ArrayList<>();\n//\t\tArrayList<String> rhs31 = new ArrayList<>();\n//\t\trhs31.add(\"r factor\");rhs31.add(\"*\");\n//\t\tArrayList<String> rhs32 = new ArrayList<>();\n//\t\trhs32.add(\"rprimary\");\n//\t\trhs3.add(rhs31);\n//\t\trhs3.add(rhs32);\n//\t\tRule r3 = new Rule(\"r factor\", rhs3);\n//\t\t\n//\t\tArrayList<ArrayList<String>> rhs4 = new ArrayList<>();\n//\t\tArrayList<String> rhs41 = new ArrayList<>();\n//\t\trhs41.add(\"a\");\n//\t\tArrayList<String> rhs42 = new ArrayList<>();\n//\t\trhs42.add(\"b\");\n//\t\trhs4.add(rhs41);\n//\t\trhs4.add(rhs42);\n//\t\tRule r4 = new Rule(\"rprimary\", rhs4);\n//\n//\t\tArrayList<Rule> rules = new ArrayList<>();\n//\t\trules.add(r1);\n//\t\trules.add(r2);\n//\t\trules.add(r3);\n//\t\trules.add(r4);\n//\t\tGrammar g = new Grammar(rules);\n//\t\tg.eliminateEpsilonRule();\n//\t\tg.eliminateLR();\n//\n//\t\tSystem.out.println(g);\n//\t\tSystem.out.println(\"----------------------\");\t\n\t\t\t\n//\t\t//PA-3 e\t\n//\t\t\n//\t\tArrayList<ArrayList<String>> rhs1 = new ArrayList<>();\n//\t\tArrayList<String> rhs11 = new ArrayList<>();\n//\t\trhs11.add(\"0\");\n//\t\tArrayList<String> rhs12 = new ArrayList<>();\n//\t\trhs12.add(\"T\");rhs12.add(\"1\");\t\t\n//\t\trhs1.add(rhs11);\n//\t\trhs1.add(rhs12);\n//\t\t\n//\t\tArrayList<ArrayList<String>> rhs2 = new ArrayList<>();\n//\t\tArrayList<String> rhs21 = new ArrayList<>();\n//\t\trhs21.add(\"1\");\n//\t\tArrayList<String> rhs22 = new ArrayList<>();\n//\t\trhs22.add(\"A\");rhs22.add(\"0\");\t\t\n//\t\trhs2.add(rhs21);\n//\t\trhs2.add(rhs22);\n//\n//\t\tRule r1 = new Rule(\"A\", rhs1);\n//\t\tRule r2 = new Rule(\"T\", rhs2);\n//\n//\t\tArrayList<Rule> rules = new ArrayList<>();\n//\t\trules.add(r1);\n//\t\trules.add(r2);\n//\t\tGrammar g = new Grammar(rules);\n//\t\tg.eliminateEpsilonRule();\n//\t\tg.eliminateLR();\n//\t\tSystem.out.println(g);\n//\t\tSystem.out.println(\"----------------------\");\n\n\n\t\t\n//\t\t//PA-3 f\n//\t\t\n//\t\tArrayList<ArrayList<String>> rhs1 = new ArrayList<>();\n//\t\tArrayList<String> rhs11 = new ArrayList<>();\n//\t\trhs11.add(\"B\");rhs11.add(\"C\");\t\n//\t\trhs1.add(rhs11);\n//\t\tRule r1 = new Rule(\"A\", rhs1);\n//\n//\t\tArrayList<ArrayList<String>> rhs2 = new ArrayList<>();\n//\t\tArrayList<String> rhs21 = new ArrayList<>();\n//\t\trhs21.add(\"B\");rhs21.add(\"b\");\n//\t\tArrayList<String> rhs22 = new ArrayList<>();\n//\t\trhs22.add(\"e\");\n//\t\trhs2.add(rhs21);\n//\t\trhs2.add(rhs22);\n//\t\tRule r2 = new Rule(\"B\", rhs2);\n//\n//\t\tArrayList<ArrayList<String>> rhs3 = new ArrayList<>();\n//\t\tArrayList<String> rhs31 = new ArrayList<>();\n//\t\trhs31.add(\"A\");rhs31.add(\"C\");\n//\t\tArrayList<String> rhs32 = new ArrayList<>();\n//\t\trhs32.add(\"a\");\n//\t\trhs3.add(rhs31);\n//\t\trhs3.add(rhs32);\n//\t\tRule r3 = new Rule(\"C\", rhs3);\n//\n//\t\tArrayList<Rule> rules = new ArrayList<>();\n//\t\trules.add(r1);\n//\t\trules.add(r2);\n//\t\trules.add(r3);\n//\t\tGrammar g = new Grammar(rules);\n//\t\tSystem.out.println(g);\n//\t\tg.eliminateEpsilonRule();\n//\t\tSystem.out.println(g);\n//\n//\t\tg.eliminateLR();\n//\n//\t\tSystem.out.println(g);\n//\t\tSystem.out.println(\"----------------------\");\n\n\t}", "@Override\r\n protected void initializeRules(List<AbstractValidationCheck> rules) {\n\r\n }", "public BoundCodeDt<SlicingRulesEnum> getRulesElement() { \n\t\tif (myRules == null) {\n\t\t\tmyRules = new BoundCodeDt<SlicingRulesEnum>(SlicingRulesEnum.VALUESET_BINDER);\n\t\t}\n\t\treturn myRules;\n\t}", "public interface FwRules {\r\n \r\n\tboolean generateQuery();\r\n\t\r\n IntrospectedTable getIntrospectedTable();\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 }", "public void validate(IValidation results) {\n if (_inputGrids.isEmpty()) {\n results.error(_inputGrids, \"No input grids specified.\");\n } else {\n // Validate all selected grids are in either the time or depth domain.\n for (Grid3d inputGrid : _inputGrids.get()) {\n if (!inputGrid.isTimeGrid() && !inputGrid.isDepthGrid()) {\n results.error(_inputGrids, \"One or more input grids in not the time or depth domain.\");\n }\n }\n }\n\n // Validate that a velocity volume is selected.\n if (_velocityVolume.isNull()) {\n results.error(_velocityVolume, \"No velocity volume specified\");\n } else {\n // Validate the unit of the velocity volume are in the velocity domain.\n PostStack3d velocityVolume = _velocityVolume.get();\n Unit velocityUnit = velocityVolume.getDataUnit();\n if (velocityUnit != Unit.METERS_PER_SECOND && velocityUnit != Unit.FEET_PER_SECOND) {\n results.error(_velocityVolume, \"Invalid velocity units. Must be \" + Unit.METERS_PER_SECOND.getSymbol() + \" or \"\n + Unit.FEET_PER_SECOND.getSymbol() + \".\");\n }\n StorageOrder storageOrder = velocityVolume.getPreferredOrder();\n if (!storageOrder.equals(StorageOrder.INLINE_XLINE_Z) && !storageOrder.equals(StorageOrder.XLINE_INLINE_Z)) {\n results.error(_velocityVolume, \"Unsupported storage order: \" + storageOrder);\n }\n }\n\n // Validate that an area-of-interest is selected, if used.\n if (_aoiFlag.get()) {\n if (_aoi.isNull()) {\n results.error(_aoi, \"No area-of-interest specified.\");\n }\n }\n }", "@Test\n\tpublic void testScenario04_ControllingWhichMethodsRun() throws Exception {\n\t\tSpelExpressionParser parser = new SpelExpressionParser();\n\t\tStandardEvaluationContext ctx = new StandardEvaluationContext();\n\n\t\tctx.setRootObject(new Supervisor(\"Ben\")); // so non-qualified references 'hasRole()' 'hasIpAddress()' are invoked against it;\n\n\t\tctx.addMethodResolver(new MyMethodResolver()); // NEEDS TO OVERRIDE THE REFLECTION ONE - SHOW REORDERING MECHANISM\n\t\t// Might be better with a as a variable although it would work as a property too...\n\t\t// Variable references using a '#'\n//\t\tSpelExpression expr = parser.parseExpression(\"(hasRole('SUPERVISOR') or (#a < 1.042)) and hasIpAddress('10.10.0.0/16')\");\n\t\tExpression expr = parser.parseRaw(\"(hasRole(3) or (#a < 1.042)) and hasIpAddress('10.10.0.0/16')\");\n\n\t\tBoolean value = null;\n\n\t\tctx.setVariable(\"a\",1.0d); // referenced as #a in the expression\n\t\tvalue = expr.getValue(ctx,Boolean.class);\n\t\tassertThat((boolean) value).isTrue();\n\n//\t\t\tctx.setRootObject(new Manager(\"Luke\"));\n//\t\t\tctx.setVariable(\"a\",1.043d);\n//\t\t\tvalue = (Boolean)expr.getValue(ctx,Boolean.class);\n//\t\t\tassertFalse(value);\n\t}", "public interface Rule {\n\n /**\n * Process this security event and detects whether this represents a security breach from the perspective of this rule\n * \n * @param event\n * event to process\n * @return security breach - either a breach or not (could be delayed)\n */\n SecurityBreach isSecurityBreach(SecurityEvent event);\n\n /**\n * Detects whether this rule is applicable in the in-passed security mode. Each rule guarantees to return the very same value of this method at\n * runtime. E.g. if this method returns true for an instance, it is guaranteed it will always return true within the lifecycle of this object\n * \n * @param securityMode\n * security mode to test applicability of this rule against\n * @return true if so, false otherwise\n */\n boolean isApplicable(SecurityMode securityMode);\n\n /**\n * Detects whether this rule is enabled or not\n * \n * @return true if so, false otherwise\n */\n boolean isEnabled();\n\n /**\n * Get human readable description of this rule. It should be a unique string compared to all other rules\n * \n * @return unique description of this rule\n */\n String getDescription();\n\n /**\n * Gets Unique ID of this Rule\n * \n * @return integer identification of this rule\n */\n int getId();\n\n /**\n * Update this rule based on the in-passed rule detail (e.g. whether it is enabled, etc)\n * \n * @param ruleDetail\n * rule detail to use to update this rule\n */\n void updateFrom(RuleDetail ruleDetail);\n}", "private void addVertexPositionConstraint(){\n for (int vertex=0; vertex < vertexCount; vertex++){\n addExactlyOne(variables[vertex]);\n }\n }", "public interface Rules {\n\n public String getName();\n public String getSalary();\n}", "private void getTimeConditions(List<RuleInstance> rules,Set<Condition> conds)\n{\n for (RuleInstance ri : rules) {\n getTimeConditions(ri,rules,conds);\n }\n}", "public String getRules() { \n\t\treturn getRulesElement().getValue();\n\t}", "@SuppressWarnings(\"boxing\")\n public int[] getMatching() {\n if (this.n == -1 || this.m == -1) {\n throw new IllegalStateException(\"Graph size not specified.\");\n }\n if (this.n == 0) {\n return new int[0];\n }\n ensurePositiveWeights();\n\n // Step 0: Initialization\n this.eligibleS.clear();\n this.eligibleT.clear();\n for (Integer i = 0; i < this.n; i++) {\n this.sMatches[i] = -1;\n\n this.u[i] = this.maxWeight; // ambiguous on p. 205 of Lawler, but see p. 202\n\n // this is really first run of Step 1.0\n this.sLabels[i] = EMPTY_LABEL;\n this.eligibleS.add(i);\n }\n\n for (int j = 0; j < this.m; j++) {\n this.tMatches[j] = -1;\n\n this.v[j] = 0;\n this.pi[j] = Double.POSITIVE_INFINITY;\n\n // this is really first run of Step 1.0\n this.tLabels[j] = NO_LABEL;\n }\n\n while (true) {\n // Augment the matching until we can't augment any more given the\n // current settings of the dual variables.\n while (true) {\n // Steps 1.1-1.4: Find an augmenting path\n int lastNode = findAugmentingPath();\n if (lastNode == -1) {\n break; // no augmenting path\n }\n\n // Step 2: Augmentation\n flipPath(lastNode);\n for (int i = 0; i < this.n; i++)\n this.sLabels[i] = NO_LABEL;\n\n for (int j = 0; j < this.m; j++) {\n this.pi[j] = Double.POSITIVE_INFINITY;\n this.tLabels[j] = NO_LABEL;\n }\n\n // This is Step 1.0\n this.eligibleS.clear();\n for (int i = 0; i < this.n; i++) {\n if (this.sMatches[i] == -1) {\n this.sLabels[i] = EMPTY_LABEL;\n this.eligibleS.add(i);\n }\n }\n\n this.eligibleT.clear();\n }\n\n // Step 3: Change the dual variables\n\n // delta1 = min_i u[i]\n double delta1 = Double.POSITIVE_INFINITY;\n for (int i = 0; i < this.n; i++) {\n if (this.u[i] < delta1) {\n delta1 = this.u[i];\n }\n }\n\n // delta2 = min_{j : pi[j] > 0} pi[j]\n double delta2 = Double.POSITIVE_INFINITY;\n for (int j = 0; j < this.m; j++) {\n if ((this.pi[j] >= TOL) && (this.pi[j] < delta2)) {\n delta2 = this.pi[j];\n }\n }\n\n if (delta1 < delta2) {\n // In order to make another pi[j] equal 0, we'd need to\n // make some u[i] negative.\n break; // we have a maximum-weight matching\n }\n\n changeDualVars(delta2);\n }\n\n int[] matching = new int[this.n];\n for (int i = 0; i < this.n; i++) {\n matching[i] = this.sMatches[i];\n }\n return matching;\n }", "protected HashSet<GoapAction> extractPossibleActions() {\r\n\t\tHashSet<GoapAction> possibleActions = new HashSet<GoapAction>();\r\n\r\n\t\ttry {\r\n\t\t\tfor (GoapAction goapAction : this.goapUnit.getAvailableActions()) {\r\n\t\t\t\tif (goapAction.checkProceduralPrecondition(this.goapUnit)) {\r\n\t\t\t\t\tpossibleActions.add(goapAction);\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}\r\n\t\treturn possibleActions;\r\n\t}", "@Override\n public List<Rule> getTotalRules() {\n return List.of(getTotalGreaterThan60Rule());\n }", "private void passValidation (VCFLine currentLine) {\n\t\tboolean hasPassed = false;\n\n\t\tif (!currentLine.isLastLine() && currentLine.isValid()) {\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// The line has to be a valid line to be processed\n\t\t\tcurrentLine.processForAnalyse();\n\t\t\tint[] lengths = VCFLineUtility.getVariantLengths(currentLine.getREF(), Utils.split(currentLine.getALT(), ','), currentLine.getINFO());\t\t// Retrieves the length of all defined variations of the line\n\t\t\tVariantType[] variations = VCFLineUtility.getVariantTypes(lengths);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Converts the lengths into variation types (insertion, deletion...)\n\n\t\t\tallValidIndex = new ArrayList<Integer>();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Initializes the array that will contain all valid alternative indexes of the line\n\t\t\tallValidGenome = new ArrayList<String>();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Initializes the array that will contain all valid genome names of the line\n\n\t\t\tfor (int i = 0; i < genomeList.size(); i++) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Will scan information for all genomes of the line\n\t\t\t\tint[] altIndexes = getAlternativeIndexes(genomeList.get(i), reader, synchronizer);\t\t\t\t\t\t\t\t\t\t\t\t// Gets indexes defined by the GT type ('.' is converted as -1)\n\t\t\t\tList<Integer> validIndex = getValidIndexes(variationMap.get(genomeList.get(i)), variations, altIndexes);\t\t\t\t\t\t// Only keeps the valid ones (excludes the ones referring to the reference)\n\t\t\t\tif (validIndex.size() > 0) {\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// If we have found at least one valid index (one variant matching the variation requirements)\n\t\t\t\t\tif (isValid(currentLine)) {\n\t\t\t\t\t\tallValidGenome.add(genomeList.get(i));\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// If the process comes here, it means information has been found for the current genome\n\t\t\t\t\t\tfor (int index: validIndex) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// For all found indexes\n\t\t\t\t\t\t\tif (!allValidIndex.contains(index)) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// If it does not have been stored yet\n\t\t\t\t\t\t\t\tallValidIndex.add(index);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// We store it\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (allValidGenome.size() > 0) {\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// If information has been found for at least one genome\n\t\t\t\thasPassed = true;\n\t\t\t}\n\t\t}\n\n\t\tcurrentLine.setHasData(hasPassed);\n\t}", "public abstract ArrayList< Double > getObjectiveCoefs();", "public ArrayList<Restriction> getRestrictions()\r\n {\r\n\tif(restrictions.isEmpty()) {\r\n\t restrictions.add(Restriction.NONE);\r\n\t}\r\n\treturn new ArrayList<Restriction>(restrictions);\r\n }", "public void directionRestriction(){\n \t\n }" ]
[ "0.55253935", "0.5482301", "0.5372715", "0.5309149", "0.52927285", "0.5275553", "0.5227536", "0.51644", "0.51531255", "0.51265293", "0.5113182", "0.5050074", "0.5027279", "0.50236064", "0.49610755", "0.49597722", "0.49524552", "0.49503928", "0.4940974", "0.49385723", "0.48907676", "0.4880053", "0.4859351", "0.48539758", "0.48188403", "0.48085654", "0.48025578", "0.4791764", "0.47614896", "0.4755273", "0.47502735", "0.4716732", "0.4715072", "0.47102994", "0.47097075", "0.4708921", "0.4707546", "0.46994874", "0.4698381", "0.4697555", "0.46968955", "0.4684428", "0.46765968", "0.46709248", "0.46696344", "0.46690932", "0.46485987", "0.46477905", "0.4638731", "0.4638679", "0.46178547", "0.46178547", "0.46178547", "0.46157432", "0.46017373", "0.45890802", "0.45871857", "0.45851335", "0.45825166", "0.45689556", "0.45684996", "0.456145", "0.45552945", "0.45548096", "0.4545807", "0.45418864", "0.45342153", "0.453194", "0.45299056", "0.45203456", "0.45183474", "0.45155627", "0.4513306", "0.4500151", "0.44934452", "0.44932723", "0.44910017", "0.44857985", "0.44797236", "0.44765943", "0.44749257", "0.44704884", "0.44682962", "0.4467997", "0.44632936", "0.44567907", "0.44532028", "0.44488084", "0.4443335", "0.4442657", "0.4441473", "0.44318905", "0.44300506", "0.44294608", "0.44257098", "0.44170582", "0.44148144", "0.44131073", "0.4401063", "0.44003165" ]
0.5641438
0